#10970: auto_now_add for DateField evaluetes to datetime.datetime instance
------------------------------------------+---------------------------------
 Reporter:  summerisgone                  |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  1.0       
 Keywords:  DateField, auto_now_add       |       Stage:  Unreviewed
Has_patch:  0                             |  
------------------------------------------+---------------------------------
 I've set '''auto_now_add''' to DateField, but it evaluates to
 '''datetime.datetime''' instance rather than '''datetime.date'''.
 Here some example:

 code in models.py
 {{{
 class Order(models.Model):
     created = models.DateField(auto_now_add=True)
 }}}

 and manage.py shell output:
 {{{
 In [1]: from app.models import Order
 In [3]: o = Order()
 In [4]: o.save()
 In [5]: o.created
 Out[5]: datetime.datetime(2009, 5, 1, 2, 53, 32, 280919)
 }}}

 I'm using django-1.0.2-final

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10970>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to