From 7240262adb5d74ec49abdd8561fca58b632c5e8e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 26 Jul 2015 22:43:13 -0400 Subject: [PATCH] - using text().columns() for ORM matching won't work well until ticket #3501, so remove this from pre-1.1 tutorials --- doc/build/orm/tutorial.rst | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/doc/build/orm/tutorial.rst b/doc/build/orm/tutorial.rst index f4aacf2a21..a916dd37bf 100644 --- a/doc/build/orm/tutorial.rst +++ b/doc/build/orm/tutorial.rst @@ -968,30 +968,6 @@ mapper (below illustrated using an asterisk): ('ed',) {stop}[] -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}[] - -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 -- 2.47.3