From b0e2cb8e470acc552b4ed3fde3d5b1322b426bf2 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 8 Sep 2012 06:38:41 -0400 Subject: [1.4.X] Fixed #15566 - Documented that update() doesn't honor DateField.auto_now Thanks Shabda Raaj for the draft patch. Backport of dc01e41d23 from master --- docs/topics/db/queries.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'docs/topics') diff --git a/docs/topics/db/queries.txt b/docs/topics/db/queries.txt index 0a67b9b486..e7b45f04fd 100644 --- a/docs/topics/db/queries.txt +++ b/docs/topics/db/queries.txt @@ -968,11 +968,12 @@ Be aware that the ``update()`` method is converted directly to an SQL statement. It is a bulk operation for direct updates. It doesn't run any :meth:`~django.db.models.Model.save` methods on your models, or emit the ``pre_save`` or ``post_save`` signals (which are a consequence of calling -:meth:`~django.db.models.Model.save`). If you want to save every item in a -:class:`~django.db.models.query.QuerySet` and make sure that the -:meth:`~django.db.models.Model.save` method is called on each instance, you -don't need any special function to handle that. Just loop over them and call -:meth:`~django.db.models.Model.save`:: +:meth:`~django.db.models.Model.save`), or honor the +:attr:`~django.db.models.DateField.auto_now` field option. +If you want to save every item in a :class:`~django.db.models.query.QuerySet` +and make sure that the :meth:`~django.db.models.Model.save` method is called on +each instance, you don't need any special function to handle that. Just loop +over them and call :meth:`~django.db.models.Model.save`:: for item in my_queryset: item.save() -- cgit v1.3