From f747b61c20cb2ab9bcbca2b272f3fba80cf39ac6 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Mon, 5 Jan 2009 11:47:48 +0000 Subject: Nested query support. This extends previous functionality that allowed passing Query objects as the rvals to filters. You can now pass QuerySets, which requires less poking at opaque attributes. See the documentation of the "__in" lookup type for the details. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9701 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/queries/models.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/regressiontests/queries/models.py b/tests/regressiontests/queries/models.py index 94f2045fe7..a3247bb460 100644 --- a/tests/regressiontests/queries/models.py +++ b/tests/regressiontests/queries/models.py @@ -1008,6 +1008,13 @@ cases). # optimise the inner query without losing results. >>> Annotation.objects.exclude(tag__children__name="t2") [] + +Nested queries are possible (although should be used with care, since they have +performance problems on backends like MySQL. + +>>> Annotation.objects.filter(notes__in=Note.objects.filter(note="n1")) +[] + """} # In Python 2.3 and the Python 2.6 beta releases, exceptions raised in __len__ -- cgit v1.3