From: Mike Bayer Date: Wed, 31 May 2006 16:15:10 +0000 (+0000) Subject: inherited synchronization behavior fixed to descend all the way to the base class X-Git-Tag: rel_0_2_2~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea717b545c5b0930eeef50472b4d47bafc9407e1;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git inherited synchronization behavior fixed to descend all the way to the base class --- diff --git a/CHANGES b/CHANGES index b89461904f..06917f7689 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ 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 !) diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 7e77fd6ebd..bde887b2af 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -660,8 +660,16 @@ class Mapper(object): 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):