[Django] #36741: Explain why pre_save/post_save signals are skipped when using QuerySet.update()

11 views
Skip to first unread message

Django

unread,
Nov 18, 2025, 1:29:39 AM11/18/25
to django-...@googlegroups.com
#36741: Explain why pre_save/post_save signals are skipped when using
QuerySet.update()
-------------------------------------+-------------------------------------
Reporter: Lam Phung | Type:
| Cleanup/optimization
Status: new | Component:
| Documentation
Version: 5.2 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
The documentation for QuerySet.update() briefly mentions that the model’s
save() method is not called and pre_save/post_save signals are not sent.
However, the docs do not explain why this matters or what those signals
normally do. This could be confusing for new contributors who are
understanding the difference between update(), and manually calling save()
on each object. The current documentation could be updated to include
information on why selecting the wrong method could disrupt current logic,
or when it is safe/unsafe to use update().
--
Ticket URL: <https://code.djangoproject.com/ticket/36741>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 18, 2025, 1:30:04 AM11/18/25
to django-...@googlegroups.com
#36741: Explain why pre_save/post_save signals are skipped when using
QuerySet.update()
-------------------------------------+-------------------------------------
Reporter: Lam Phung | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Lam Phung):

* Attachment "Screenshot 2025-11-17 at 11.05.58 PM.png" added.

Django

unread,
Nov 18, 2025, 11:09:17 AM11/18/25
to django-...@googlegroups.com
#36741: Explain why pre_save/post_save signals are skipped when using
QuerySet.update()
-------------------------------------+-------------------------------------
Reporter: Lam Phung | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Youngkwang Yang):

* cc: Youngkwang Yang (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/36741#comment:1>

Django

unread,
Nov 18, 2025, 11:19:29 AM11/18/25
to django-...@googlegroups.com
#36741: Explain why pre_save/post_save signals are skipped when using
QuerySet.update()
-------------------------------------+-------------------------------------
Reporter: Lam Phung | Owner:
Type: | Youngkwang Yang
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Youngkwang Yang):

* needs_docs: 0 => 1
* owner: (none) => Youngkwang Yang
* status: new => assigned

Comment:

The bulk_update() documentation appears to have a typo. It currently says:
"QuerySet.update() is used to save the changes"

But since this is the bulk_update() section, it should be:
"QuerySet.bulk_update() is used to save the changes"

(Note: The screenshot you attached is from the bulk_update() section, not
the update() section.)
--
Ticket URL: <https://code.djangoproject.com/ticket/36741#comment:2>

Django

unread,
Nov 18, 2025, 11:23:40 AM11/18/25
to django-...@googlegroups.com
#36741: Explain why pre_save/post_save signals are skipped when using
QuerySet.update()
-------------------------------------+-------------------------------------
Reporter: Lam Phung | Owner:
Type: | Youngkwang Yang
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Youngkwang Yang):

Additionally, the QuerySet.update() documentation's final paragraph
provides more detailed explanation about signals:
(https://docs.djangoproject.com/en/5.2/ref/models/querysets/#update)

{{{
Finally, realize that update() does an update at the SQL level and, thus,
does not call any save() methods on your models, nor does it emit the
pre_save or post_save signals (which are a consequence of calling
Model.save()). If you want to update a bunch of records for a model that
has a custom save() method, loop over them and call save(), like this:

for e in Entry.objects.filter(pub_date__year=2010):
e.comments_on = False
e.save()
}}}

What are your thoughts on this explanation?
--
Ticket URL: <https://code.djangoproject.com/ticket/36741#comment:3>

Django

unread,
Nov 18, 2025, 11:27:11 AM11/18/25
to django-...@googlegroups.com
#36741: Explain why pre_save/post_save signals are skipped when using
QuerySet.update()
-------------------------------------+-------------------------------------
Reporter: Lam Phung | Owner:
Type: | Youngkwang Yang
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Youngkwang Yang):

* needs_docs: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/36741#comment:4>
Reply all
Reply to author
Forward
0 new messages