]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Unwrap Proxy objects when scanning declared_attr
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 23 Aug 2018 16:40:26 +0000 (12:40 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 23 Aug 2018 16:47:24 +0000 (12:47 -0400)
commit39dccf862d94952188834ec3531ed2d6251c3c0c
treea955f550ccfeb4559efec3487c585f3444de1455
parentedbf208afd123fe0b63e6f3808cbdf1650008aaf
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
(cherry picked from commit 626356842d77d4ec6427b3bfc04bdff93d24d246)
doc/build/changelog/unreleased_12/4326.rst [new file with mode: 0644]
lib/sqlalchemy/ext/declarative/base.py
lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/orm/base.py
lib/sqlalchemy/orm/descriptor_props.py
test/ext/declarative/test_mixin.py