Kaydet (Commit) ca5c05dd authored tarafından Duane Hilton's avatar Duane Hilton Kaydeden (comit) Tim Graham

Fixed #26239 -- Added a note about how auto_now works with QuerySet.update().

üst 2495023a
...@@ -501,6 +501,12 @@ optional arguments: ...@@ -501,6 +501,12 @@ optional arguments:
for "last-modified" timestamps. Note that the current date is *always* for "last-modified" timestamps. Note that the current date is *always*
used; it's not just a default value that you can override. used; it's not just a default value that you can override.
The field is only automatically updated when calling :meth:`Model.save()
<django.db.models.Model.save>`. The field isn't updated when making updates
to other fields in other ways such as :meth:`QuerySet.update()
<django.db.models.query.QuerySet.update>`, though you can specify a custom
value for the field in an update like that.
.. attribute:: DateField.auto_now_add .. attribute:: DateField.auto_now_add
Automatically set the field to now when the object is first created. Useful Automatically set the field to now when the object is first created. Useful
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment