mirror of
https://github.com/django/django.git
synced 2025-09-26 20:19:16 +00:00
Refs #30083 -- Added a warning about performing queries in pre/post_init receivers.
Thanks Carlton Gibson the review.
This commit is contained in:
parent
a2e1c17f19
commit
fc1182af01
1 changed files with 6 additions and 0 deletions
|
@ -106,6 +106,12 @@ Arguments sent with this signal:
|
||||||
``_state.db`` is ``None`` and cannot be used to check an ``instance``
|
``_state.db`` is ``None`` and cannot be used to check an ``instance``
|
||||||
database.
|
database.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
For performance reasons, you shouldn't perform queries in receivers of
|
||||||
|
``pre_init`` or ``post_init`` signals because they would be executed for
|
||||||
|
each instance returned during queryset iteration.
|
||||||
|
|
||||||
``pre_save``
|
``pre_save``
|
||||||
------------
|
------------
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue