From 06e84d5bcc0c009b8d4a91e7d247a25299e6c879 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 20 Jul 2011 19:42:06 -0400 Subject: [PATCH] fix some more typos --- doc/build/orm/loading.rst | 5 +++-- doc/build/orm/tutorial.rst | 3 ++- lib/sqlalchemy/orm/query.py | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/build/orm/loading.rst b/doc/build/orm/loading.rst index 084cd4051b..3b3d1ff075 100644 --- a/doc/build/orm/loading.rst +++ b/doc/build/orm/loading.rst @@ -259,9 +259,10 @@ The other LEFT OUTER JOIN will match *all* ``Address`` rows related to ``User``, and is only used to populate the ``User.addresses`` collection, for those ``User`` objects that are returned. -By changing the usage of ``joinedload`` to another style of loading, we can change +By changing the usage of :func:`.joinedload` to another style of loading, we can change how the collection is loaded completely independently of SQL used to retrieve -the actual ``User`` rows we want: +the actual ``User`` rows we want. Below we change :func:`.joinedload` into +:func:`.subqueryload`: .. sourcecode:: python+sql diff --git a/doc/build/orm/tutorial.rst b/doc/build/orm/tutorial.rst index 177f7a4c6a..410e1a0692 100644 --- a/doc/build/orm/tutorial.rst +++ b/doc/build/orm/tutorial.rst @@ -1080,7 +1080,8 @@ load in the next section. Querying with Joins ==================== -While :func:`~sqlalchemy.orm.joinedload` created a JOIN specifically to +While :func:`~sqlalchemy.orm.joinedload` created an anonymous, non-accessible JOIN +specifically to populate a collection, we can also work explicitly with joins in many ways. For example, to construct a simple inner join between ``User`` and ``Address``, we can just :meth:`~sqlalchemy.orm.query.Query.filter()` their diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 1b6b8986cc..701b376af9 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -1241,7 +1241,7 @@ class Query(object): # join from Company entities to the "employees" collection, # using "people JOIN engineers" as the target. Then join # to the "computers" collection on the Engineer entity. - session.query(Company).\ + session.query(Company).\\ join(people.join(engineers), 'employees').\\ join(Engineer.computers) @@ -1275,7 +1275,9 @@ class Query(object): query.join(a).\\ join(b, from_joinpoint=True).\\ join(c, from_joinpoint=True) - + + See also :ref:`ormtutorial_joins` in the ORM tutorial. + """ aliased, from_joinpoint = kwargs.pop('aliased', False),\ kwargs.pop('from_joinpoint', False) -- 2.39.5