def post_get_many_Question(instance_id=None, search_params=None, result=None, **kw): # print("POST_GET_MANY_QUESTION") # print("POST_GET", search_params) for item in result['objects']: item['questionnaire'] = [ api_manager.url_for(Questionnaire, instid=q['id']) for q in item['questionnaire'] ] item['reponses'] = [ api_manager.url_for(ValeurPossible, q=json.dumps({ "filters": [{ "and": [{ "name": "question_id", "op": "==", "val": rep['question_id'] }, { "name": "question_num", "op": "eq", "val": rep['question_num'] }, { "name": "id", "op": "eq", "val": rep['id'] }] }] })) for rep in item['reponses'] ]
def post_get_many_Sonde(result=None, **kw): # print("POST_GET_MANY_SONDE") for item in result['objects']: item['panels'] = [ api_manager.url_for(Panel, instid=p['id_panel']) for p in item['panels'] ]
def post_get_many_Questionnaire(result=None, **kw): for item in result['objects']: item['client'] = api_manager.url_for(Client, instid=item['id_client']) item['concepteur'] = api_manager.url_for(Utilisateur, instid=item['id_concepteur']) item['panel'] = api_manager.url_for(Panel, instid=item['id_panel']) l_questlink = [ api_manager.url_for(Question, q=json.dumps({ "filters": [{ "and": [{ "name": "id", "op": "==", "val": quest['id'] }, { "name": "numero", "op": "eq", "val": quest['numero'] }] }] })) for quest in item['questions'] ] item['questions'] = l_questlink
def post_get_single_Questionnaire(instance_id=None, result=None, **kw): # print("POST_GET_SINGLE_QUESTIONNAIRE") result['client'] = api_manager.url_for(Client, instid=result['id_client']) result['concepteur'] = api_manager.url_for(Utilisateur, instid=result['id_concepteur']) result['panel'] = api_manager.url_for(Panel, instid=result['id_panel']) l_questlink = [ api_manager.url_for(Question, q=json.dumps({ "filters": [{ "and": [{ "name": "id", "op": "==", "val": quest['id'] }, { "name": "numero", "op": "eq", "val": quest['numero'] }] }] })) for quest in result['questions'] ] result['questions'] = l_questlink
def post_get_many_Panel(result=None, **kw): for item in result['objects']: item['sondes'] = [ api_manager.url_for(Sonde, instid=p['id_sonde']) for p in item['sondes'] ]
def post_get_single_Panel(result=None, **kw): result['sondes'] = [ api_manager.url_for(Sonde, instid=p['id_sonde']) for p in result['sondes'] ]
def post_get_single_Sonde(result=None, **kw): # print("POST_GET_SINGLE_SONDE") result['panels'] = [ api_manager.url_for(Panel, instid=p['id_panel']) for p in result['panels'] ]