summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-10-02 11:23:50 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-10-02 11:23:50 -0400
commitd84dea62de3a9c83ad539a5cf2ff4be2c0685a94 (patch)
treea0f048efbe35885ae02cbcfd6f5df8f0d92bac88
parentac08920284935e7e7519ce77ba369703390155dc (diff)
downloadsqlalchemy-d84dea62de3a9c83ad539a5cf2ff4be2c0685a94.tar.gz
- add an additional note regarding select_from, fixes #3546
-rw-r--r--doc/build/orm/tutorial.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/build/orm/tutorial.rst b/doc/build/orm/tutorial.rst
index 42e94338b..dff181f6b 100644
--- a/doc/build/orm/tutorial.rst
+++ b/doc/build/orm/tutorial.rst
@@ -1356,6 +1356,16 @@ The reference documentation for :meth:`~.Query.join` contains detailed informati
and examples of the calling styles accepted by this method; :meth:`~.Query.join`
is an important method at the center of usage for any SQL-fluent application.
+.. topic:: What does :class:`.Query` select from if there's multiple entities?
+
+ The :meth:`.Query.join` method will **typically join from the leftmost
+ item** in the list of entities, when the ON clause is omitted, or if the
+ ON clause is a plain SQL expression. To control the first entity in the list
+ of JOINs, use the :meth:`.Query.select_from` method::
+
+ query = Session.query(User, Address).select_from(Address).join(User)
+
+
.. _ormtutorial_aliases:
Using Aliases