summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/mapping/properties.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2006-02-04 17:31:38 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2006-02-04 17:31:38 +0000
commit5acfc561519807a856bb96dfb75edd33c56c39be (patch)
treeba334df146399019698e2e21adf36c638044c2e5 /lib/sqlalchemy/mapping/properties.py
parent385cf6e7b67dc2a51672bc8272da44e0a8cad1b1 (diff)
downloadsqlalchemy-5acfc561519807a856bb96dfb75edd33c56c39be.tar.gz
fixes involving when child object from list items is None - onetoone must pass, objectstore.testbackwardsmanipulations with postgres passes
Diffstat (limited to 'lib/sqlalchemy/mapping/properties.py')
-rw-r--r--lib/sqlalchemy/mapping/properties.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/sqlalchemy/mapping/properties.py b/lib/sqlalchemy/mapping/properties.py
index 9eb97aa0c..a58db251f 100644
--- a/lib/sqlalchemy/mapping/properties.py
+++ b/lib/sqlalchemy/mapping/properties.py
@@ -516,11 +516,10 @@ class PropertyLoader(MapperProperty):
childlist = getlist(obj, passive=True)
if childlist is None: continue
for child in childlist.added_items():
- if child is not None:
- self._synchronize(obj, child, None, False)
- if self.direction == PropertyLoader.ONETOMANY:
- # for a cyclical task, this registration is handled by the objectstore
- uowcommit.register_object(child)
+ self._synchronize(obj, child, None, False)
+ if self.direction == PropertyLoader.ONETOMANY and child is not None:
+ # for a cyclical task, this registration is handled by the objectstore
+ uowcommit.register_object(child)
if self.direction != PropertyLoader.MANYTOONE or len(childlist.added_items()) == 0:
for child in childlist.deleted_items():
if not self.private:
@@ -540,6 +539,9 @@ class PropertyLoader(MapperProperty):
source = None
dest = associationrow
+ if dest is None:
+ return
+
for rule in self.syncrules:
localsource = source
(smapper, scol, dmapper, dcol) = rule