method as default field option

2006-08-02 Thread bernie2004
i would really like to know if there is a way around getting the same values when adding new entries through the admin when using defaults like those: models.CharField( default=random.randint(1,1000) ) or models.CharField( default=time.time() ) or in other words: is there any way to insert by de

Re: method as default field option

2006-08-03 Thread bernie2004
Malcolm Tredinnick wrote: > The reason you are getting the same values all the time is because the > random.randint(1,1000) and time.time() calls are being evaluated when > the CharFiueld instance is created, which is at your model *class* > creation time (i.e. import time, essentially). Not when

Kid templates ValueError: too many values to unpack

2006-08-03 Thread bernie2004
Does anybody got a clue about this one? I just wanted to give Kid templates a try but got stuck pretty fast: Traceback (most recent call last): File "... /django/core/servers/basehttp.py", line 272, in run self.result = application(self.environ, self.start_response) File "... /django/core

Re: Kid templates ValueError: too many values to unpack

2006-08-04 Thread bernie2004
Adrian Holovaty wrote: > On 8/3/06, bernie2004 <[EMAIL PROTECTED]> wrote: > > File "... /django/views/debug.py", line 18, in > > get_template_exception_info > > origin, (start, end) = exc_value.source > > > > ValueError: too many values to

generic views object_list & custom template tags

2006-08-04 Thread bernie2004
when using a generic views object_list, i would like to know if there is a faster way to get all the extra variables inside a custom template tag: {% navigation pages page has_previous has_next %} and @register.simple_tag def navigation( pages, page, has_previous, has_next ): ... create som

Re: Work with FileField directly

2006-08-06 Thread bernie2004
Adam Seering wrote: > I'm trying to make a form that, among other things, allows a user to > upload one or more files (the number of files will vary; it's a form to > upload images that are missing on a vaguely-Wiki-like page). Each > uploaded file creates a new table entry; the non-FileFields in