Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc'd when pre_save() is called with Model.save()'s update_fields. #16124

Merged
merged 1 commit into from Sep 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/ref/models/instances.txt
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::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A suggestion in case you aren't mindful of this note: To improve readability, use .. admonition:: Descriptive title rather than .. note::. Use these boxes sparingly.


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