diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-11-18 13:42:50 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-11-18 13:42:50 -0500 |
commit | 3d5da48511b15a80162a6ca331d3ae460ce2d143 (patch) | |
tree | 9571bced9d6ceb77368a346b924c41c441c90235 /lib/sqlalchemy/ext/mutable.py | |
parent | bbb2669be0db897a81c3aa29bd4daf8d1621dc9f (diff) | |
download | sqlalchemy-3d5da48511b15a80162a6ca331d3ae460ce2d143.tar.gz |
iterate through column_attrs here
Diffstat (limited to 'lib/sqlalchemy/ext/mutable.py')
-rw-r--r-- | lib/sqlalchemy/ext/mutable.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/sqlalchemy/ext/mutable.py b/lib/sqlalchemy/ext/mutable.py index 877a73217..db05a82b4 100644 --- a/lib/sqlalchemy/ext/mutable.py +++ b/lib/sqlalchemy/ext/mutable.py @@ -461,10 +461,9 @@ class Mutable(MutableBase): """ def listen_for_type(mapper, class_): - for prop in mapper.iterate_properties: - if hasattr(prop, 'columns'): - if isinstance(prop.columns[0].type, sqltype): - cls.associate_with_attribute(getattr(class_, prop.key)) + for prop in mapper.column_attrs: + if isinstance(prop.columns[0].type, sqltype): + cls.associate_with_attribute(getattr(class_, prop.key)) event.listen(mapper, 'mapper_configured', listen_for_type) @@ -504,10 +503,9 @@ class Mutable(MutableBase): sqltype = types.to_instance(sqltype) def listen_for_type(mapper, class_): - for prop in mapper.iterate_properties: - if hasattr(prop, 'columns'): - if prop.columns[0].type is sqltype: - cls.associate_with_attribute(getattr(class_, prop.key)) + for prop in mapper.column_attrs: + if prop.columns[0].type is sqltype: + cls.associate_with_attribute(getattr(class_, prop.key)) event.listen(mapper, 'mapper_configured', listen_for_type) |