diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-02-15 17:42:48 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-02-15 17:59:15 -0500 |
commit | 283a969d68688018abee04fde479a6fd8495b6f6 (patch) | |
tree | 96faee92575ba64df3c2d641f4c77bae6c8a231d /lib/sqlalchemy/orm/instrumentation.py | |
parent | 6c6a7720f221d255a9c8abaec24fc5272403019b (diff) | |
download | sqlalchemy-283a969d68688018abee04fde479a6fd8495b6f6.tar.gz |
Test attributes for being non-mapped column properties more closely
Fixed bug in concrete inheritance mapping where user-defined
attributes such as hybrid properties that mirror the names
of mapped attributes from sibling classes would be overwritten by
the mapper as non-accessible at the instance level. Also
ensured that user-bound descriptors are not implicitly invoked at the class
level during the mapper configuration stage.
Change-Id: I52b84a15c296b14efeaffb72941fc941d1d52c0d
Fixes: #4188
Diffstat (limited to 'lib/sqlalchemy/orm/instrumentation.py')
-rw-r--r-- | lib/sqlalchemy/orm/instrumentation.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/instrumentation.py b/lib/sqlalchemy/orm/instrumentation.py index d5422b0d0..1b839cf5c 100644 --- a/lib/sqlalchemy/orm/instrumentation.py +++ b/lib/sqlalchemy/orm/instrumentation.py @@ -168,6 +168,15 @@ class ClassManager(dict): if isinstance(val, interfaces.InspectionAttr): yield key, val + def _get_class_attr_mro(self, key, default=None): + """return an attribute on the class without tripping it.""" + + for supercls in self.class_.__mro__: + if key in supercls.__dict__: + return supercls.__dict__[key] + else: + return default + def _attr_has_impl(self, key): """Return True if the given attribute is fully initialized. |