diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-04-25 17:08:28 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-04-25 17:08:28 +0000 |
| commit | caa150e45e67780da7b7f772df43239cf503696e (patch) | |
| tree | b88f8ebde8a134d23b4a75de9fe79cd7b1736d93 /tests/regressiontests | |
| parent | 05e4d51f0d1924efec47c39215d6baf682688fe7 (diff) | |
queryset-refactor: Fixed some bugs in the multi-valued filtering behaviour
introduced in [7317]. It was failing in a couple of different ways on some
complex Q() combinations.
Fixed #7047
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@7462 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/queries/models.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/regressiontests/queries/models.py b/tests/regressiontests/queries/models.py index f893ac6ad8..6893ebc991 100644 --- a/tests/regressiontests/queries/models.py +++ b/tests/regressiontests/queries/models.py @@ -218,12 +218,16 @@ True [<Item: one>, <Item: two>] >>> Item.objects.filter(Q(tags=t1)).filter(Q(tags=t2)) [<Item: one>] +>>> Item.objects.filter(Q(tags=t1)).filter(Q(creator__name='fred')|Q(tags=t2)) +[<Item: one>] Each filter call is processed "at once" against a single table, so this is different from the previous example as it tries to find tags that are two things at once (rather than two tags). >>> Item.objects.filter(Q(tags=t1) & Q(tags=t2)) [] +>>> Item.objects.filter(Q(tags=t1), Q(creator__name='fred')|Q(tags=t2)) +[] >>> qs = Author.objects.filter(ranking__rank=2, ranking__id=rank1.id) >>> list(qs) |
