summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/attributes.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2018-08-23 12:40:26 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2018-08-23 12:47:08 -0400
commit626356842d77d4ec6427b3bfc04bdff93d24d246 (patch)
tree2f9fbf98d73f3647f814940b9d2116d022052ee8 /lib/sqlalchemy/orm/attributes.py
parent469931514a1517dde82ba56f780c3007c66d5943 (diff)
downloadsqlalchemy-626356842d77d4ec6427b3bfc04bdff93d24d246.tar.gz
Unwrap Proxy objects when scanning declared_attr
Fixed bug where the declarative scan for attributes would receive the expression proxy delivered by a hybrid attribute at the class level, and not the hybrid attribute itself, when receiving the descriptor via the ``@declared_attr`` callable on a subclass of an already-mapped class. This would lead to an attribute that did not report itself as a hybrid when viewed within :attr:`.Mapper.all_orm_descriptors`. Fixes: #4326 Change-Id: I582d03f05c3768b3344f93e3791240e9e69b9d1e
Diffstat (limited to 'lib/sqlalchemy/orm/attributes.py')
-rw-r--r--lib/sqlalchemy/orm/attributes.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py
index 0bbe70655..745032e44 100644
--- a/lib/sqlalchemy/orm/attributes.py
+++ b/lib/sqlalchemy/orm/attributes.py
@@ -271,6 +271,8 @@ def create_proxied_attribute(descriptor):
self._adapt_to_entity = adapt_to_entity
self.__doc__ = doc
+ _is_internal_proxy = True
+
@property
def property(self):
return self.comparator.property