diff options
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) |