summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/modeltests/or_lookups/models.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/modeltests/or_lookups/models.py b/tests/modeltests/or_lookups/models.py
index a07dacdd5a..ef4d4dc5ca 100644
--- a/tests/modeltests/or_lookups/models.py
+++ b/tests/modeltests/or_lookups/models.py
@@ -89,6 +89,10 @@ Hello and goodbye
>>> Article.objects.filter(Q(headline__startswith='Hello')).in_bulk([1,2])
{1: Hello}
+# Demonstrating exclude with a Q object
+>>> Article.objects.exclude(Q(headline__startswith='Hello'))
+[Goodbye]
+
# The 'complex_filter' method supports framework features such as
# 'limit_choices_to' which normally take a single dictionary of lookup arguments
# but need to support arbitrary queries via Q objects too.