diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-10-23 00:40:29 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-10-23 00:43:11 -0400 |
commit | 47d316ec665e5d5fc7ac750ba62b189a64d98ddd (patch) | |
tree | 0754543be3559ba7f262306b314a6d873e745867 /lib/sqlalchemy/orm/query.py | |
parent | 56d5732fbdf09508784df6dc4c04e5b39ac6be85 (diff) | |
download | sqlalchemy-47d316ec665e5d5fc7ac750ba62b189a64d98ddd.tar.gz |
- Fixed bug where the ON clause for :meth:`.Query.join`,
and :meth:`.Query.outerjoin` to a single-inheritance subclass
using ``of_type()`` would not render the "single table criteria" in
the ON clause if the ``from_joinpoint=True`` flag were set.
fixes #3232
Diffstat (limited to 'lib/sqlalchemy/orm/query.py')
-rw-r--r-- | lib/sqlalchemy/orm/query.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index fce7a3665..dc09e8eb4 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -1835,6 +1835,11 @@ class Query(object): left_entity = prop = None + if isinstance(onclause, interfaces.PropComparator): + of_type = getattr(onclause, '_of_type', None) + else: + of_type = None + if isinstance(onclause, util.string_types): left_entity = self._joinpoint_zero() @@ -1861,8 +1866,6 @@ class Query(object): if isinstance(onclause, interfaces.PropComparator): if right_entity is None: - right_entity = onclause.property.mapper - of_type = getattr(onclause, '_of_type', None) if of_type: right_entity = of_type else: |