#NEWLINE# def save_new_instance( self , ar , elem ) : #NEWLINE# #INDENT# pre_ui_save . send ( sender = elem . __class__ , instance = elem , ar = ar ) #NEWLINE# elem . before_ui_save ( ar ) #NEWLINE# elem . save ( force_insert = True ) #NEWLINE# on_ui_created . send ( elem , request = ar . request ) #NEWLINE# elem . after_ui_create ( ar ) #NEWLINE# elem . after_ui_save ( ar , None ) #NEWLINE# ar . success ( ( _ ( '%s has been created.' ) % obj2unicode ( elem ) ) ) #NEWLINE# if ( ar . actor . handle_uploaded_files is None ) : #NEWLINE# #INDENT# ar . set_response ( rows = [ ar . ah . store . row2list ( ar , elem ) ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ar . set_content_type ( 'text/html' ) #NEWLINE# #UNINDENT# if ar . actor . stay_in_grid : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# ar . goto_instance ( elem )