From caa150e45e67780da7b7f772df43239cf503696e Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Fri, 25 Apr 2008 17:08:28 +0000 Subject: 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 --- tests/regressiontests/queries/models.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/regressiontests') 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.objects.filter(Q(tags=t1)).filter(Q(tags=t2)) [] +>>> Item.objects.filter(Q(tags=t1)).filter(Q(creator__name='fred')|Q(tags=t2)) +[] 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) -- cgit v1.3