summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/relationships.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-01-13 17:53:37 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-01-13 17:53:37 -0500
commitbd74f81bb5b1158a1bc0a44e9990d4584380c481 (patch)
tree8767a4871f7d149cee9a37d37199586437ccce1a /lib/sqlalchemy/orm/relationships.py
parent62ec682239883cac7a83e2b2d5c26c6f22edc6bf (diff)
downloadsqlalchemy-bd74f81bb5b1158a1bc0a44e9990d4584380c481.tar.gz
- Fixed a bug involving the new flattened JOIN structures which
are used with :func:`.joinedload()` (thereby causing a regression in joined eager loading) as well as :func:`.aliased` in conjunction with the ``flat=True`` flag and joined-table inheritance; basically multiple joins across a "parent JOIN sub" entity using different paths to get to a target class wouldn't form the correct ON conditions. An adjustment / simplification made in the mechanics of figuring out the "left side" of the join in the case of an aliased, joined-inh class repairs the issue. [ticket:2908]
Diffstat (limited to 'lib/sqlalchemy/orm/relationships.py')
-rw-r--r--lib/sqlalchemy/orm/relationships.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/relationships.py b/lib/sqlalchemy/orm/relationships.py
index 982f10a4d..6fdedd382 100644
--- a/lib/sqlalchemy/orm/relationships.py
+++ b/lib/sqlalchemy/orm/relationships.py
@@ -747,11 +747,10 @@ class RelationshipProperty(StrategizedProperty):
return self.property.parent
def _source_selectable(self):
- elem = self.property.parent._with_polymorphic_selectable
- if self.adapter:
- return self.adapter(elem)
+ if self._adapt_to_entity:
+ return self._adapt_to_entity.selectable
else:
- return elem
+ return self.property.parent._with_polymorphic_selectable
def __clause_element__(self):
adapt_from = self._source_selectable()