#16583: Explicitly passing a date to a DateTimeField in a model's create method
should override auto_now_add
-----------------+----------------------------------------------
 Reporter:  ian  |          Owner:  nobody
     Type:  Bug  |         Status:  new
Milestone:       |      Component:  Database layer (models, ORM)
  Version:  1.3  |       Severity:  Normal
 Keywords:       |   Triage Stage:  Unreviewed
Has patch:  0    |  Easy pickings:  0
    UI/UX:  0    |
-----------------+----------------------------------------------
 I'm writing some unit tests where I'm testing specific logic based on
 DateTimeFields in a model.  When I use the .create() method on the model,
 I pass in a specific datetime to the DateTimeField but it gets ignored and
 overwritten by the auto_now_add functionality.

 The only way I can do what I want is by first creating, then altering the
 value on the DateTimeField, then saving a second time to override.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16583>
Django <https://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