#NEWLINE# @ classmethod #NEWLINE# def query_delete( cls , expression = None ) : #NEWLINE# #INDENT# '\n        Delete model instances matching the given expression (if\n        specified). If no expression is provided, then all model instances\n        will be deleted.\n\n        :param expression: A boolean expression to filter by.\n        ' #NEWLINE# if ( expression is not None ) : #NEWLINE# #INDENT# executor = Executor ( cls . database ) #NEWLINE# result = executor . execute ( expression ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = cls . _query . all_index ( ) #NEWLINE# #UNINDENT# for hash_id in executor : #NEWLINE# #INDENT# cls . load ( hash_id , convert_key = False ) . delete ( )