소스 검색

Fixed #34440 -- Doc'd that & queryset operator works similar to chaining.

David Sanders 2 년 전
부모
커밋
0494efddc4
1개의 변경된 파일3개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 5
      docs/ref/models/querysets.txt

+ 3 - 5
docs/ref/models/querysets.txt

@@ -1983,15 +1983,13 @@ Combined querysets must use the same model.
 AND (``&``)
 ~~~~~~~~~~~
 
-Combines two ``QuerySet``\s using the SQL ``AND`` operator.
+Combines two ``QuerySet``\s using the SQL ``AND`` operator in a manner similar
+to chaining filters.
 
 The following are equivalent::
 
     Model.objects.filter(x=1) & Model.objects.filter(y=2)
-    Model.objects.filter(x=1, y=2)
-    from django.db.models import Q
-
-    Model.objects.filter(Q(x=1) & Q(y=2))
+    Model.objects.filter(x=1).filter(y=2)
 
 SQL equivalent: