From: Mike Bayer Date: Sun, 9 Dec 2007 17:50:24 +0000 (+0000) Subject: add pydoc for from_statement(). X-Git-Tag: rel_0_4_2~76 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=120f13a500118dcbb453731f2b8e7b190b010040;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git add pydoc for from_statement(). --- 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()