]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
reverted inheritance tweak which fails tests on non-sqlite
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 8 Sep 2008 03:57:25 +0000 (03:57 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 8 Sep 2008 03:57:25 +0000 (03:57 +0000)
lib/sqlalchemy/orm/mapper.py

index a13e9feb35cc981610d706ec6d8b7eb8cac86563..03f8b455349163adf45cef6f3af70b9cd7a12897 100644 (file)
@@ -1225,9 +1225,11 @@ class Mapper(object):
                     # synchronize newly inserted ids from one table to the next
                     # TODO: this performs some unnecessary attribute transfers
                     # from an attribute to itself, since the attribute is often mapped
-                    # to multiple, equivalent columns
-                    if mapper.__inherits_equated_pairs:
-                        sync.populate(state, mapper, state, mapper, mapper.__inherits_equated_pairs)
+                    # to multiple, equivalent columns.  it also may fire off more
+                    # than needed overall.
+                    for m in mapper.iterate_to_root():
+                        if m.__inherits_equated_pairs:
+                            sync.populate(state, m, state, m, m.__inherits_equated_pairs)
                         
                     # testlib.pragma exempt:__hash__
                     inserted_objects.add((state, connection))