summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-01-28 12:34:06 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2020-01-28 12:44:50 -0500
commitc9406e58a4fd2de4bb2fd53530e04cc9fc786cbf (patch)
tree61c8eaee03d7e285965fec87bae02f06ccd91c48 /lib/sqlalchemy/orm
parent0cc2695510c0f0b09328e4cdf8d3ae29ac7f7abd (diff)
downloadsqlalchemy-c9406e58a4fd2de4bb2fd53530e04cc9fc786cbf.tar.gz
Accommodate for base class when adjusting path for with_polymorphic
Fixed an additional regression in the same area as that of :ticket:`5080` introduced in 1.3.0b3 via :ticket:`4468` where the ability to create a joined option across a :func:`.with_polymorphic` into a relationship against the base class of that with_polymorphic, and then further into regular mapped relationships would fail as the base class component would not add itself to the load path in a way that could be located by the loader strategy. The changes applied in :ticket:`5080` have been further refined to also accommodate this scenario. Fixes: #5121 Change-Id: I9753dbbcb7b7640c995ad983a6d04b36fa18cf54
Diffstat (limited to 'lib/sqlalchemy/orm')
-rw-r--r--lib/sqlalchemy/orm/path_registry.py1
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/path_registry.py b/lib/sqlalchemy/orm/path_registry.py
index 59ae082bb..1698a5181 100644
--- a/lib/sqlalchemy/orm/path_registry.py
+++ b/lib/sqlalchemy/orm/path_registry.py
@@ -273,7 +273,6 @@ class PropRegistry(PathRegistry):
elif (
insp.is_aliased_class
and insp.with_polymorphic_mappers
- and prop.parent is not insp.mapper
and prop.parent in insp.with_polymorphic_mappers
):
subclass_entity = parent[-1]._entity_for_mapper(prop.parent)