No. Request object does not exist when model classes are created.
On Fri, Nov 21, 2008 at 13:47, FT <[EMAIL PROTECTED]> wrote: > > class Document(models.Model): > > created = models.DateTimeField( > help_text='Timestamp when the document is created', > blank=True, > default=datetime.datetime.now) > > author = models.EmailField(blank=True, default=request.user) > > Hi there, > > I'm trying to set up a default value the author field in the model > above as the current user as the default value. > Is there any way to access the request object from here? > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---