summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2019-07-19 13:02:57 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-07-19 16:07:21 +0200
commitfa3ae446d938455b47fc978cdfecb956b1238812 (patch)
tree597f3aa4473746ccd80517cf34ec3ba738f3c98e
parentde2635fb4ea103a539d8dc080d9dee4ae0feb6d4 (diff)
downloaddjango-fa3ae446d938455b47fc978cdfecb956b1238812.tar.gz
[2.2.x] Refs #30083 -- Clarified database state of instances in signals.pre_init docs.
Backport of a2e1c17f193f5017e1f6fac7d860f1f9e34d7892 from master
-rw-r--r--docs/ref/signals.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/ref/signals.txt b/docs/ref/signals.txt
index f2f0ab4257..a89560cc1e 100644
--- a/docs/ref/signals.txt
+++ b/docs/ref/signals.txt
@@ -99,6 +99,13 @@ Arguments sent with this signal:
``instance``
The actual instance of the model that's just been created.
+ .. note::
+
+ ``instance._state`` isn't set before sending the ``post_init`` signal,
+ so ``_state`` attributes always have their default values. For example,
+ ``_state.db`` is ``None`` and cannot be used to check an ``instance``
+ database.
+
``pre_save``
------------