mirror of
https://github.com/django/django.git
synced 2025-09-27 12:39:17 +00:00
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
This commit is contained in:
parent
062a94ef45
commit
f747b61c20
4 changed files with 59 additions and 7 deletions
|
@ -1008,6 +1008,13 @@ cases).
|
|||
# optimise the inner query without losing results.
|
||||
>>> Annotation.objects.exclude(tag__children__name="t2")
|
||||
[<Annotation: a2>]
|
||||
|
||||
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"))
|
||||
[<Annotation: a1>]
|
||||
|
||||
"""}
|
||||
|
||||
# In Python 2.3 and the Python 2.6 beta releases, exceptions raised in __len__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue