#NEWLINE# def update_model( self , form , model ) : #NEWLINE# #INDENT# '\n            Update model helper\n\n            :param form:\n                Form instance\n            :param model:\n                Model instance to update\n        ' #NEWLINE# try : #NEWLINE# #INDENT# model . update ( form . data ) #NEWLINE# self . _on_model_change ( form , model , False ) #NEWLINE# pk = self . get_pk_value ( model ) #NEWLINE# self . coll . update ( { #NEWLINE# #INDENT# '_id' : pk , #NEWLINE# #UNINDENT# } , model ) #NEWLINE# #UNINDENT# except Exception as ex : #NEWLINE# #INDENT# flash ( gettext ( 'Failed to update record. %(error)s' , error = str ( ex ) ) , 'error' ) #NEWLINE# log . exception ( 'Failed to update record.' ) #NEWLINE# return False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . after_model_change ( form , pk , False ) #NEWLINE# #UNINDENT# return True