On Sun, 2008-12-21 at 21:46 -0700, Greg Schwimer wrote:
> OK, that was very helpful, thank you. Yes, my problem is because I am
> not setting the date. Thinking it through, I don't want the user
> changing this, so it would be helpful to use the auto_now_add idea you
> suggested. However, I can't get that working. Here's my mode;
> definition for pub_date:
>
> pub_date = models.DateTimeField('date published')
>
> The docs you referred to suggest the approach might look something
> like this:
>
> pub_date = models.DateTimeField([auto_now_add=True], 'date
> published)
The square brackets in documentation are a fairly standard way of saying
that parameter is optional. To use the parameter, type it in without the
square brackets. Thus:
pub_date = models.DateTimeField('date published', auto_now_add=True)
Regards,
Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---