- The `__mapper_args__` dictionary is copied from a declarative

mixin or abstract class when accessed, so that modifications made
to this dictionary by declarative itself won't conflict with that
of other mappings.  The dictionary is modified regarding the
``version_id_col`` and ``polymorphic_on`` arguments, replacing the
column within with the one that is officially mapped to the local
class/table. fixes #3062
This commit is contained in:
Mike Bayer
2014-05-30 15:36:13 -04:00
parent 2da30fde12
commit 8daa6ccfb0
3 changed files with 44 additions and 1 deletions
+4 -1
View File
@@ -73,7 +73,10 @@ def _as_declarative(cls, classname, dict_):
# don't even invoke __mapper_args__ until
# after we've determined everything about the
# mapped table.
mapper_args_fn = lambda: cls.__mapper_args__
# make a copy of it so a class-level dictionary
# is not overwritten when we update column-based
# arguments.
mapper_args_fn = lambda: dict(cls.__mapper_args__)
elif name == '__tablename__':
if not tablename and (
not class_mapped or