#NEWLINE# def del_db_objects( session , table , **filters ) : #NEWLINE# #INDENT# 'delete db objects.' #NEWLINE# if ( not session ) : #NEWLINE# #INDENT# raise exception . DatabaseException ( 'session param is None' ) #NEWLINE# #UNINDENT# with session . begin ( subtransactions = True ) : #NEWLINE# #INDENT# logging . debug ( 'session %s delete db objects by filters %s in table %s' , id ( session ) , filters , table . __name__ ) #NEWLINE# query = model_filter ( model_query ( session , table ) , table , ** filters ) #NEWLINE# db_objects = query . all ( ) #NEWLINE# query . delete ( synchronize_session = False ) #NEWLINE# logging . debug ( 'session %s db objects %s deleted' , id ( session ) , db_objects ) #NEWLINE# return db_objects