The reason this won't work is because in the models class everything is placed into the database. It is quite difficult to have different values be whatever and have it placed into the database in a coherent way.
Check out the models documentation http://www.djangoproject.com/documentation/model-api/#datefield there is an option for date field that should serve your purposes. On Thu, Mar 6, 2008 at 5:05 PM, DuncanM <[EMAIL PROTECTED]> wrote: > > I want to create a model that doesn't ask for the users input on the > date, it takes the days date automatically, > > I thought it would be as simple as doing: > > class News(models.Model): > newsTitle = models.CharField("News Title", maxlength=200, core=True, > help_text="Title of the news item e.g. website launch") > date = datetime.date.today() > author = models.CharField(maxlength=200) > > > But apparently not as this does not work. Could anyone help please? > > Also I would ideally like the author to be autopopulated by whoever > posts the item using the admin interface. How would I do this? > > > Thanks, > Duncan > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

