summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-04-03 13:12:42 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-04-03 13:12:42 +0000
commitf899d7900509cbfdffdf8c48a93e908ed2249b77 (patch)
tree4f639b3cd63f7e361a278f8b96ca1b658d0f9299 /lib
parent6b5051845ba22b9c6ee575e3126fa602114cb91b (diff)
downloadsqlalchemy-f899d7900509cbfdffdf8c48a93e908ed2249b77.tar.gz
- Added some convenience descriptors to Query:
query.statement returns the full SELECT construct, query.whereclause returns just the WHERE part of the SELECT construct.
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/orm/query.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index 9751cc9ba..a2312e363 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -161,6 +161,16 @@ class Query(object):
return self._session
session = property(session)
+ def statement(self):
+ """return the full SELECT statement represented by this Query."""
+ return self._compile_context().statement
+ statement = property(statement)
+
+ def whereclause(self):
+ """return the WHERE criterion for this Query."""
+ return self._criterion
+ whereclause = property(whereclause)
+
def _with_current_path(self, path):
q = self._clone()
q._current_path = path