diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-02-24 15:29:30 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-02-24 15:29:30 -0500 |
commit | 3a56c4f019052c5dcd4e1cb5fd01a5680e6fc80e (patch) | |
tree | 69f60beb51f311400b41ed031fd3f2458d7a5391 /lib/sqlalchemy | |
parent | 305ea84004fe604f461cd3c9438fbc84e3d790b2 (diff) | |
download | sqlalchemy-3a56c4f019052c5dcd4e1cb5fd01a5680e6fc80e.tar.gz |
- repair issue in declared_attr.cascading such that within a
subclass, the value returned by the descriptor is not available
because the superclass is already mapped with the InstrumentedAttribute,
until the subclass is mapped. We add a setattr() to set up that
attribute so that the __mapper_args__ hook and possibly others
have access to the "cascaded" version of the attribute within
the call.
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/ext/declarative/base.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/ext/declarative/base.py b/lib/sqlalchemy/ext/declarative/base.py index 6735abf4c..d19257366 100644 --- a/lib/sqlalchemy/ext/declarative/base.py +++ b/lib/sqlalchemy/ext/declarative/base.py @@ -202,6 +202,7 @@ class _MapperConfig(object): if not oldclassprop and obj._cascading: dict_[name] = column_copies[obj] = \ ret = obj.__get__(obj, cls) + setattr(cls, name, ret) else: if oldclassprop: util.warn_deprecated( @@ -439,6 +440,7 @@ class _MapperConfig(object): def _prepare_mapper_arguments(self): properties = self.properties + if self.mapper_args_fn: mapper_args = self.mapper_args_fn() else: |