From: Mike Bayer Date: Wed, 22 Feb 2006 06:29:05 +0000 (+0000) Subject: more fix to one-to-one: 'unchanged_items' can be [None] also with one to one so check... X-Git-Tag: rel_0_1_1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdcc6e92aee1df4861e50b518fdeac76c40daece;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git more fix to one-to-one: 'unchanged_items' can be [None] also with one to one so check for this during delete --- diff --git a/lib/sqlalchemy/mapping/properties.py b/lib/sqlalchemy/mapping/properties.py index d03069f1ec..c8f56746da 100644 --- a/lib/sqlalchemy/mapping/properties.py +++ b/lib/sqlalchemy/mapping/properties.py @@ -455,8 +455,9 @@ class PropertyLoader(MapperProperty): for obj in deplist: childlist = getlist(obj, False) for child in childlist.deleted_items() + childlist.unchanged_items(): - self._synchronize(obj, child, None, True) - uowcommit.register_object(child, postupdate=self.post_update) + if child is not None: + self._synchronize(obj, child, None, True) + uowcommit.register_object(child, postupdate=self.post_update) elif self.association is not None: # manage association objects. for obj in deplist: diff --git a/test/onetoone.py b/test/onetoone.py index 77c38ff2a5..9ff330c926 100644 --- a/test/onetoone.py +++ b/test/onetoone.py @@ -79,5 +79,8 @@ class O2OTest(testbase.AssertMixin): self.assert_(p.jack is None) objectstore.commit() + j.delete() + objectstore.commit() + if __name__ == "__main__": testbase.main()