qsdsq
parent
340b0cebae
commit
b8f7f0733a
|
@ -6,6 +6,7 @@
|
|||
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/notes_apprenant_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/notes_apprenant_mgt.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
|
|
@ -11683,7 +11683,7 @@ def Get_Inscrit_List_EU(diction):
|
|||
|
||||
for tmp in second_field:
|
||||
if (str(tmp) in val['collection_unite_enseignement'].keys()):
|
||||
user[str(tmp)] = val['collection_unite_enseignement'][str(tmp)]
|
||||
user["ue_"+str(tmp)] = val['collection_unite_enseignement'][str(tmp)]
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
@ -11754,7 +11754,7 @@ def Get_Inscrit_List_EU_Type_Evaluation(diction):
|
|||
{'$match': qery_match},
|
||||
{'$lookup': {
|
||||
'from': 'type_evaluation',
|
||||
"let": {'type_evaluation_id': "type_evaluation_id",
|
||||
"let": {'type_evaluation_id': '$type_evaluation_id',
|
||||
'partner_owner_recid': '$partner_owner_recid'},
|
||||
'pipeline': [
|
||||
{'$match':
|
||||
|
@ -11786,25 +11786,41 @@ def Get_Inscrit_List_EU_Type_Evaluation(diction):
|
|||
|
||||
])
|
||||
|
||||
print(" ### Get_Inscrit_List_EU_Type_Evaluation pipe_qry = ", pipe_qry)
|
||||
|
||||
for val in MYSY_GV.dbname['inscription_liste_ue_type_evalution'].aggregate(pipe_qry):
|
||||
user = {}
|
||||
main_field = ['_id', 'class_eu_id', 'class_id', 'inscription_id', 'type_evaluation_id']
|
||||
second_field = ['_id', 'code', 'titre']
|
||||
second_field = ['_id', 'code', 'nom']
|
||||
|
||||
for tmp in main_field :
|
||||
if( str(tmp) in val.keys() ):
|
||||
user[str(tmp)] = val[str(tmp)]
|
||||
|
||||
class_eu_code = ""
|
||||
if( "class_eu_id" in val.keys() ):
|
||||
class_eu_id_data = MYSY_GV.dbname['unite_enseignement'].find_one({'_id':ObjectId(str(val['class_eu_id'])),
|
||||
'valide':'1',
|
||||
'locked':'0',
|
||||
'partner_owner_recid':str(my_partner['recid'])})
|
||||
|
||||
if( class_eu_id_data and 'code' in class_eu_id_data.keys() ):
|
||||
class_eu_code = class_eu_id_data['code']
|
||||
|
||||
user['class_eu_code'] = class_eu_code
|
||||
|
||||
for tmp in second_field:
|
||||
if (str(tmp) in val['collection_unite_enseignement'].keys()):
|
||||
user[str(tmp)] = val['collection_unite_enseignement'][str(tmp)]
|
||||
if (str(tmp) in val['collection_type_evaluation'].keys()):
|
||||
user["type_eval_"+str(tmp)] = val['collection_type_evaluation'][str(tmp)]
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
||||
print(" ### Get_Inscrit_List_EU_Type_Evaluation RetObject = ", RetObject)
|
||||
return True, RetObject
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
print(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible de recuperer les UE associées à l'inscription"
|
||||
return False, " Impossible de recuperer la liste des évaluation par UE "
|
||||
|
||||
|
|
1685
Log/log_file.log
1685
Log/log_file.log
File diff suppressed because it is too large
Load Diff
15
main.py
15
main.py
|
@ -4560,6 +4560,21 @@ def Get_Inscrit_List_EU():
|
|||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API qui permet de recuperer la liste des evaluation par UE associées à une incription
|
||||
"""
|
||||
@app.route('/myclass/api/Get_Inscrit_List_EU_Type_Evaluation/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_Inscrit_List_EU_Type_Evaluation():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Get_Inscrit_List_EU_Type_Evaluation payload = ",payload)
|
||||
status, retval = inscription.Get_Inscrit_List_EU_Type_Evaluation(payload)
|
||||
return jsonify(status=status, message=retval)
|
||||
|
||||
|
||||
|
||||
"""
|
||||
API qui recupere les informations d'une inscription en partant de '_id' de la ligne
|
||||
"""
|
||||
|
|
|
@ -707,6 +707,33 @@ def Get_List_Class_Evaluation(diction):
|
|||
for retval in MYSY_GV.dbname['class_unite_enseignement_type_evaluation'].find(data_cle).sort([("_id", pymongo.DESCENDING), ]):
|
||||
user = retval
|
||||
user['id'] = str(val_tmp)
|
||||
|
||||
type_evaluation_code = ""
|
||||
if( "type_evaluation_id" in retval.keys() and retval['type_evaluation_id']):
|
||||
type_evaluation_data = MYSY_GV.dbname['type_evaluation'].find_one({'_id':ObjectId(str(retval['type_evaluation_id'])),
|
||||
'valide':'1',
|
||||
'locked':'0',
|
||||
'partner_owner_recid':str(my_partner['recid'])})
|
||||
|
||||
if( type_evaluation_data and 'code' in type_evaluation_data.keys() ):
|
||||
type_evaluation_code= type_evaluation_data['code']
|
||||
|
||||
user['type_evaluation_code'] = type_evaluation_code
|
||||
|
||||
class_ue_code = ""
|
||||
if ("class_ue_id" in retval.keys() and retval['class_ue_id']):
|
||||
class_ue_data = MYSY_GV.dbname['unite_enseignement'].find_one(
|
||||
{'_id': ObjectId(str(retval['class_ue_id'])),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
if (class_ue_data and 'code' in class_ue_data.keys()):
|
||||
class_ue_code = class_ue_data['code']
|
||||
|
||||
user['class_ue_code'] = class_ue_code
|
||||
|
||||
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
|
Loading…
Reference in New Issue