#NEWLINE# def delete( self ) : #NEWLINE# #INDENT# '\n        Deletes the records in the current QuerySet.\n        ' #NEWLINE# assert self . query . can_filter ( ) , "Cannot use 'limit' or 'offset' with delete." #NEWLINE# if ( self . _fields is not None ) : #NEWLINE# #INDENT# raise TypeError ( 'Cannot call delete() after .values() or .values_list()' ) #NEWLINE# #UNINDENT# del_query = self . _clone ( ) #NEWLINE# del_query . _for_write = True #NEWLINE# del_query . query . select_for_update = False #NEWLINE# del_query . query . select_related = False #NEWLINE# del_query . query . clear_ordering ( force_empty = True ) #NEWLINE# collector = Collector ( using = del_query . db ) #NEWLINE# collector . collect ( _rows_count ) #NEWLINE# ( deleted , _rows_count ) = collector . delete ( ) #NEWLINE# self . _result_cache = None #NEWLINE# return ( deleted , _rows_count )