diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-09-26 17:43:53 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-09-26 17:43:53 -0400 |
commit | 5ca662f7bc172daa51e7776d496eeea886761981 (patch) | |
tree | fdb3b92f45b10ab7402b6805e74fba274e85151b /lib/sqlalchemy/ext/declarative.py | |
parent | f357e85f7be34c7a3d28ebf0c37f8f280137ba0a (diff) | |
download | sqlalchemy-5ca662f7bc172daa51e7776d496eeea886761981.tar.gz |
warn when a subclass' base uses @declared_attr for a regular column -
does not propagate to subclasses. [ticket:2283]
Diffstat (limited to 'lib/sqlalchemy/ext/declarative.py')
-rwxr-xr-x | lib/sqlalchemy/ext/declarative.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/ext/declarative.py b/lib/sqlalchemy/ext/declarative.py index b58685414..efaf8f8db 100755 --- a/lib/sqlalchemy/ext/declarative.py +++ b/lib/sqlalchemy/ext/declarative.py @@ -1030,6 +1030,12 @@ def _as_declarative(cls, classname, dict_): if base is not cls: inherited_table_args = True elif class_mapped: + if isinstance(obj, declarative_props): + util.warn("Regular (i.e. not __special__) " + "attribute '%s.%s' uses @declared_attr, " + "but owning class %s is mapped - " + "not applying to subclass %s." + % (base.__name__, name, base, cls)) continue elif base is not cls: # we're a mixin. |