#NEWLINE# @ classmethod #NEWLINE# def xformerror_from_xform_instance( cls , instance , error_message , with_new_id = False ) : #NEWLINE# #INDENT# instance . state = XFormInstanceSQL . ERROR #NEWLINE# instance . problem = error_message #NEWLINE# if with_new_id : #NEWLINE# #INDENT# orig_id = instance . form_id #NEWLINE# cls . assign_new_id ( instance ) #NEWLINE# instance . orig_id = orig_id #NEWLINE# if instance . is_saved ( ) : #NEWLINE# #INDENT# instance . id = None #NEWLINE# #UNINDENT# #UNINDENT# return instance