summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/declarative
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-01-26 16:11:49 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2017-01-30 17:28:22 -0500
commit9a5943bf76cd436484a85a6d9478507c9bac3b08 (patch)
treee89680d1af5e8db4c66bd5474029c34ea79f2ff0 /lib/sqlalchemy/ext/declarative
parent5ef2fde8fb25e30452e06764bf0ec022eb23c15d (diff)
downloadsqlalchemy-9a5943bf76cd436484a85a6d9478507c9bac3b08.tar.gz
Union the exclude_properties of the inheriting mapper in declarative
Fixed bug where the "automatic exclude" feature of declarative that ensures a column local to a single table inheritance subclass does not appear as an attribute on other derivations of the base would not take effect for multiple levels of subclassing from the base. Change-Id: Ibf67b631b4870dd1bd159f7d6085549d299fffe0 Fixes: #3895
Diffstat (limited to 'lib/sqlalchemy/ext/declarative')
-rw-r--r--lib/sqlalchemy/ext/declarative/base.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sqlalchemy/ext/declarative/base.py b/lib/sqlalchemy/ext/declarative/base.py
index 16cb05e9c..3beee3191 100644
--- a/lib/sqlalchemy/ext/declarative/base.py
+++ b/lib/sqlalchemy/ext/declarative/base.py
@@ -492,8 +492,12 @@ class _MapperConfig(object):
if 'exclude_properties' not in mapper_args:
mapper_args['exclude_properties'] = exclude_properties = \
- set([c.key for c in inherited_table.c
- if c not in inherited_mapper._columntoproperty])
+ set(
+ [c.key for c in inherited_table.c
+ if c not in inherited_mapper._columntoproperty]
+ ).union(
+ inherited_mapper.exclude_properties or ()
+ )
exclude_properties.difference_update(
[c.key for c in self.declared_columns])