diff options
Diffstat (limited to 'lib/sqlalchemy/orm/relationships.py')
-rw-r--r-- | lib/sqlalchemy/orm/relationships.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/relationships.py b/lib/sqlalchemy/orm/relationships.py index 3916c0a83..d021ac9a2 100644 --- a/lib/sqlalchemy/orm/relationships.py +++ b/lib/sqlalchemy/orm/relationships.py @@ -1161,7 +1161,13 @@ class RelationshipProperty(StrategizedProperty): :func:`_orm.relationship`. """ - return self.property.entity + # this is a relatively recent change made for + # 1.4.27 as part of #7244. + # TODO: shouldn't _of_type be inspected up front when received? + if self._of_type is not None: + return inspect(self._of_type) + else: + return self.property.entity @util.memoized_property def mapper(self): |