From: Mike Bayer Date: Mon, 17 Oct 2005 00:06:13 +0000 (+0000) Subject: (no commit message) X-Git-Tag: rel_0_1_0~512 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=988bf12461740244f8a4baef52779cf79eea48e0;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git --- diff --git a/examples/adjacencytree/basic_tree.py b/examples/adjacencytree/basic_tree.py index e77ab4f05c..3fcf5e8fe0 100644 --- a/examples/adjacencytree/basic_tree.py +++ b/examples/adjacencytree/basic_tree.py @@ -101,8 +101,6 @@ print "Committing:" print "----------------------------" objectstore.commit() -#sys.exit() - print "\n\n\n----------------------------" print "Tree After Save:" print "----------------------------" diff --git a/examples/adjacencytree/byroot_tree.py b/examples/adjacencytree/byroot_tree.py index 2b16b4a71a..4d767af59d 100644 --- a/examples/adjacencytree/byroot_tree.py +++ b/examples/adjacencytree/byroot_tree.py @@ -160,8 +160,6 @@ print "Committing:" print "----------------------------" objectstore.commit() -#sys.exit() - print "\n\n\n----------------------------" print "Tree After Save:" print "----------------------------" diff --git a/lib/sqlalchemy/mapper.py b/lib/sqlalchemy/mapper.py index 366e86b6d3..cb5ba8b62b 100644 --- a/lib/sqlalchemy/mapper.py +++ b/lib/sqlalchemy/mapper.py @@ -818,7 +818,6 @@ class PropertyLoader(MapperProperty): if self.direction == PropertyLoader.CENTER: secondary_delete = [] secondary_insert = [] - associationrow = {} if delete: for obj in deplist: childlist = getlist(obj, False) @@ -831,12 +830,10 @@ class PropertyLoader(MapperProperty): for obj in deplist: childlist = getlist(obj) if childlist is None: continue - clearkeys = False for child in childlist.added_items(): associationrow = {} self._synchronize(obj, child, associationrow, False) secondary_insert.append(associationrow) - clearkeys = True for child in childlist.deleted_items(): associationrow = {} self._synchronize(obj, child, associationrow, True) @@ -897,17 +894,18 @@ class PropertyLoader(MapperProperty): dest = associationrow for rule in self.syncrules: + localsource = source (smapper, scol, dmapper, dcol) = rule - if source is None: + if localsource is None: if dmapper == PropertyLoader.LEFT: - source = obj + localsource = obj elif dmapper == PropertyLoader.RIGHT: - source = child + localsource = child if clearkeys: value = None else: - value = smapper._getattrbycolumn(source, scol) + value = smapper._getattrbycolumn(localsource, scol) if dest is associationrow: associationrow[dcol.key] = value