#NEWLINE# def delete_obj( base_mapper , states , uowtransaction ) : #NEWLINE# #INDENT# 'Issue ``DELETE`` statements for a list of objects.\n\n    This is called within the context of a UOWTransaction during a\n    flush operation.\n\n    ' #NEWLINE# cached_connections = _cached_connection_dict ( base_mapper ) #NEWLINE# states_to_delete = list ( _organize_states_for_delete ( base_mapper , states , uowtransaction ) ) #NEWLINE# table_to_mapper = base_mapper . _sorted_tables #NEWLINE# for table in reversed ( list ( table_to_mapper . keys ( ) ) ) : #NEWLINE# #INDENT# mapper = table_to_mapper [ table ] #NEWLINE# if ( table not in mapper . _pks_by_table ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( mapper . inherits and mapper . passive_deletes ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# delete = _collect_delete_commands ( base_mapper , uowtransaction , table , states_to_delete ) #NEWLINE# _emit_delete_statements ( base_mapper , uowtransaction , cached_connections , mapper , table , delete ) #NEWLINE# #UNINDENT# for ( state , state_dict , mapper , connection , update_version_id ) in states_to_delete : #NEWLINE# #INDENT# mapper . dispatch . after_delete ( mapper , connection , state )