diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-04-05 23:21:02 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-04-05 23:21:02 -0400 |
commit | 4071156acdd5929c8c8a2c9556fc466ba7581eca (patch) | |
tree | b8032bd6ae33681a5935ef9ef79d7fe16ec8e660 /lib/sqlalchemy/orm/unitofwork.py | |
parent | c01d35f15db4e2caf6ce9b48721ecfa232c67813 (diff) | |
download | sqlalchemy-4071156acdd5929c8c8a2c9556fc466ba7581eca.tar.gz |
all tests pass with this version
Diffstat (limited to 'lib/sqlalchemy/orm/unitofwork.py')
-rw-r--r-- | lib/sqlalchemy/orm/unitofwork.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sqlalchemy/orm/unitofwork.py b/lib/sqlalchemy/orm/unitofwork.py index 0e613a95f..0028202c5 100644 --- a/lib/sqlalchemy/orm/unitofwork.py +++ b/lib/sqlalchemy/orm/unitofwork.py @@ -129,9 +129,7 @@ class UOWTransaction(object): else: return history.as_state() - def register_object(self, state, isdelete=False, - listonly=False, postupdate=False, - post_update_cols=None): + def register_object(self, state, isdelete=False, listonly=False): # if object is not in the overall session, do nothing if not self.session._contains_state(state): @@ -147,8 +145,10 @@ class UOWTransaction(object): self.states[state] = (isdelete, listonly) else: existing_isdelete, existing_listonly = self.states[state] - if isdelete and not existing_isdelete: - raise Exception("Can't upgrade from a save to a delete") + self.states[state] = ( + existing_isdelete or isdelete, + existing_listonly and listonly + ) def issue_post_update(self, state, post_update_cols): mapper = state.manager.mapper.base_mapper |