diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-04-03 18:24:04 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-04-03 18:24:04 -0400 |
commit | 85156a0fbe43f8691e19c077c92b0d433f9e654b (patch) | |
tree | a7c01a7e53918d03ef0e0e5b7b7f21bef8a10118 /lib/sqlalchemy/orm/unitofwork.py | |
parent | ad8ad86470a61acecb361f673dbb74b36dedd3a7 (diff) | |
download | sqlalchemy-85156a0fbe43f8691e19c077c92b0d433f9e654b.tar.gz |
got row switch more or less up
Diffstat (limited to 'lib/sqlalchemy/orm/unitofwork.py')
-rw-r--r-- | lib/sqlalchemy/orm/unitofwork.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/unitofwork.py b/lib/sqlalchemy/orm/unitofwork.py index ceed4c288..a4eb00f70 100644 --- a/lib/sqlalchemy/orm/unitofwork.py +++ b/lib/sqlalchemy/orm/unitofwork.py @@ -101,6 +101,19 @@ class UOWTransaction(object): def is_deleted(self, state): """return true if the given state is marked as deleted within this UOWTransaction.""" return state in self.states and self.states[state][0] + + def remove_state_actions(self, state): + """remove pending actions for a state from the uowtransaction.""" + + if state in self.states: + isdelete, listonly = self.states[state] + self.states[state] = (False, True) + if isdelete: + self.postsort_actions.pop((DeleteState, state), None) + else: + self.postsort_actions.pop((SaveUpdateState, state), None) + + def get_attribute_history(self, state, key, passive=True): hashkey = ("history", state, key) |