Famcy/_util_/_fsubmission.py
def famcy_submission_handler(obj_response, fsubmission_id, info_dict, **kwargs):
		"""
		This is the main submission handler that handles all
		the submission traffics. 
		"""
		print("==========================famcy_submission_handler")
		# Get the submission object
		fsubmission_obj = get_fsubmission_obj(FSubmissionSijaxHandler.current_page, fsubmission_id)
		if "jsAlert" in info_dict.keys():
			temp_func = fsubmission_obj.jsAlertHandler
			response_obj = temp_func(fsubmission_obj, info_dict)
			# response_obj = fsubmission_obj.jsAlertHandler(fsubmission_obj, info_dict)
		else:
			info_list = put_submissions_to_list(fsubmission_obj, info_dict)
			# Run user defined handle submission
			# Will assume all data ready at this point
			temp_func = fsubmission_obj.func
			response_obj = temp_func(fsubmission_obj, info_list)
			# response_obj = fsubmission_obj.func(fsubmission_obj, info_list)

		# Response according to the return response
		if isinstance(response_obj, list):
			for res_obj in response_obj:
				res_obj.target = res_obj.target if res_obj.target else fsubmission_obj.target
				res_obj.response(obj_response)
		elif response_obj:
			response_obj.target = response_obj.target if response_obj.target else fsubmission_obj.target
			response_obj.response(obj_response)
		else:
			inner_text, extra_script = alert_response({"alert_type":"alert-warning", "alert_message":"系統異常", "alert_position":"prepend"}, fsubmission_obj.origin.id)
			# args[0] is the sijax response object
			obj_response.html_prepend('#'+fsubmission_obj.target.id, inner_text)
			obj_response.script(extra_script)
			obj_response.script("$('#loading_holder').css('display','none');")

		session["current_page"] = FSubmissionSijaxHandler.current_page

		This is the main submission handler that handles all
		the submission traffics. 
		
This is the main submission handler that handles all
the submission traffics.
This is the main submission handler that handles all the submission traffics .
def famcy_submission_handler(obj_response, fsubmission_id, info_dict, **kwargs):
		print("==========================famcy_submission_handler")
		fsubmission_obj = get_fsubmission_obj(FSubmissionSijaxHandler.current_page, fsubmission_id)
		if "jsAlert" in info_dict.keys():
			temp_func = fsubmission_obj.jsAlertHandler
			response_obj = temp_func(fsubmission_obj, info_dict)
		else:
			info_list = put_submissions_to_list(fsubmission_obj, info_dict)
			temp_func = fsubmission_obj.func
			response_obj = temp_func(fsubmission_obj, info_list)
		if isinstance(response_obj, list):
			for res_obj in response_obj:
				res_obj.target = res_obj.target if res_obj.target else fsubmission_obj.target
				res_obj.response(obj_response)
		elif response_obj:
			response_obj.target = response_obj.target if response_obj.target else fsubmission_obj.target
			response_obj.response(obj_response)
		else:
			inner_text, extra_script = alert_response({"alert_type":"alert-warning", "alert_message":"系統異常", "alert_position":"prepend"}, fsubmission_obj.origin.id)
			obj_response.html_prepend('#'+fsubmission_obj.target.id, inner_text)
			obj_response.script(extra_script)
			obj_response.script("$('#loading_holder').css('display','none');")
		session["current_page"] = FSubmissionSijaxHandler.current_page
def famcy_submission_handler ( obj_response , fsubmission_id , info_dict , ** kwargs ) : print ( "==========================famcy_submission_handler" ) fsubmission_obj = get_fsubmission_obj ( FSubmissionSijaxHandler . current_page , fsubmission_id ) if "jsAlert" in info_dict . keys ( ) : temp_func = fsubmission_obj . jsAlertHandler response_obj = temp_func ( fsubmission_obj , info_dict ) else : info_list = put_submissions_to_list ( fsubmission_obj , info_dict ) temp_func = fsubmission_obj . func response_obj = temp_func ( fsubmission_obj , info_list ) if isinstance ( response_obj , list ) : for res_obj in response_obj : res_obj . target = res_obj . target if res_obj . target else fsubmission_obj . target res_obj . response ( obj_response ) elif response_obj : response_obj . target = response_obj . target if response_obj . target else fsubmission_obj . target response_obj . response ( obj_response ) else : inner_text , extra_script = alert_response ( { "alert_type" : "alert-warning" , "alert_message" : "系統異常", "alert _ osition":"prepen d "}, fsubm i s ion_obj.origin. i d) obj_response . html_prepend ( '#' + fsubmission_obj . target . id , inner_text ) obj_response . script ( extra_script ) obj_response . script ( "$('#loading_holder').css('display','none');" ) session [ "current_page" ] = FSubmissionSijaxHandler . current_page
This is the main submission handler that handles all
the submission traffics.
This is the main submission handler that handles all the submission traffics .
"""
		This is the main submission handler that handles all
		the submission traffics. 
		""" # Get the submission object # response_obj = fsubmission_obj.jsAlertHandler(fsubmission_obj, info_dict) # Run user defined handle submission # Will assume all data ready at this point # response_obj = fsubmission_obj.func(fsubmission_obj, info_list) # Response according to the return response # args[0] is the sijax response object
obj_response
fsubmission_id
info_dict