소스 검색

Refs #30083 -- Clarified database state of instances in signals.pre_init docs.

Mariusz Felisiak 5 년 전
부모
커밋
a2e1c17f19
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      docs/ref/signals.txt

+ 7 - 0
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``
 ------------