summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-08-03 17:46:34 -0400
committerStefan Urbanek <stefan@agentfarms.net>2015-08-25 23:56:09 -0700
commit65a53217d2aadfefcf615396543a7e7c55a0d25d (patch)
treeedf03978f476a0a67174429405d3b7983ba65f3c
parent57797624c55df4dced4c196cb4605bbed66e20e3 (diff)
downloadsqlalchemy-65a53217d2aadfefcf615396543a7e7c55a0d25d.tar.gz
- add a note clarifying query.with_labels(), fixes #3506
-rw-r--r--lib/sqlalchemy/orm/query.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index 8b3df08e7..e9b4e1982 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -608,6 +608,16 @@ class Query(object):
When the `Query` actually issues SQL to load rows, it always
uses column labeling.
+ .. note:: The :meth:`.Query.with_labels` method *only* applies
+ the output of :attr:`.Query.statement`, and *not* to any of
+ the result-row invoking systems of :class:`.Query` itself, e.g.
+ :meth:`.Query.first`, :meth:`.Query.all`, etc. To execute
+ a query using :meth:`.Query.with_labels`, invoke the
+ :attr:`.Query.statement` using :meth:`.Session.execute`::
+
+ result = session.execute(query.with_labels().statement)
+
+
"""
self._with_labels = True