소스 검색

Amended get_all_related_objects() backwards compatible replacement.

Neal Todd 10 년 전
부모
커밋
d84f01ff08
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      docs/ref/models/meta.txt

+ 2 - 2
docs/ref/models/meta.txt

@@ -240,7 +240,7 @@ can be made to convert your code to the new API:
 
 
       [
       [
           f for f in MyModel._meta.get_fields()
           f for f in MyModel._meta.get_fields()
-          if f.one_to_many and f.auto_created
+          if (f.one_to_many or f.one_to_one) and f.auto_created
       ]
       ]
 
 
 * ``MyModel._meta.get_all_related_objects_with_model()``::
 * ``MyModel._meta.get_all_related_objects_with_model()``::
@@ -248,7 +248,7 @@ can be made to convert your code to the new API:
       [
       [
           (f, f.model if f.model != MyModel else None)
           (f, f.model if f.model != MyModel else None)
           for f in MyModel._meta.get_fields()
           for f in MyModel._meta.get_fields()
-          if f.one_to_many and f.auto_created
+          if (f.one_to_many or f.one_to_one) and f.auto_created
       ]
       ]
 
 
 * ``MyModel._meta.get_all_related_many_to_many_objects()``::
 * ``MyModel._meta.get_all_related_many_to_many_objects()``::