[2.2.x] Refs #30083 -- Added a warning about performing queries in pre/post_init receivers.

Thanks Carlton Gibson the review.

Backport of fc1182af01 from master
This commit is contained in:
Mariusz Felisiak 2019-07-19 13:05:31 +02:00
parent fa3ae446d9
commit 506f800ead
1 changed files with 6 additions and 0 deletions

View File

@ -106,6 +106,12 @@ Arguments sent with this signal:
``_state.db`` is ``None`` and cannot be used to check an ``instance``
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``
------------