]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
iterate through column_attrs here
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 18 Nov 2012 18:42:50 +0000 (13:42 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 18 Nov 2012 18:42:50 +0000 (13:42 -0500)
lib/sqlalchemy/ext/mutable.py

index 877a7321741cbe362cfeaf5ca3d4f29b3ad2ea20..db05a82b488b29b49247fc20dd64f589bfc67e27 100644 (file)
@@ -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)