From: Mike Bayer Date: Sun, 18 Nov 2012 18:42:50 +0000 (-0500) Subject: iterate through column_attrs here X-Git-Tag: rel_0_8_0b2~38 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3d5da48511b15a80162a6ca331d3ae460ce2d143;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git iterate through column_attrs here --- diff --git a/lib/sqlalchemy/ext/mutable.py b/lib/sqlalchemy/ext/mutable.py index 877a732174..db05a82b48 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)