From 120f13a500118dcbb453731f2b8e7b190b010040 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 9 Dec 2007 17:50:24 +0000 Subject: [PATCH] add pydoc for from_statement(). --- lib/sqlalchemy/orm/query.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 20f18eecbc..89733d5e53 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -623,6 +623,19 @@ class Query(object): def from_statement(self, statement): + """Execute the given SELECT statement and return results. + + This method bypasses all internal statement compilation, and the + statement is executed without modification. + + The statement argument is either a string, a ``select()`` construct, + or a ``text()`` construct, and should return the set of columns + appropriate to the entity class represented by this ``Query``. + + Also see the ``instances()`` method. + + """ + if isinstance(statement, basestring): statement = sql.text(statement) q = self._clone() -- 2.47.3