diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-08-03 17:46:34 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-08-03 17:46:34 -0400 |
commit | 292f5bec1cbfcaa9d16af8fe4149c7191f194f11 (patch) | |
tree | a0c24e27eb21ca4d14e76f349ad4790da2f1a2a9 | |
parent | dd6110eed335154e0ae14b2dba13e44af76c4f2b (diff) | |
download | sqlalchemy-292f5bec1cbfcaa9d16af8fe4149c7191f194f11.tar.gz |
- add a note clarifying query.with_labels(), fixes #3506
-rw-r--r-- | lib/sqlalchemy/orm/query.py | 10 |
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 |