Author: mtredinnick Date: 2008-10-24 04:30:04 -0500 (Fri, 24 Oct 2008) New Revision: 9270
Modified: django/branches/releases/1.0.X/docs/topics/db/queries.txt Log: [1.0.X] Fixed #9432 -- Revived documentation of ~Q usage. Backport of r9267 from trunk. Modified: django/branches/releases/1.0.X/docs/topics/db/queries.txt =================================================================== --- django/branches/releases/1.0.X/docs/topics/db/queries.txt 2008-10-24 09:29:27 UTC (rev 9269) +++ django/branches/releases/1.0.X/docs/topics/db/queries.txt 2008-10-24 09:30:04 UTC (rev 9270) @@ -601,8 +601,12 @@ WHERE question LIKE 'Who%' OR question LIKE 'What%' You can compose statements of arbitrary complexity by combining ``Q`` objects -with the ``&`` and ``|`` operators. You can also use parenthetical grouping. +with the ``&`` and ``|`` operators and use parenthetical grouping. Also, ``Q`` +objects can be negated using the ``~`` operator, allowing for combined lookups +that combine both a normal query and a negated (``NOT``) query:: + Q(question__startswith='Who') | ~Q(pub_date__year=2005) + Each lookup function that takes keyword-arguments (e.g. ``filter()``, ``exclude()``, ``get()``) can also be passed one or more ``Q`` objects as positional (not-named) arguments. If you provide multiple ``Q`` object --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---