mirror of
https://github.com/django/django.git
synced 2025-09-23 02:33:31 +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
|
@ -641,6 +641,15 @@ class QuerySet(object):
|
|||
"""
|
||||
pass
|
||||
|
||||
def as_sql(self):
|
||||
"""
|
||||
Returns the internal query's SQL and parameters (as a tuple).
|
||||
|
||||
This is a private (internal) method. The name is chosen to provide
|
||||
uniformity with other interfaces (in particular, the Query class).
|
||||
"""
|
||||
obj = self.values("pk")
|
||||
return obj.query.as_nested_sql()
|
||||
|
||||
class ValuesQuerySet(QuerySet):
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue