summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/attributes.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-04-28 09:56:15 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-04-28 13:39:59 -0400
commit41ac0c7187daed54b0ba44b2287b6679d95d2caa (patch)
treed0a262379c26aadf0dc2a333b4d863e127ae6928 /lib/sqlalchemy/orm/attributes.py
parent2af1b107fce34b15898e6f534097ad34cfd7d503 (diff)
downloadsqlalchemy-41ac0c7187daed54b0ba44b2287b6679d95d2caa.tar.gz
add optional proxy_class to track w/ proxy_key
Fixed regression in ORM where using hybrid property to indicate an expression from a different entity would confuse the column-labeling logic in the ORM and attempt to derive the name of the hybrid from that other class, leading to an attribute error. The owning class of the hybrid attribute is now tracked along with the name. Fixes: #6386 Change-Id: Ica9497ea34fef799d6265de44104c1f3f3b30232
Diffstat (limited to 'lib/sqlalchemy/orm/attributes.py')
-rw-r--r--lib/sqlalchemy/orm/attributes.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py
index 0c7bc4cf0..b8974196c 100644
--- a/lib/sqlalchemy/orm/attributes.py
+++ b/lib/sqlalchemy/orm/attributes.py
@@ -227,6 +227,7 @@ class QueryableAttribute(
else:
annotations = {
"proxy_key": self.key,
+ "proxy_owner": self.class_,
"entity_namespace": self._entity_namespace,
}