소스 검색

[5.0.x] Refs #31435 -- Doc'd potential infinite recursion when accessing model fields in __init__.

Backport of e47298aec4fa04416e7082331fbd44bd9f2662aa from main
David Sanders 1 년 전
부모
커밋
0e34ac8981
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      docs/ref/models/instances.txt

+ 3 - 1
docs/ref/models/instances.txt

@@ -30,7 +30,9 @@ need to :meth:`~Model.save()`.
     You may be tempted to customize the model by overriding the ``__init__``
     method. If you do so, however, take care not to change the calling
     signature as any change may prevent the model instance from being saved.
-    Rather than overriding ``__init__``, try using one of these approaches:
+    Additionally, referring to model fields within ``__init__`` may potentially
+    result in infinite recursion errors in some circumstances.  Rather than
+    overriding ``__init__``, try using one of these approaches:
 
     #. Add a classmethod on the model class::