Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #9432 -- Revived documentation of ~Q usage.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9267 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c57fe6c3ece9f47778d7e00533b7d278e3e516f1 1 parent cbe11c1
Malcolm Tredinnick authored October 24, 2008

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  docs/topics/db/queries.txt
6  docs/topics/db/queries.txt
@@ -601,7 +601,11 @@ This is equivalent to the following SQL ``WHERE`` clause::
601 601
     WHERE question LIKE 'Who%' OR question LIKE 'What%'
602 602
 
603 603
 You can compose statements of arbitrary complexity by combining ``Q`` objects
604  
-with the ``&`` and ``|`` operators. You can also use parenthetical grouping.
  604
+with the ``&`` and ``|`` operators and use parenthetical grouping. Also, ``Q``
  605
+objects can be negated using the ``~`` operator, allowing for combined lookups
  606
+that combine both a normal query and a negated (``NOT``) query::
  607
+
  608
+    Q(question__startswith='Who') | ~Q(pub_date__year=2005)
605 609
 
606 610
 Each lookup function that takes keyword-arguments (e.g. ``filter()``,
607 611
 ``exclude()``, ``get()``) can also be passed one or more ``Q`` objects as

0 notes on commit c57fe6c

Please sign in to comment.
Something went wrong with that request. Please try again.