Ver código fonte

Extended docs for Q() objects mentioning the ~ (NOT) operator.

Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
Mohammad Kazemi 11 meses atrás
pai
commit
47c608202a
1 arquivos alterados com 4 adições e 3 exclusões
  1. 4 3
      docs/ref/models/querysets.txt

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

@@ -4078,9 +4078,10 @@ elsewhere.
 A ``Q()`` object represents an SQL condition that can be used in
 database-related operations. It's similar to how an
 :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
-combine them using operators such as ``|`` (``OR``), ``&`` (``AND``), and ``^``
-(``XOR``). See :ref:`complex-lookups-with-q`.
+or annotation. They make it possible to define and reuse conditions. These can
+be negated using the ``~`` (``NOT``) operator, and combined using operators
+such as ``|`` (``OR``), ``&`` (``AND``), and ``^`` (``XOR``). See
+:ref:`complex-lookups-with-q`.
 
 ``Prefetch()`` objects
 ----------------------