#NEWLINE# def delete_model( self , model ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# self . on_model_delete ( model ) #NEWLINE# model . delete_instance ( recursive = True ) #NEWLINE# #UNINDENT# except Exception as ex : #NEWLINE# #INDENT# if ( not self . handle_view_exception ( self ) ) : #NEWLINE# #INDENT# flash ( gettext ( 'Failed to delete record. %(error)s' , error = str ( ex ) ) , 'error' ) #NEWLINE# log . exception ( 'Failed to delete record.' ) #NEWLINE# #UNINDENT# return False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . after_model_delete ( model ) #NEWLINE# #UNINDENT# return True