diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2021-10-27 15:56:16 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-10-27 15:56:16 +0000 |
commit | 5a334c9a66ad83619ee6ff3dbfa5352840e76d2f (patch) | |
tree | ac1649c4c3ddc9db4f41dedf843116df63147e78 /lib/sqlalchemy/orm/relationships.py | |
parent | 0a57293b844e2164d8a71f6dcfe182bfa0732460 (diff) | |
parent | 5ad4190aa428dabc571e3d9c0e6a7944a384c8c3 (diff) | |
download | sqlalchemy-5a334c9a66ad83619ee6ff3dbfa5352840e76d2f.tar.gz |
Merge "consider "inspect(_of_type)" to be the entity of a comparator" into main
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): |