date needs to be a DateTimeField, and you can also use the built in
auto_now_add

date = models.DateTimeField(auto_now_add = True)

On Mar 6, 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to