#NEWLINE# def delete_with_prefix( self , prefix , version = None ) : #NEWLINE# #INDENT# if ( version is None ) : #NEWLINE# #INDENT# version = self . version #NEWLINE# #UNINDENT# db = router . db_for_write ( self . cache_model_class ) #NEWLINE# table = connections [ db ] . ops . quote_name ( self . _table ) #NEWLINE# prefix = self . make_key ( ( prefix + '%' ) , version = version ) #NEWLINE# with connections [ db ] . cursor ( ) as cursor : #NEWLINE# #INDENT# return cursor . execute ( 'DELETE FROM {table}\n                   WHERE cache_key LIKE %s' . format ( table = table ) , ( prefix , ) )