#NEWLINE# def _organize_states_for_delete( base_mapper , states , uowtransaction ) : #NEWLINE# #INDENT# 'Make an initial pass across a set of states for DELETE.\n\n    This includes calling out before_delete and obtaining\n    key information for each state including its dictionary,\n    mapper, the connection to use for the execution per state.\n\n    ' #NEWLINE# states_to_delete = [ ] #NEWLINE# for ( state , dict_ , mapper , connection ) in _connections_for_states ( base_mapper , uowtransaction , states ) : #NEWLINE# #INDENT# mapper . dispatch . before_delete ( mapper , connection , state ) #NEWLINE# states_to_delete . append ( ( state , dict_ , mapper , bool ( state . key ) , connection ) ) #NEWLINE# #UNINDENT# return states_to_delete