def delete_model(self, model):
try:<EOL><INDENT>if model.json is None:<EOL><INDENT>return True<EOL><DEDENT>record = Record(model.json, model=model)<EOL>record.delete()<EOL>db.session.commit()<EOL><DEDENT>except SQLAlchemyError as e:<EOL><INDENT>if not self.handle_view_exception(e):<EOL><INDENT>flash(_('<STR_LIT>', error=str(e)),<EOL>category='<STR_LIT:error>')<EOL><DEDENT>db.session.rollback()<EOL>return False<EOL><DEDENT>return True<EOL>
Delete a record.