Improved wording in Q() docs.

This commit is contained in:
Adam Johnson 2020-05-06 05:43:28 +01:00 committed by GitHub
parent 1c2c6f1b51
commit 83c631ade7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 8 deletions

View File

@ -3567,14 +3567,12 @@ elsewhere.
.. class:: Q .. class:: Q
A ``Q()`` object, like an :class:`~django.db.models.F` object, encapsulates a A ``Q()`` object represents an SQL condition that can be used in
SQL expression in a Python object that can be used in database-related database-related operations. It's similar to how an
operations. :class:`F() <django.db.models.F>` object represents the value of a model field
or annotation. They make it possible to define and reuse conditions, and
In general, ``Q() objects`` make it possible to define and reuse conditions. combine them using operators such as ``|`` (``OR``) and ``&`` (``AND``). See
This permits the :ref:`construction of complex database queries :ref:`complex-lookups-with-q`.
<complex-lookups-with-q>` using ``|`` (``OR``) and ``&`` (``AND``) operators;
in particular, it is not otherwise possible to use ``OR`` in ``QuerySets``.
``Prefetch()`` objects ``Prefetch()`` objects
---------------------- ----------------------