Skip to content

Commit

Permalink
Doc'd when pre_save() is called with Model.save()'s update_fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahboyce authored and felixxm committed Sep 27, 2022
1 parent ae3d575 commit bf47c71
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/ref/models/instances.txt
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,14 @@ from the DB will get updated. In effect there is an automatic
``update_fields`` in this case. If you assign or change any deferred field
value, the field will be added to the updated fields.

.. note::

If ``update_fields`` is passed in, only the
:meth:`~django.db.models.Field.pre_save` methods of the ``update_fields``
are called. For example, this means that date/time fields with
``auto_now=True`` will not be updated unless they are included in the
``update_fields``.

Deleting objects
================

Expand Down

0 comments on commit bf47c71

Please sign in to comment.