summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-05-09 18:57:40 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-05-09 18:57:40 +0000
commitcbabd91c21eb6fdee4786a3cd3195113fb0b8bed (patch)
treee4155418aac211c6a1dc34086b8929e36e4fc56a /lib
parent0bbb0e9b572929c05c5c0b3b0e22ffdeda29ad59 (diff)
downloadsqlalchemy-cbabd91c21eb6fdee4786a3cd3195113fb0b8bed.tar.gz
added query.subquery() as shorthand for query.statement.alias()
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/orm/query.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index a52302771..e39287b77 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -307,6 +307,11 @@ class Query(object):
return self._compile_context(labels=self._with_labels).statement
statement = property(statement)
+ def subquery(self):
+ """return the full SELECT statement represented by this Query, embedded within an Alias."""
+
+ return self.statement.alias()
+
def with_labels(self):
"""Apply column labels to the return value of Query.statement.