diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-07-19 13:05:31 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-07-19 16:06:05 +0200 |
| commit | fc1182af01c391ce33d7fcf51c756829c6a11d5b (patch) | |
| tree | c3de483e677e8c06bdd1c8302f1288ac219199a9 /docs | |
| parent | a2e1c17f193f5017e1f6fac7d860f1f9e34d7892 (diff) | |
Refs #30083 -- Added a warning about performing queries in pre/post_init receivers.
Thanks Carlton Gibson the review.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/signals.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/ref/signals.txt b/docs/ref/signals.txt index a89560cc1e..19a92a875c 100644 --- a/docs/ref/signals.txt +++ b/docs/ref/signals.txt @@ -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`` ------------ |
