diff options
| author | sarahboyce <sarahvboyce95@gmail.com> | 2022-09-23 23:13:46 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-09-27 14:11:04 +0200 |
| commit | ba4141b8bca0351b8a4cbf2379ccde807c283d97 (patch) | |
| tree | a73d0a32d0342c0d5cff5f52e181ca4d2fb66f52 /docs | |
| parent | fba7962baca98a18698a58be4c700d8766e2b2ce (diff) | |
[4.1.x] Doc'd when pre_save() is called with Model.save()'s update_fields.
Backport of bf47c719719d0e190a99fa2e7f959d5bbb7caf8a from main
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/instances.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt index 71fb880740..8b2c5b6ef5 100644 --- a/docs/ref/models/instances.txt +++ b/docs/ref/models/instances.txt @@ -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 ================ |
