Commits

Mike Bayer  committed e5fed4d

inherited synchronization behavior fixed to descend all the way to the base class

  • Participants
  • Parent commits c3d7c2c

Comments (0)

Files changed (2)

 0.2.2
 - big improvements to polymorphic inheritance behavior, enabling it
 to work with adjacency list table structures [ticket:190]
+- major fixes and refactorings to inheritance relationships overall,
+more unit tests
 - fixed "echo_pool" flag on create_engine()
 - fix to docs, removed incorrect info that close() is unsafe to use
 with threadlocal strategy (its totally safe !)

File lib/sqlalchemy/orm/mapper.py

                                 self._setattrbycolumn(obj, col, primary_key[i])
                             i+=1
                     self._postfetch(connection, table, obj, c, c.last_inserted_params())
-                    if self._synchronizer is not None:
-                        self._synchronizer.execute(obj, obj)
+                    
+                    # synchronize newly inserted ids from one table to the next
+                    def sync(mapper):
+                        inherit = mapper.inherits
+                        if inherit is not None:
+                            sync(inherit)
+                        if mapper._synchronizer is not None:
+                            mapper._synchronizer.execute(obj, obj)
+                    sync(self)
+                    
                     self.extension.after_insert(self, connection, obj)
 
     def _postfetch(self, connection, table, obj, resultproxy, params):