summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Trier <mtrier@gmail.com>2008-10-28 19:59:53 +0000
committerMichael Trier <mtrier@gmail.com>2008-10-28 19:59:53 +0000
commit0fc32d7825e9d9bf1dbcf3bbcd4cbf153e68fea5 (patch)
tree5ceb89a7b134d178004a8a521f35066e720b829a /lib
parentaa6c4df3953e46639ef757cc7f29a9b699e4da13 (diff)
downloadsqlalchemy-0fc32d7825e9d9bf1dbcf3bbcd4cbf153e68fea5.tar.gz
Updated UOWEventHandler so that it uses session.add() instead of session.save_or_update(). Fixes #1208.
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/orm/unitofwork.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/unitofwork.py b/lib/sqlalchemy/orm/unitofwork.py
index 103af4513..0992bfe99 100644
--- a/lib/sqlalchemy/orm/unitofwork.py
+++ b/lib/sqlalchemy/orm/unitofwork.py
@@ -43,7 +43,7 @@ class UOWEventHandler(interfaces.AttributeExtension):
if sess:
prop = _state_mapper(state).get_property(self.key)
if prop.cascade.save_update and item not in sess:
- sess.save_or_update(item)
+ sess.add(item)
return item
def remove(self, state, item, initiator):
@@ -64,7 +64,7 @@ class UOWEventHandler(interfaces.AttributeExtension):
if sess:
prop = _state_mapper(state).get_property(self.key)
if newvalue is not None and prop.cascade.save_update and newvalue not in sess:
- sess.save_or_update(newvalue)
+ sess.add(newvalue)
if prop.cascade.delete_orphan and oldvalue in sess.new:
sess.expunge(oldvalue)
return newvalue