@@ -399,10 +399,10 @@ is less than or equal to ``50``:
399
399
Combine Lookups
400
400
~~~~~~~~~~~~~~~
401
401
402
- You can use ``Q`` objects to create query filters with multiple
402
+ You can use ``Q`` objects to run queries with multiple
403
403
sets of matching criteria. To create a ``Q`` object, pass your query
404
404
filter to the ``Q()`` method. You can pass multiple ``Q`` objects as
405
- arguments to your query method and separate each Q object by an OR
405
+ arguments to your query method and separate each ``Q`` object by an OR
406
406
(``|``), AND (``&``), or XOR (``^``) operator. You can also negate
407
407
``Q`` objects by prefixing them with the ``~`` symbol. The following example
408
408
shows the syntax for passing multiple ``Q`` objects to the ``filter()``
@@ -791,27 +791,17 @@ The ``Movie`` model, which represents the ``sample_mflix.movies`` collection,
791
791
uses the ``id`` field as its primary key. The following example constructs
792
792
the same query as the preceding code:
793
793
794
- .. io-code-block::
795
- :copyable:
796
-
797
- .. input:: /includes/interact-data/specify-a-query.py
798
- :start-after: start-primary-key-id
799
- :end-before: end-primary-key-id
800
- :language: python
801
-
802
- .. output::
803
- :visible: false
804
-
805
- // Your ObjectId values might differ
806
-
807
- <Movie: Vertigo>
794
+ .. literalinclude:: /includes/interact-data/specify-a-query.py
795
+ :language: python
796
+ :dedent:
797
+ :start-after: start-primary-key-id
798
+ :end-before: end-primary-key-id
808
799
809
800
Additional Information
810
801
----------------------
811
802
812
- To learn how to run raw database queries using MongoDB's aggregation
813
- pipeline syntax, rather than ``QuerySet`` API methods, see the
814
- :ref:`django-raw-queries` guide.
803
+ To learn how to run raw database queries by using MongoDB's aggregation
804
+ pipeline syntax, see the :ref:`django-raw-queries` guide.
815
805
816
806
To learn how to perform other ``QuerySet`` operations, see the
817
807
:ref:`django-crud` guide.
0 commit comments