]> 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:43:13 +0000 (22:43 -0400)
until ticket #3501, so remove this from pre-1.1 tutorials

doc/build/orm/tutorial.rst

index f4aacf2a21d2884c07c4825f4ddc21e1cc93ba02..a916dd37bf690ea246cc5a160c20876c37f2d181 100644 (file)
@@ -968,30 +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