]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- using text().columns() for ORM matching won't work well
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 27 Jul 2015 02:43:13 +0000 (22:43 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 27 Jul 2015 02:44:29 +0000 (22:44 -0400)
until ticket #3501, so remove this from pre-1.1 tutorials

(cherry picked from commit 7240262adb5d74ec49abdd8561fca58b632c5e8e)

doc/build/orm/tutorial.rst

index 0144c1e97834d805f5f97b379d8736ec439b2183..1d14f088667503281c04959cde00370c512464f3 100644 (file)
@@ -968,31 +968,6 @@ mapper (below illustrated using an asterisk):
     ('ed',)
     {stop}[<User(name='ed', fullname='Ed Jones', password='f8s7ccs')>]
 
-Or alternatively, specify how the columns map to the :func:`.text` construct
-explicitly using the :meth:`.TextClause.columns` method:
-
-.. sourcecode:: python+sql
-
-    >>> stmt = text("SELECT name, id FROM users where name=:name")
-    >>> stmt = stmt.columns(User.name, User.id)
-    {sql}>>> session.query(User).from_statement(stmt).params(name='ed').all()
-    SELECT name, id FROM users where name=?
-    ('ed',)
-    {stop}[<User(name='ed', fullname='Ed Jones', password='f8s7ccs')>]
-
-We can choose columns to return individually as well, as in any other case:
-
-.. sourcecode:: python+sql
-
-    >>> stmt = text("SELECT name, id FROM users where name=:name")
-    >>> stmt = stmt.columns(User.name, User.id)
-    {sql}>>> session.query(User.id, User.name).\
-    ...          from_statement(stmt).params(name='ed').all()
-    SELECT name, id FROM users where name=?
-    ('ed',)
-    {stop}[(1, u'ed')]
-
-
 .. seealso::
 
     :ref:`sqlexpression_text` - The :func:`.text` construct explained