1
0
mirror of https://github.com/django/django.git synced 2025-08-23 10:19:13 +00:00

[4.1.x] Doc'd when pre_save() is called with Model.save()'s update_fields.

Backport of bf47c719719d0e190a99fa2e7f959d5bbb7caf8a from main
This commit is contained in:
sarahboyce 2022-09-23 23:13:46 +02:00 committed by Mariusz Felisiak
parent fba7962bac
commit ba4141b8bc

View File

@ -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 ``update_fields`` in this case. If you assign or change any deferred field
value, the field will be added to the updated fields. 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 Deleting objects
================ ================