Init - 29/05/2025

Signed-off-by: Cherif <cbalde@mysy-training.com>
master
Cherif 2025-05-29 19:12:21 +02:00
parent c6dd32c31d
commit e0a6d2c651
30 changed files with 12806 additions and 464 deletions

View File

@ -1,8 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.10" jdkType="Python SDK" />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.venv" />
<excludeFolder url="file://$MODULE_DIR$/.venv2" />
<excludeFolder url="file://$MODULE_DIR$/venv" />
<excludeFolder url="file://$MODULE_DIR$/venv2" />
</content>
<orderEntry type="jdk" jdkName="Python 3.12 (Back_Office)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10" project-jdk-type="Python SDK" />
<component name="Black">
<option name="sdkName" value="Python 3.12 (pythonProject)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (Back_Office)" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" />
</component>

View File

@ -1,11 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="13/05/2025 - 20h">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="14/05/2025 - 20h">
<change beforePath="$PROJECT_DIR$/.idea/Back_Office.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/Back_Office.iml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Dashbord_queries/inscription_tdb_qries.py" beforeDir="false" afterPath="$PROJECT_DIR$/Dashbord_queries/inscription_tdb_qries.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Ela_Spacy.py" beforeDir="false" afterPath="$PROJECT_DIR$/Ela_Spacy.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Job_Cron_Common.py" beforeDir="false" afterPath="$PROJECT_DIR$/Job_Cron_Common.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$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/apprenant_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/apprenant_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/base_class_calcul_note.py" beforeDir="false" afterPath="$PROJECT_DIR$/base_class_calcul_note.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ela_index_bdd_classes.py" beforeDir="false" afterPath="$PROJECT_DIR$/ela_index_bdd_classes.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/email_inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_inscription_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/jury_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/jury_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/note_evaluation_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/note_evaluation_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_document_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_document_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/requirements.txt" beforeDir="false" afterPath="$PROJECT_DIR$/requirements.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/venv/Scripts/Activate.ps1" beforeDir="false" afterPath="$PROJECT_DIR$/venv/Scripts/Activate.ps1" afterDir="false" />
<change beforePath="$PROJECT_DIR$/venv/Scripts/activate" beforeDir="false" afterPath="$PROJECT_DIR$/venv/Scripts/activate" afterDir="false" />
<change beforePath="$PROJECT_DIR$/venv/Scripts/activate.bat" beforeDir="false" afterPath="$PROJECT_DIR$/venv/Scripts/activate.bat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/venv/Scripts/deactivate.bat" beforeDir="false" afterPath="$PROJECT_DIR$/venv/Scripts/deactivate.bat" afterDir="false" />
<change beforePath="$PROJECT_DIR$/venv/Scripts/pip.exe" beforeDir="false" afterPath="$PROJECT_DIR$/venv/Scripts/pip.exe" afterDir="false" />
<change beforePath="$PROJECT_DIR$/venv/Scripts/pip3.exe" beforeDir="false" afterPath="$PROJECT_DIR$/venv/Scripts/pip3.exe" afterDir="false" />
<change beforePath="$PROJECT_DIR$/venv/Scripts/python.exe" beforeDir="false" afterPath="$PROJECT_DIR$/venv/Scripts/python.exe" afterDir="false" />
<change beforePath="$PROJECT_DIR$/venv/Scripts/pythonw.exe" beforeDir="false" afterPath="$PROJECT_DIR$/venv/Scripts/pythonw.exe" afterDir="false" />
<change beforePath="$PROJECT_DIR$/venv/pyvenv.cfg" beforeDir="false" afterPath="$PROJECT_DIR$/venv/pyvenv.cfg" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wrapper.py" beforeDir="false" afterPath="$PROJECT_DIR$/wrapper.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -31,19 +60,24 @@
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 4
}</component>
<component name="ProjectId" id="2O40wlXXU4LUU1KR1pTy4RUoafQ" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;C:/Users/billa/Documents/myclass.com/Siteweb/Production/Ela_back/Back_Office/.git/config&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.lookFeel&quot;
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"Python.main.executor": "Run",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"git-widget-placeholder": "master",
"last_opened_file_path": "C:/Users/Cherif/Documents/myclass.com/Siteweb/Elyos_Ftion_Initiale/Ela_back/Back_Office_FI",
"settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable"
}
}</component>
}]]></component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\billa\Documents\myclass.com\Siteweb\Production\Ela_back\Back_Office\tools_cherif" />
@ -53,14 +87,18 @@
<component name="RunManager">
<configuration name="main" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
<module name="Back_Office" />
<selectedOptions>
<option name="envPaths" visible="false" />
</selectedOptions>
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="C:\Users\billa\AppData\Local\Programs\Python\Python310\python.exe" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="false" />
<option name="WORKING_DIRECTORY" value="C:\Users\Cherif\Documents\myclass.com\Siteweb\Elyos_Ftion_Continue\Ela_back\Back_Office" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/main.py" />
@ -73,6 +111,13 @@
<method v="2" />
</configuration>
</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-python-sdk-af26db0dccfe-c546a90a8094-com.jetbrains.pycharm.community.sharedIndexes.bundled-PC-242.26775.22" />
</set>
</attachedChunks>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
@ -82,13 +127,6 @@
<option name="presentableId" value="Default" />
<updated>1680804787304</updated>
</task>
<task id="LOCAL-00411" summary="qsdsqqs">
<created>1729684312512</created>
<option name="number" value="00411" />
<option name="presentableId" value="LOCAL-00411" />
<option name="project" value="LOCAL" />
<updated>1729684312514</updated>
</task>
<task id="LOCAL-00412" summary="29/10/2024 - 18h30">
<created>1730223616262</created>
<option name="number" value="00412" />
@ -425,10 +463,32 @@
<option name="project" value="LOCAL" />
<updated>1747159305323</updated>
</task>
<option name="localTasksCounter" value="460" />
<task id="LOCAL-00460" summary="14/05/2025 - 20h">
<created>1747251650255</created>
<option name="number" value="00460" />
<option name="presentableId" value="LOCAL-00460" />
<option name="project" value="LOCAL" />
<updated>1747251650255</updated>
</task>
<option name="localTasksCounter" value="461" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="RECENT_FILTERS">
<map>
<entry key="Branch">
<value>
<list>
<RecentGroup>
<option name="FILTER_VALUES">
<option value="origin/master" />
</option>
</RecentGroup>
</list>
</value>
</entry>
</map>
</option>
<option name="TAB_STATES">
<map>
<entry key="MAIN">
@ -450,24 +510,8 @@
</entry>
</map>
</option>
<option name="RECENT_FILTERS">
<map>
<entry key="Branch">
<value>
<list>
<RecentGroup>
<option name="FILTER_VALUES">
<option value="origin/master" />
</option>
</RecentGroup>
</list>
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="30/01/2025 - 16h" />
<MESSAGE value="01/02/2025 - 20h" />
<MESSAGE value="06-02-2025 - new_design_2025" />
<MESSAGE value="08/02/205 - 22h30" />
@ -492,6 +536,7 @@
<MESSAGE value="08/05/2025 - 19" />
<MESSAGE value="13/05/2025 - 17h" />
<MESSAGE value="13/05/2025 - 20h" />
<option name="LAST_COMMIT_MESSAGE" value="13/05/2025 - 20h" />
<MESSAGE value="14/05/2025 - 20h" />
<option name="LAST_COMMIT_MESSAGE" value="14/05/2025 - 20h" />
</component>
</project>

View File

@ -1717,12 +1717,3 @@ def TBD_Inscription_Export_Dashbord_To_Csv(diction):
return False, " Impossible d'exporter les données "
"""
TDB : Nombre d'inscription par session
"""
"""
TDB : Nombre d'inscription par formation
"""

View File

@ -375,7 +375,7 @@ Aussi, on fait le choix de liberé de ne pas stémiser certain mots'''
def Ela_stemmize_search(tab_tokens):
try:
tab_ret_val = []
#print(" VERIFICATION SI LE MOT DOIT ETRE STEMISE - Ela_stemmize_search- : " + str(tab_tokens))
print(" VERIFICATION SI LE MOT DOIT ETRE STEMISE - Ela_stemmize_search- : " + str(tab_tokens))
for mot in tab_tokens:
if (mycommon.Word_Not_Stemmize(str(mot))):
tab_ret_val.append(unidecode(mot))
@ -383,7 +383,7 @@ def Ela_stemmize_search(tab_tokens):
'''
On fait la correction orthographe avant
'''
#print("AVANT CORRECTION ORTHOGRAHIQUE ="+str(mot)+" ==> APRES = "+unidecode(str(MYSY_GV.spell.correction(mot))))
print("AVANT CORRECTION ORTHOGRAHIQUE ="+str(mot)+" ==> APRES = "+unidecode(str(MYSY_GV.spell.correction(mot))))
corrected_str = str(MYSY_GV.spell.correction(mot))
@ -405,7 +405,7 @@ def Ela_stemmize_search(tab_tokens):
tab_ret_val.append( unidecode (str(MYSY_GV.stemmer.stem(corrected_str))))
'''
#print(" STMISATION TAB = "+str(tab_ret_val))
print(" STMISATION TAB = "+str(tab_ret_val))
return True, tab_ret_val

View File

@ -20,9 +20,9 @@ MYSY_ENV = ENV_DATA.MYSY_ENV
CLIENT_URL_BASE = ""
if (MYSY_ENV == "PROD"):
CONNECTION_STRING = "mongodb://localhost:27017/cherifdb"
CONNECTION_STRING = "mongodb://localhost:27017/cherifdb_fi"
client = MongoClient(CONNECTION_STRING)
dbname = client['cherifdb']
dbname = client['cherifdb_fi']
CLIENT_URL_BASE = 'https://www.mysy-training.com/'
MYSY_DEBUG_LEVEL = 0
@ -39,9 +39,9 @@ if (MYSY_ENV == "PROD"):
elif (MYSY_ENV == "DEV"):
CONNECTION_STRING = "mongodb://localhost:27017/cherifdb_dev"
CONNECTION_STRING = "mongodb://localhost:27017/cherifdb_dev_fi"
client = MongoClient(CONNECTION_STRING)
dbname = client['cherifdb_dev']
dbname = client['cherifdb_dev_fi']
CLIENT_URL_BASE = 'http://localhost:3009/'
MYSY_DEBUG_LEVEL = 1
@ -58,9 +58,9 @@ elif (MYSY_ENV == "DEV"):
elif (MYSY_ENV == "REC"):
CONNECTION_STRING = "mongodb://localhost:27017/cherifdb_rec"
CONNECTION_STRING = "mongodb://localhost:27017/cherifdb_rec_fi"
client = MongoClient(CONNECTION_STRING)
dbname = client['cherifdb_rec']
dbname = client['cherifdb_rec_fi']
CLIENT_URL_BASE = 'https://dev.mysy-training.com/'
MYSY_DEBUG_LEVEL = 1
@ -76,9 +76,9 @@ elif (MYSY_ENV == "REC"):
elif (MYSY_ENV == "DEM"):
CONNECTION_STRING = "mongodb://localhost:27017/cherifdb_demo"
CONNECTION_STRING = "mongodb://localhost:27017/cherifdb_demo_fi"
client = MongoClient(CONNECTION_STRING)
dbname = client['cherifdb_demo']
dbname = client['cherifdb_demo_fi']
CLIENT_URL_BASE = 'https://demo.mysy-training.com/'
MYSY_DEBUG_LEVEL = 1

View File

@ -80,7 +80,7 @@ def AddStagiairetoClass(diction):
'tuteur2_nom', 'tuteur2_prenom', 'tuteur2_email', 'tuteur2_telephone', 'tuteur2_adresse',
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com','date_naissance',
'financeur_rattachement_id', 'tuteur1_civilite', 'tuteur2_civilite', 'quotation_id',
'facture_client_rattachement_id'
'facture_client_rattachement_id', 'tab_ue_ids'
]
incom_keys = diction.keys()
@ -457,8 +457,7 @@ def AddStagiairetoClass(diction):
else:
mydata['opco'] = ""
mydata['class_id'] = str(is_myclass_valide_data['_id'])
mydata['date_update'] = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
mydata['date_creation'] = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
mydata['update_by'] = str(connected_user_id)
@ -568,9 +567,10 @@ def AddStagiairetoClass(diction):
qui permet de créer les contenus des collection 'inscription_liste_ue' et peut etre 'inscription_liste_ue_type_eval'
Il s'agit du remplissage par defaut ou tout est actif
"""
if ("formation_initiale" in my_partner.keys() and my_partner['formation_initiale'] == "1"):
if ("tab_ue_ids" not in diction.keys() and "formation_initiale" in my_partner.keys() and my_partner['formation_initiale'] == "1" ):
local_diction = {}
local_diction['token'] = diction['token']
local_diction['inscription_id'] = str(inserted_id)
@ -585,6 +585,24 @@ def AddStagiairetoClass(diction):
local_inscription_liste_ue_status, local_inscription_liste_ue_retval)
elif ("tab_ue_ids" in diction.keys() and "formation_initiale" in my_partner.keys() and my_partner['formation_initiale'] == "1" ):
# Ici l'utilisateur a fourni un list d'UE ou il faut inscrire l'apprenant.
# Ceci s'applique lorsque par exemple un apprenant d'inscrit à 1 ou 2 UE sur une formation
local_diction = {}
local_diction['token'] = diction['token']
local_diction['inscription_id'] = str(inserted_id)
local_diction['class_id'] = str(is_myclass_valide_data['_id'])
local_diction['tab_ue_ids'] = str(diction['tab_ue_ids'])
print(" ### Init_AcceptAttendeeInscription_For_Initial_Formation 22 local_diction = ",local_diction )
local_inscription_liste_ue_status, local_inscription_liste_ue_retval = Init_AcceptAttendeeInscription_For_Initial_Formation(
local_diction)
print(" local_inscription_liste_ue_status, local_inscription_liste_ue_retval = ",
local_inscription_liste_ue_status, local_inscription_liste_ue_retval)
"""
update du 25/08/23
@ -676,7 +694,8 @@ def AddStagiairetoClass(diction):
new_apprenant_diction['_id'] = str(is_apprenant_existe['_id'])
local_apprenant_id = str(is_apprenant_existe['_id'])
if( "tab_ue_ids" in new_apprenant_diction.keys()):
del new_apprenant_diction['tab_ue_ids']
local_status, local_retval = apprenant_mgt.Update_Apprenant(new_apprenant_diction)
if (local_status is False):
@ -687,12 +706,11 @@ def AddStagiairetoClass(diction):
new_apprenant_diction = diction
champ_to_delete = [ 'class_internal_url', 'session_id', 'inscription_validation_date', 'apprenant_id', 'status',
'modefinancement', 'type_apprenant', 'financeur_rattachement_id',
'quotation_id', 'facture_client_rattachement_id']
'quotation_id', 'facture_client_rattachement_id', 'tab_ue_ids']
for val in champ_to_delete:
if( val in new_apprenant_diction.keys()):
del new_apprenant_diction[str(val)]
local_status, local_retval = apprenant_mgt.Add_Apprenant(new_apprenant_diction)
if (local_status is False):
return local_status, local_retval
@ -738,7 +756,7 @@ def AddStagiairetoClass(diction):
local_diction['email'] = str(diction['email'])
local_diction['inscription_id'] = str(inserted_id)
print(" ### -- local_diction = ", local_diction)
#print(" ### -- local_diction = ", local_diction)
local_status, local_retval = AcceptAttendeeInscription(local_diction)
if (local_status is False):
@ -750,7 +768,7 @@ def AddStagiairetoClass(diction):
seulement dans le cas de la preinscription, car le log de la validation de l'inscription
est porté par la fonction 'acceptinscription..."
"""
if( diction['status'] == "0"):
if( new_status == "0"):
# pour la collection 'inscription'
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
@ -1305,7 +1323,7 @@ def UpdateStagiairetoClass(diction):
local_diction['email'] = str(diction['email'])
local_diction['inscription_id'] = str(diction['_id'])
print(" ### -- local_diction = ", local_diction)
#print(" ### -- local_diction = ", local_diction)
local_status, local_retval = AcceptAttendeeInscription(local_diction)
@ -5891,7 +5909,7 @@ def Init_AcceptAttendeeInscription_For_Initial_Formation(diction):
"""
Verification de la liste des champs obligatoires
"""
field_list_obligatoire = ['token', 'inscription_id', 'class_id']
field_list_obligatoire = ['token', 'inscription_id', 'class_id', 'tab_ue_ids']
for val in field_list_obligatoire:
if val not in diction:
mycommon.myprint(
@ -5958,6 +5976,17 @@ def Init_AcceptAttendeeInscription_For_Initial_Formation(diction):
{"partner_owner_recid": str(my_partner['recid']),
'class_id': str(diction['class_id']), 'inscription_id': str(diction['inscription_id']), })
my_ue_ids = ""
tab_ue_ids = []
if ("tab_ue_ids" in diction.keys()):
if diction['tab_ue_ids']:
my_ue_ids = diction['tab_ue_ids']
tab_ue_ids_work = str(my_ue_ids).split(",")
for tmp in tab_ue_ids_work:
if (tmp):
tab_ue_ids.append(tmp)
"""
Recuperer les UE de la formation
"""
@ -5966,6 +5995,7 @@ def Init_AcceptAttendeeInscription_For_Initial_Formation(diction):
qry = {"partner_owner_recid": str(my_partner['recid']), 'valide': '1', 'locked': '0',
'_id': ObjectId(str(diction['class_id']))}
"""
Remplissage de la collection : inscription_liste_ue
"""
@ -5973,39 +6003,71 @@ def Init_AcceptAttendeeInscription_For_Initial_Formation(diction):
if( "list_unite_enseignement" in New_retVal.keys() ):
for local_val in New_retVal['list_unite_enseignement'] :
tab_class_ue_id.append(str(local_val['_id']))
if( "tab_ue_ids" not in diction.keys() ):
tab_class_ue_id.append(str(local_val['_id']))
new_data = {}
new_data['inscription_id'] = str(diction['inscription_id'])
new_data['class_id'] = str(diction['class_id'])
new_data['class_eu_id'] = str(local_val['_id'])
new_data['date_update'] = str(datetime.now())
new_data['update_by'] = str(my_partner['_id'])
new_data['partner_owner_recid'] = str(my_partner['recid'])
new_data['valide'] = "1"
new_data['locked'] = "0"
new_data = {}
new_data['inscription_id'] = str(diction['inscription_id'])
new_data['class_id'] = str(diction['class_id'])
new_data['class_eu_id'] = str(local_val['_id'])
new_data['date_update'] = str(datetime.now())
new_data['update_by'] = str(my_partner['_id'])
new_data['partner_owner_recid'] = str(my_partner['recid'])
new_data['valide'] = "1"
new_data['locked'] = "0"
key_data = {}
key_data['inscription_id'] = str(diction['inscription_id'])
key_data['class_id'] = str(diction['class_id'])
key_data['class_eu_id'] = str(local_val['_id'])
key_data['valide'] = "1"
key_data['partner_owner_recid'] = str(my_partner['recid'])
key_data = {}
key_data['inscription_id'] = str(diction['inscription_id'])
key_data['class_id'] = str(diction['class_id'])
key_data['class_eu_id'] = str(local_val['_id'])
key_data['valide'] = "1"
key_data['partner_owner_recid'] = str(my_partner['recid'])
result = MYSY_GV.dbname['inscription_liste_ue'].find_one_and_update(
key_data,
{"$set": new_data},
upsert=True,
return_document=ReturnDocument.AFTER
)
if ("_id" not in result.keys()):
mycommon.myprint(
" Impossible de valider l'inscription pour la formation initiale (2) ")
return False, "Impossible de valider l'inscription pour la formation initiale (2) "
result = MYSY_GV.dbname['inscription_liste_ue'].find_one_and_update(
key_data,
{"$set": new_data},
upsert=True,
return_document=ReturnDocument.AFTER
)
if ("_id" not in result.keys()):
mycommon.myprint(
" Impossible de valider l'inscription pour la formation initiale (2) ")
return False, "Impossible de valider l'inscription pour la formation initiale (2) "
elif ("tab_ue_ids" in diction.keys() and str(local_val['_id']) in tab_ue_ids ):
print(" ### traitement inscription PARTIEL UEEE ", str(local_val['_id']))
tab_class_ue_id.append(str(local_val['_id']))
new_data = {}
new_data['inscription_id'] = str(diction['inscription_id'])
new_data['class_id'] = str(diction['class_id'])
new_data['class_eu_id'] = str(local_val['_id'])
new_data['date_update'] = str(datetime.now())
new_data['update_by'] = str(my_partner['_id'])
new_data['partner_owner_recid'] = str(my_partner['recid'])
new_data['valide'] = "1"
new_data['locked'] = "0"
key_data = {}
key_data['inscription_id'] = str(diction['inscription_id'])
key_data['class_id'] = str(diction['class_id'])
key_data['class_eu_id'] = str(local_val['_id'])
key_data['valide'] = "1"
key_data['partner_owner_recid'] = str(my_partner['recid'])
result = MYSY_GV.dbname['inscription_liste_ue'].find_one_and_update(
key_data,
{"$set": new_data},
upsert=True,
return_document=ReturnDocument.AFTER
)
if ("_id" not in result.keys()):
mycommon.myprint(
" Impossible de valider l'inscription pour la formation initiale (2) ")
return False, "Impossible de valider l'inscription pour la formation initiale (2) "
"""
@ -6775,12 +6837,18 @@ def AcceptAttendeeInscription(diction):
new_apprenant_diction['_id'] = str(is_apprenant_existe['_id'])
local_apprenant_id = str(is_apprenant_existe['_id'])
if ("tab_ue_ids" in new_apprenant_diction.keys()):
del new_apprenant_diction['tab_ue_ids']
local_status, local_retval = apprenant_mgt.Update_Apprenant(new_apprenant_diction)
if (local_status is False):
return local_status, local_retval
else:
# Il faut créer un dossier apprenant
if ("tab_ue_ids" in new_apprenant_diction.keys()):
del new_apprenant_diction['tab_ue_ids']
local_status, local_retval = apprenant_mgt.Add_Apprenant(new_apprenant_diction)
if( local_status is False):

View File

@ -2712,9 +2712,7 @@ def Cron_Qualiopi_Automatic_Traitement_Notification(diction):
toaddrs = ",".join(tab_destination_mail)
dest_email = toaddrs
print(" ### toaddrs 01010222 = ", dest_email)
#print(" ### toaddrs 01010222 = ", dest_email)
msg['to'] = dest_email
val = smtpserver.send_message(msg)

File diff suppressed because it is too large Load Diff

View File

@ -6793,7 +6793,6 @@ Depuis la session, l'utilisateur choisi le modele PDF et
telecharge les conventions d'entreprise et les conventions individuelles.
On créé un fichier zip qui sera téléchargé avec toutes les pièces jointes
"""
def Prepare_and_Send_Convocation_From_Session_By_PDF(diction):
try:
@ -6899,14 +6898,12 @@ def Prepare_and_Send_Convocation_From_Session_By_PDF(diction):
return True, send_file(zip_file_name, as_attachment=True)
return False, " Impossible de générer les conventions par pdf PDF (1) "
return False, " Impossible de générer les convocations par PDF (1) "
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
return False, " Impossible de générer les conventions par pdf PDF "
return False, " Impossible de générer les convocations par PDF "
"""
@ -7522,12 +7519,7 @@ def Sent_Convocation_Stagiaire_By_Email(tab_files, Folder, diction):
tab_files_to_attache_to_mail = []
for saved_file in tab_files:
"""
status, saved_file = mycommon.Upload_Save_PDF_IMG_File(file, Folder)
if (status is False):
mycommon.myprint("Impossible de récupérer correctement le fichier à importer")
return False, "Impossible de récupérer correctement le fichier à importer"
"""
file_to_attache_to_mail = MIMEBase('application', "octet-stream")
file_to_attache_to_mail.set_payload(open(saved_file, "rb").read())
@ -13892,7 +13884,7 @@ def Send_Email_request_presinscription_data_validation(diction):
val = smtpserver.send_message(msg)
smtpserver.close()
print(" Email envoyé 44" + str(val))
print(" Email envoyé " + str(val))
return True, "Les demandes de mise à jour ont été envoyées"

View File

@ -232,7 +232,7 @@ def Update_Apprenant(diction):
'tuteur1_cp', 'tuteur1_ville', 'tuteur1_pays', 'tuteur1_include_com',
'tuteur2_nom', 'tuteur2_prenom', 'tuteur2_email', 'tuteur2_telephone', 'tuteur2_adresse',
'tuteur2_cp', 'tuteur2_ville', 'tuteur2_pays', 'tuteur2_include_com', 'civilite', 'date_naissance',
'tuteur1_civilite', 'tuteur2_civilite'
'tuteur1_civilite', 'tuteur2_civilite',
]
incom_keys = diction.keys()
@ -854,7 +854,7 @@ def Apprenant_Inscrire_Session(diction):
"""
Verification des input acceptés
"""
field_list = ['token', '_id', 'session_id', 'type_apprenant' , 'modefinancement', 'client_rattachement_id']
field_list = ['token', '_id', 'session_id', 'type_apprenant' , 'modefinancement', 'client_rattachement_id', 'tab_ue_ids']
incom_keys = diction.keys()
for val in incom_keys:
@ -947,6 +947,16 @@ def Apprenant_Inscrire_Session(diction):
'valide': '1',
})
local_class_id = ""
if( "class_id" not in session_data.keys() ):
class_data = MYSY_GV.dbname['myclass'].find_one({'internal_url':str(session_data['class_internal_url']),
'valide':'1',
'locked':'0',
'partner_owner_recid':str(my_partner['recid'])})
if(class_data and '_id' in class_data.keys() ):
local_class_id = str(class_data['_id'])
new_data = {}
new_data['token'] = diction['token']
@ -958,25 +968,78 @@ def Apprenant_Inscrire_Session(diction):
new_data['modefinancement'] = str(diction['modefinancement'])
new_data['client_rattachement_id'] = client_rattachement_id
new_data['apprenant_id'] = str(apprenant_data['_id'])
new_data['session_id'] = str(session_data['_id'])
new_data['class_internal_url'] = session_data['class_internal_url']
new_data['status'] = "1"
new_data['type_apprenant'] = str(type_apprenant)
new_data['tab_ue_ids'] = str(diction['tab_ue_ids'])
new_data['inscription_validation_date'] = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
#new_data['date_update'] = str(datetime.now())
#new_data['update_by'] = str(my_partner['_id'])
#new_data['partner_owner_recid'] = str(my_partner['recid'])
print('### Inscription_mgt.AddStagiairetoClass new_data = ', new_data)
local_status, local_retval = Inscription_mgt.AddStagiairetoClass(new_data)
if( local_status is False ):
return local_status, local_retval
"""
Vu que la fonction "AddStagiairetoClass" ne retroune pas l'_id, on va aller le recherche
"" "
qry = {'apprenant_id':str(str(apprenant_data['_id'])),
'session_id':str(session_data['_id']),
'class_id':str(local_class_id),
'email':apprenant_data['email']
}
new_inscrit_data = MYSY_GV.dbname['inscription'].find_one(qry)
"" "
Verfier si 'tab_ue_ids' contient des valeurs, si oui alors il faut inscrire les ue dans la collection inscription_liste_ue
"" "
my_ue_ids = ""
tab_ue_ids = []
if ("tab_ue_ids" in diction.keys()):
if diction['tab_ue_ids']:
my_ue_ids = diction['tab_ue_ids']
tab_ue_ids_work = str(my_ue_ids).split(",")
for tmp in tab_ue_ids_work:
if (tmp):
tab_ue_ids.append(tmp)
for ue in tab_ue_ids:
new_data = {}
new_data['inscription_id'] = str(new_inscrit_data['_id'])
new_data['class_id'] = str(local_class_id)
new_data['class_eu_id'] = str(ue)
new_data['date_update'] = str(datetime.now())
new_data['update_by'] = str(my_partner['_id'])
new_data['partner_owner_recid'] = str(my_partner['recid'])
new_data['valide'] = "1"
new_data['locked'] = "0"
key_data = {}
key_data['inscription_id'] = str(new_inscrit_data['_id'])
key_data['class_id'] = str(local_class_id)
key_data['class_eu_id'] = str(ue)
key_data['valide'] = "1"
key_data['partner_owner_recid'] = str(my_partner['recid'])
result = MYSY_GV.dbname['inscription_liste_ue'].find_one_and_update(
key_data,
{"$set": new_data},
upsert=True,
return_document=ReturnDocument.AFTER
)
if ("_id" not in result.keys()):
mycommon.myprint(
" Impossible de valider l'inscription pour la formation initiale (2) ")
return False, "Impossible de valider l'inscription pour la formation initiale (2) "
"""
## Add to log history
now = str(datetime.now().strftime("%d/%m/%Y %H:%M:%S"))
history_event_dict = {}
@ -1001,6 +1064,10 @@ def Apprenant_Inscrire_Session(diction):
"""
Inscrire une liste d'apprenant à une session de formation
Si une unité d'enseignement est fourni, alors l'incription
concernant uniquement cette ue (collection : inscription_liste_ue)
"""
def Apprenant_Inscrire_Session_List(diction):
try:
@ -1009,7 +1076,8 @@ def Apprenant_Inscrire_Session_List(diction):
"""
Verification des input acceptés
"""
field_list = ['token', 'list_apprenant_id', 'session_id', 'type_apprenant' , 'modefinancement', 'client_rattachement_id']
field_list = ['token', 'list_apprenant_id', 'session_id', 'type_apprenant' , 'modefinancement',
'client_rattachement_id', 'tab_ue_ids']
incom_keys = diction.keys()
for val in incom_keys:
@ -1043,6 +1111,31 @@ def Apprenant_Inscrire_Session_List(diction):
return local_status, my_partner
"""
S'il y a des ue, verifier la validité des ue
"""
my_ue_ids = ""
tab_ue_ids = []
if ("tab_ue_ids" in diction.keys()):
if diction['tab_ue_ids']:
my_ue_ids = diction['tab_ue_ids']
tab_ue_ids_work = str(my_ue_ids).split(",")
for tmp in tab_ue_ids_work:
if( tmp ):
tab_ue_ids.append(tmp)
for val in tab_ue_ids :
is_eu_count = MYSY_GV.dbname['unite_enseignement'].count_documents({'_id':ObjectId(str(val)),
'valide':'1',
'locked':'0',
'partner_owner_recid':str(my_partner['recid'])})
if( is_eu_count != 1):
mycommon.myprint(
str(inspect.stack()[0][3]) + " L'unité d'enseignement "+str(val)+" est invalide ")
return False, " L'unité d'enseignement "+str(val)+" est invalide "
# Verifier que le type d'apprenant est bien valide
@ -1086,12 +1179,20 @@ def Apprenant_Inscrire_Session_List(diction):
list_apprenant_id = []
list_apprenant_id_work = []
if ("list_apprenant_id" in diction.keys()):
if diction['list_apprenant_id']:
list_apprenant_id = str(diction['list_apprenant_id']).replace(",", ";").split(";")
list_apprenant_id_work = str(diction['list_apprenant_id']).replace(",", ";").split(";")
for tmp in list_apprenant_id_work :
if( tmp):
list_apprenant_id.append(tmp)
is_blocking_message = False
blocking_message = "Erreur : "
for apprenant_id in list_apprenant_id :
# Verifier que l'apprenant existe
is_apprenant_exist = MYSY_GV.dbname['apprenant'].count_documents({'_id':ObjectId(str(apprenant_id)),
@ -1125,6 +1226,8 @@ def Apprenant_Inscrire_Session_List(diction):
is_warning_message = False
warning_message = "Warning : "
# field_list = ['token', '_id', 'session_id', 'type_apprenant' , 'modefinancement']
#print(" ### list_apprenant_id = ", list_apprenant_id)
for apprenant_id in list_apprenant_id:
# Recuperer les données de l'apprenant
@ -1141,7 +1244,9 @@ def Apprenant_Inscrire_Session_List(diction):
local_diction['type_apprenant'] = diction['type_apprenant']
local_diction['modefinancement'] = diction['modefinancement']
local_diction['client_rattachement_id'] = client_rattachement_id
local_diction['tab_ue_ids'] = str(diction['tab_ue_ids'])
print(" ### local_diction = ", local_diction)
local_status, local_retval = Apprenant_Inscrire_Session(local_diction)
if( local_status is False ):

View File

@ -291,7 +291,6 @@ def run_ue_pre_calcul_moyenne_somme(diction):
qry_key['type_eval'] = note_finale['type_eval']
qry_key['ue_id'] = note_finale['ue_id']
new_data = note_finale
new_data['date_update'] = str(datetime.now())
new_data['update_by'] = str(my_partner['_id'])
@ -323,7 +322,7 @@ def run_ue_pre_calcul_moyenne_somme(diction):
print(" ### local_diction = ", local_diction)
local_status, local_retval = Cacul_UE_Note_Finale_For_calcul_mode_1(local_diction)
#local_status, local_retval = Cacul_UE_Note_Finale_For_calcul_mode_1(local_diction)
return True, tab_note_final
@ -602,18 +601,34 @@ def Cacul_UE_Note_Finale_For_calcul_mode_1(diction):
'locked': '0',
})
if( type_eval_td_data is None ):
mycommon.myprint(
str(inspect.stack()[0][3]) + " Aucun type d'évaluation de type 'TD', merci de vérifier le paramétrage des types d'évaluation ")
return False, " Aucun type d'évaluation de type 'TD', merci de vérifier le paramétrage des types d'évaluation "
type_eval_tp_data = MYSY_GV.dbname['type_evaluation'].find_one({'code': {'$regex': "tp", "$options": "i"},
'partner_owner_recid': str(my_partner['recid']),
'valide': '1',
'locked': '0',
})
if (type_eval_tp_data is None):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " Aucun type d'évaluation de type 'TP', merci de vérifier le paramétrage des types d'évaluation ")
return False, " Aucun type d'évaluation de type 'TP', merci de vérifier le paramétrage des types d'évaluation "
type_eval_examen_data = MYSY_GV.dbname['type_evaluation'].find_one({'code': {'$regex': "Examen", "$options": "i"},
'partner_owner_recid': str(my_partner['recid']),
'valide': '1',
'locked': '0',
})
if (type_eval_examen_data is None):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " Aucun type d'évaluation de type 'Examen', merci de vérifier le paramétrage des types d'évaluation ")
return False, " Aucun type d'évaluation de type 'Exame', merci de vérifier le paramétrage des types d'évaluation "
@ -1055,7 +1070,7 @@ def Get_List_Evaluation_UE_Note_Classement_With_Filter(diction):
query = {"$and": [filt_session_id, filt_ue_id, data_cle, filt_inscrit_id, filt_apprenant_id_from_jury_seance]}
#print(" ### session_formation_final_note_classement query = ", query)
RetObject = []
val_tmp = 0
@ -1069,8 +1084,8 @@ def Get_List_Evaluation_UE_Note_Classement_With_Filter(diction):
if ("jury_note" not in retval.keys()):
user['jury_note'] = ""
if ("jury_comment" not in retval.keys()):
user['jury_comment'] = ""
if ("jury_observation" not in retval.keys()):
user['jury_observation'] = ""
if ("jury_validation" not in retval.keys()):
user['jury_validation'] = ""
@ -1203,8 +1218,8 @@ def Get_List_Evaluation_Inscriptio_Note_Classement_With_Filter(diction):
if( "jury_note" not in retval.keys() ):
user['jury_note'] = ""
if ("jury_comment" not in retval.keys()):
user['jury_comment'] = ""
if ("jury_observation" not in retval.keys()):
user['jury_observation'] = ""
if ("jury_validation" not in retval.keys()):
user['jury_validation'] = ""
@ -1212,6 +1227,10 @@ def Get_List_Evaluation_Inscriptio_Note_Classement_With_Filter(diction):
if ("jury_validation_champ_technique" not in retval.keys()):
user['jury_validation_champ_technique'] = ""
if ("rang_calculation_date" not in retval.keys()):
user['rang_calculation_date'] = ""
RetObject.append(mycommon.JSONEncoder().encode(user))
return True, RetObject
@ -1532,7 +1551,6 @@ def Get_List_base_calcul_note_class_and_ue_With_Filter(diction):
Fonction globale de calcul en prenant en entrée une session
"""
def Calcul_Note_Classement_Session(diction):
try:
diction = mycommon.strip_dictionary(diction)

View File

@ -810,6 +810,14 @@ def ela_recherche_tokens(sentence):
print(" VERIF APRES STEMISATION AA: " + str(tab_tokens4))
"""
24/05/2025 pr test on va annuler la Ela_stemmize_search
"""
tab_tokens4 = tab_tokens3
"""
end test : ca l'air de fonctionner à retester bien
"""
tab_tokens4.sort()
'''

View File

@ -165,7 +165,7 @@ def incription_training_confirmation_mail(diction):
"email": str(diction['email'])},
}
print(" ### BODY DATA = ", body)
#print(" ### BODY DATA = ", body)
sourceHtml = template.render(params=body["params"])

File diff suppressed because it is too large Load Diff

226
main.py
View File

@ -6585,6 +6585,27 @@ def Get_List_Partner_Document_with_filter():
"""
API qui permet de récupérer la liste des documents personnalisables d'un partenaire avec filtre
SANS retourner les champs :
- contenu_doc
- corps_mail
"""
@app.route('/myclass/api/Get_List_Partner_Document_with_filter_No_HTML_Fields/', methods=['POST','GET'])
@crossdomain(origin='*')
def Get_List_Partner_Document_with_filter_No_HTML_Fields():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### Get_List_Partner_Document_with_filter_No_HTML_Fields payload = ",payload)
status, retval = partner_document_mgt.Get_List_Partner_Document_with_filter_No_HTML_Fields(payload)
return jsonify(status=status, message=retval)
"""
API qui permet de récupérer la liste des documents personnalisables d'un partenaire avec filtre en mode Super ADMIN
"""
@ -10690,6 +10711,60 @@ def Export_To_Excel_List_Participant_To_Evaluation(token, evaluation_id):
return False
"""
API pour Recuperer toutes les notes d'une list d'apprenant (APPRENANT, PAS INSCRIT)
avec des filtres possible sur les session et les ue
filtre :
- session (list)
- ue (list)
- appreant (list)
"""
@app.route('/myclass/api/Get_List_Apprenant_Notes_With_Filter/', methods=['POST','GET'])
@crossdomain(origin='*')
def Get_List_Apprenant_Notes_With_Filter():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### Get_List_Apprenant_Notes_With_Filter payload = ",payload)
status, retval = note_evaluation_mgt.Get_List_Apprenant_Notes_With_Filter(payload)
return jsonify(status=status, message=retval)
"""
API pour exporter au format excel toutes les notes d'une list d'apprenant (APPRENANT, PAS INSCRIT)
avec des filtres possible sur les session et les ue
filtre :
- session (list)
- ue (list)
- appreant (list)
"""
@app.route('/myclass/api/Export_To_Excel_List_Apprenant_Notes_With_Filter/<token>/<list_session_id>/<list_ue_id>/<list_apprenant_id>', methods=['POST','GET'])
@crossdomain(origin='*')
def Export_To_Excel_List_Apprenant_Notes_With_Filter(token, list_session_id, list_ue_id, list_apprenant_id ):
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
payload = {}
payload['token'] = str(token)
if( str(list_session_id) != "-"):
payload['list_session_id'] = str(list_session_id)
if (str(list_ue_id) != "-"):
payload['list_ue_id'] = str(list_ue_id)
if( str(list_apprenant_id) != "-"):
payload['list_apprenant_id'] = str(list_apprenant_id)
print(" ### Export_To_Excel_List_Apprenant_Notes_With_Filter payload = ",payload)
status, retval = note_evaluation_mgt.Export_To_Excel_List_Apprenant_Notes_With_Filter(payload)
if(status ):
return retval
else:
return False
"""
API pour verifier la disponibilité d'une ressource sur un creneau donnée dans l'agenda
"""
@ -12454,8 +12529,8 @@ def Add_Update_Apprenant_To_Jury():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### Add_Update_Apprenant_To_Jury : payload = ",payload)
localStatus, message, agenda_id= jury_mgt.Add_Update_Apprenant_To_Jury(payload)
return jsonify(status=localStatus, message=message, agenda_id=agenda_id )
localStatus, message, agenda_id, soutenance_id = jury_mgt.Add_Update_Apprenant_To_Jury(payload)
return jsonify(status=localStatus, message=message, agenda_id=agenda_id, soutenance_id=soutenance_id )
@ -12530,6 +12605,23 @@ def Get_Given_Jury_Soutenenace():
"""
API pour Recuperation de la liste des soutenances avec des filtre sur
- sur la salle
- l'inscrit (list)
- l'apprenant (ICI Pas de list)
"""
@app.route('/myclass/api/Get_List_Jury_Soutenenace_With_Filter/', methods=['POST','GET'])
@crossdomain(origin='*')
def Get_List_Jury_Soutenenace_With_Filter():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### Get_List_Jury_Soutenenace_With_Filter : payload = ",payload)
localStatus, message= jury_mgt.Get_List_Jury_Soutenenace_With_Filter(payload)
return jsonify(status=localStatus, message=message )
"""
API pour supprimer la soutenances de jury donnée
@ -12544,6 +12636,136 @@ def Delete_Given_Jury_Soutenenace():
return jsonify(status=localStatus, message=message )
"""
API pour generer les convocation jury (apprenant) soutenance par PDF
"""
@app.route('/myclass/api/Send_Jury_Apprenant_Soutenance_Convocation_By_PDF/<token>/<jury_id>/<tab_jury_soutenance_ids>/<courrier_template_id>', methods=['POST','GET'])
@crossdomain(origin='*')
def Send_Jury_Apprenant_Soutenance_Convocation_By_PDF(token, jury_id, tab_jury_soutenance_ids, courrier_template_id):
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
payload = {}
payload['token'] = str(token)
if (str(jury_id) != "-"):
payload['jury_id'] = str(jury_id)
if( str(tab_jury_soutenance_ids) != "-"):
payload['tab_jury_soutenance_ids'] = str(tab_jury_soutenance_ids)
if (str(courrier_template_id) != "-"):
payload['courrier_template_id'] = str(courrier_template_id)
print(" ### Send_Jury_Apprenant_Soutenance_Convocation_By_PDF : payload = ",str(payload))
localStatus, response= jury_mgt.Send_Jury_Apprenant_Soutenance_Convocation_By_PDF(payload)
if(localStatus ):
return response
else:
return False
"""
API pour generer les convocation jury (apprenants) soutenance par email
"""
@app.route('/myclass/api/Send_Jury_Apprenant_Soutenance_Convocation_By_Email/', methods=['POST','GET'])
@crossdomain(origin='*')
def Send_Jury_Apprenant_Soutenance_Convocation_By_Email():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### Send_Jury_Apprenant_Soutenance_Convocation_By_Email : payload = ",str(payload))
file = []
if request.method == 'POST':
# Create variable for uploaded file
tab_files = []
for tmp in request.files.getlist("File"):
tab_files.append(tmp)
status, retval = jury_mgt.Send_Jury_Apprenant_Soutenance_Convocation_By_Email(tab_files, MYSY_GV.TEMPORARY_DIRECTORY_V2, payload)
return jsonify(status=status, message=retval)
"""
API pour generer les convocation de membre du jury (membre) PDF
"""
@app.route('/myclass/api/Send_Jury_Membre_Convocation_By_PDF/<token>/<tab_jury_ids>/<courrier_template_id>', methods=['POST','GET'])
@crossdomain(origin='*')
def Send_Jury_Membre_Convocation_By_PDF(token, tab_jury_ids, courrier_template_id):
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
payload = {}
payload['token'] = str(token)
if (str(tab_jury_ids) != "-"):
payload['tab_jury_ids'] = str(tab_jury_ids)
if (str(courrier_template_id) != "-"):
payload['courrier_template_id'] = str(courrier_template_id)
print(" ### Send_Jury_Membre_Convocation_By_PDF : payload = ",str(payload))
localStatus, response= jury_mgt.Send_Jury_Membre_Convocation_By_PDF(payload)
if(localStatus ):
return response
else:
return False
"""
API pour generer les convocation des membres du jury (membre) par email
"""
@app.route('/myclass/api/Send_Jury_Membre_Convocation_By_Email/', methods=['POST','GET'])
@crossdomain(origin='*')
def Send_Jury_Membre_Convocation_By_Email():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### Send_Jury_Membre_Convocation_By_Email : payload = ",str(payload))
file = []
if request.method == 'POST':
# Create variable for uploaded file
tab_files = []
for tmp in request.files.getlist("File"):
tab_files.append(tmp)
status, retval = jury_mgt.Send_Jury_Membre_Convocation_By_Email(tab_files, MYSY_GV.TEMPORARY_DIRECTORY_V2, payload)
return jsonify(status=status, message=retval)
"""
API pour mettre à jour la decision du jury pour
un inscrit (jury_cac)
"""
@app.route('/myclass/api/Add_Update_Inscrit_Juy_Promo_Decision/', methods=['POST','GET'])
@crossdomain(origin='*')
def Add_Update_Inscrit_Juy_Promo_Decision():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### Add_Update_Inscrit_Juy_Promo_Decision : payload = ",str(payload))
status, retval = jury_mgt.Add_Update_Inscrit_Juy_Promo_Decision( payload)
return jsonify(status=status, message=retval)
"""
API pour mettre à jour la decision du jury pour un jury d' UE (pas CAC mais UE)
"""
@app.route('/myclass/api/Add_Update_UE_Jury_Observation/', methods=['POST','GET'])
@crossdomain(origin='*')
def Add_Update_UE_Jury_Observation():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### Add_Update_UE_Jury_Observation : payload = ",str(payload))
status, retval = jury_mgt.Add_Update_UE_Jury_Observation( payload)
return jsonify(status=status, message=retval)
if __name__ == '__main__':
print(" debut api")
context = SSL.Context(SSL.SSLv23_METHOD)

View File

@ -2334,10 +2334,6 @@ def Export_Excel_List_Participant_Notes(diction):
Verification de la validité de la liste des inscription
"""
#print("tab_my_session_ids = ", tab_my_session_ids)
for my_inscription_id in tab_my_inscription_ids:
# Verifier qui la formation n'a pas deja été evaluée
@ -2813,6 +2809,7 @@ filtre :
Algorithme :
1 - recuperer toutes les 'inscription_id' appartenant a un 'apprenant_id' ==> tab_inscription
2 - recuperer les 'evaluation_id' concernée par la list_ue_id
3 - recuperer les 'evaluation_id' concernée par la list_session_id
"""
@ -2835,7 +2832,7 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
"""
Verification des champs obligatoires
"""
field_list_obligatoire = ['token', 'list_session_id', 'list_ue_id', 'list_apprenant_id' ]
field_list_obligatoire = ['token', 'list_apprenant_id' ]
for val in field_list_obligatoire:
if val not in diction:
@ -2865,7 +2862,8 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
tab_my_session_ids = str(my_session_ids).split(",")
tab_my_session_ids_ObjectId = []
for tmp in tab_my_session_ids:
tab_my_session_ids_ObjectId.append(ObjectId(str(tmp)))
if( tmp ):
tab_my_session_ids_ObjectId.append(ObjectId(str(tmp)))
filt_session_ids = {}
if(len(tab_my_session_ids) > 0 ):
@ -2881,7 +2879,8 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
tab_my_ue_ids = str(my_ue_ids).split(",")
tab_my_ue_ids_ObjectId = []
for tmp in tab_my_ue_ids:
tab_my_ue_ids_ObjectId.append(ObjectId(str(tmp)))
if (tmp):
tab_my_ue_ids_ObjectId.append(ObjectId(str(tmp)))
filt_ue_ids = {}
if (len(tab_my_ue_ids) > 0):
@ -2898,7 +2897,8 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
tab_my_apprenant_ids = str(my_apprenant_ids).split(",")
tab_my_apprenant_ids_ObjectId = []
for tmp in tab_my_apprenant_ids:
tab_my_apprenant_ids_ObjectId.append(ObjectId(str(tmp)))
if (tmp):
tab_my_apprenant_ids_ObjectId.append(ObjectId(str(tmp)))
filt_apprenant_ids = {}
if (len(tab_my_apprenant_ids) > 0):
@ -2909,6 +2909,9 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
"""
filt_concerned_tab_inscription_id = {}
concerned_tab_inscription_id = []
for val in MYSY_GV.dbname['inscription'].find({'apprenant_id':{'$in': tab_my_apprenant_ids } ,
'valide':'1',
'locked':'0',
@ -2918,25 +2921,51 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
if(len(concerned_tab_inscription_id) > 0 ):
filt_concerned_tab_inscription_id = {"inscription_id": {"$in": concerned_tab_inscription_id}}
"""
2 - Recuperer les evaluation_id
2 - Recuperer les evaluation_id concernée par l'UE
"""
filt_concerned_tab_evaluation_id = {}
concerned_tab_evaluation_id = []
for val in MYSY_GV.dbname['note_evaluation'].find({'class_eu_id': {'$in': tab_my_ue_ids},
'valide': '1',
'locked': '0',
'partner_owner_recid': str(my_partner['recid'])}):
concerned_tab_evaluation_id.append((str(val['_id'])))
if (len(concerned_tab_evaluation_id) > 0):
filt_concerned_tab_evaluation_id = {"evaluation_id": {"$in": concerned_tab_inscription_id}}
filt_concerned_tab_evaluation_id = {"evaluation_id": {"$in": concerned_tab_evaluation_id}}
"""
3 - Recuperer les session_id
"""
filt_concerned_tab_session_id = {}
concerned_tab_session_id = []
for val in MYSY_GV.dbname['note_evaluation'].find({'class_eu_id': {'$in': tab_my_session_ids},
'valide': '1',
'locked': '0',
'partner_owner_recid': str(my_partner['recid'])}):
concerned_tab_session_id.append((str(val['_id'])))
if (len(concerned_tab_session_id) > 0):
filt_concerned_tab_session_id = {"evaluation_id": {"$in": concerned_tab_session_id}}
qery_match = {'$and': [{"partner_owner_recid": str(my_partner['recid'])},
{"valide": '1'},
{"locked": '0'},
filt_concerned_tab_inscription_id,
filt_concerned_tab_evaluation_id
filt_concerned_tab_evaluation_id,
filt_concerned_tab_session_id,
]}
@ -2966,98 +2995,34 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
}
},
{'$project': {'_id': 1, 'code': 1, 'titre': 1, 'class_id': 1, 'class_eu_id': 1,
'type_eval_id': 1, 'session_id': 1, 'partner_owner_recid': 1}}
'type_eval_id': 1, 'session_id': 1, 'partner_owner_recid': 1,
'eval_date_heure_debut':1, 'eval_date_heure_fin':1}}
],
'as': 'note_evaluation_collection'
}}
])
print(" ### Get_List_Apprenant_Notes_With_Filter ici pipe_qry = ", pipe_qry)
#print(" ### Get_List_Apprenant_Notes_With_Filter ici pipe_qry = ", pipe_qry)
cpt = 0
tab_lines_inscription_data = []
for retval in MYSY_GV.dbname['note_evaluation_participant'].aggregate(pipe_qry):
cpt = cpt + 1
print(" ### retval = ", retval)
"""
Verification de la validité de la liste des inscription
"""
#print("tab_my_session_ids = ", tab_my_session_ids)
for my_inscription_id in tab_my_inscription_ids:
# Verifier qui la formation n'a pas deja été evaluée
tmp_count = MYSY_GV.dbname['inscription'].count_documents({'session_id': {'$in': tab_my_session_ids, },
'_id': ObjectId(str(my_inscription_id)),
'partner_owner_recid': str(my_partner['recid']),
} )
if (tmp_count != 1):
mycommon.myprint(str(inspect.stack()[0][3]) + " L'inscription "+str(my_inscription_id)+" est invalide ")
return False, " L'inscription "+str(my_inscription_id)+" est invalide "
"""
Verification de la validité de la liste des sessions
"""
for my_session_ids in tab_my_session_ids:
# Verifier qui la formation n'a pas deja été evaluée
tmp_count = MYSY_GV.dbname['session_formation'].count_documents({'_id': ObjectId(str(my_session_ids)),
'partner_owner_recid': str(my_partner['recid']),
'valide':'1'
} )
if (tmp_count != 1):
mycommon.myprint(str(inspect.stack()[0][3]) + " La session "+str(my_session_ids)+" est invalide ")
return False, " L'inscription "+str(my_session_ids)+" est invalide "
RetObject = []
nb_val = 0
query = [{'$match': {'inscription_id': {'$in':tab_my_inscription_ids}, 'partner_owner_recid': str(my_partner['recid']),
}},
{'$sort': {'_id': -1}},
{'$lookup':
{
'from': 'note_evaluation',
"let": {'evaluation_id': "$evaluation_id", 'partner_owner_recid': '$partner_owner_recid'},
'pipeline': [{'$match':
{'$expr': {'$and': [
{'$eq': ["$valide", "1"]},
{'$eq': ["$_id", {'$convert': {
'input': "$$evaluation_id",
'to': "objectId",
'onError': {'error': 'true'},
'onNull': {'isnull': 'true'}
}}]},
]}}},
], 'as': 'note_evaluation_collection'}
}
]
#print("#### Get_List_Participant_Notes laa 01 : query = ", query)
for retval in MYSY_GV.dbname['note_evaluation_participant'].aggregate(query):
if( "note_evaluation_collection" in retval.keys() ):
for retval in MYSY_GV.dbname['note_evaluation_participant'].aggregate(pipe_qry):
if ("note_evaluation_collection" in retval.keys()):
user = {}
nom_apprenant = ""
prenom_apprenant = ""
email_apprenant = ""
groupe = ""
if( "inscription_id" in retval and retval['inscription_id']):
if ("inscription_id" in retval and retval['inscription_id']):
# Recuprer les données de l'inscrit
inscription_data = MYSY_GV.dbname['inscription'].find_one({'_id':ObjectId(str(retval['inscription_id']))},
{'_id':1, 'apprenant_id':1})
apprenant_data = MYSY_GV.dbname['apprenant'].find_one({'_id':ObjectId(str(inscription_data['apprenant_id']))},
{'_id':1, 'nom':1, 'prenom':1, 'email':1})
inscription_data = MYSY_GV.dbname['inscription'].find_one(
{'_id': ObjectId(str(retval['inscription_id']))},
{'_id': 1, 'apprenant_id': 1})
apprenant_data = MYSY_GV.dbname['apprenant'].find_one(
{'_id': ObjectId(str(inscription_data['apprenant_id']))},
{'_id': 1, 'nom': 1, 'prenom': 1, 'email': 1})
nom_apprenant = apprenant_data['nom']
prenom_apprenant = apprenant_data['prenom']
@ -3077,11 +3042,12 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
class_ue_code = ""
class_ue_titre = ""
ue_data = MYSY_GV.dbname['unite_enseignement'].find_one({'_id':ObjectId(str(user['class_eu_id'])),
'valide':'1',
'locked':'0',
'partner_owner_recid':str(my_partner['recid'])})
if( "code" in ue_data.keys() ):
ue_data = MYSY_GV.dbname['unite_enseignement'].find_one({'_id': ObjectId(str(user['class_eu_id'])),
'valide': '1',
'locked': '0',
'partner_owner_recid': str(
my_partner['recid'])})
if ("code" in ue_data.keys()):
class_ue_code = str(ue_data['code'])
if ("titre" in ue_data.keys()):
class_ue_titre = str(ue_data['titre'])
@ -3089,38 +3055,34 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
user['class_ue_code'] = class_ue_code
user['class_ue_titre'] = class_ue_titre
user['type_eval_id'] = str(retval['note_evaluation_collection'][0]['type_eval_id'])
type_eval_data = MYSY_GV.dbname['type_eval_id'].find_one({'_id':ObjectId(str(user['type_eval_id'])),
'valide':'1',
'locked':'0',
'partner_owner_recid':str(my_partner['recid'])})
if( type_eval_data and 'code' in type_eval_data.keys() ):
type_eval_data = MYSY_GV.dbname['type_eval_id'].find_one({'_id': ObjectId(str(user['type_eval_id'])),
'valide': '1',
'locked': '0',
'partner_owner_recid': str(
my_partner['recid'])})
if (type_eval_data and 'code' in type_eval_data.keys()):
user['type_eval_code'] = type_eval_data['code']
else:
user['type_eval_code'] = ""
user['eval_date_heure_debut'] = str(retval['note_evaluation_collection'][0]['eval_date_heure_debut'])
user['eval_date_heure_fin'] = str(retval['note_evaluation_collection'][0]['eval_date_heure_fin'])
user['nom'] = nom_apprenant
user['prenom'] = prenom_apprenant
user['email'] = email_apprenant
user['id'] = str(nb_val)
if( "note" not in retval.keys() ):
user['id'] = str(cpt)
if ("note" not in retval.keys()):
user['note'] = "-1"
nb_val = nb_val + 1
cpt = cpt + 1
RetObject.append(mycommon.JSONEncoder().encode(user))
#print(" ### user = ", user)
return True, RetObject
except Exception as e:
@ -3128,3 +3090,392 @@ def Get_List_Apprenant_Notes_With_Filter(diction):
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
return False, "Impossible de récupérer les notes de l'apprenant"
"""
Cette fonction permet d'exporter les notes d'une list d'apprenant (APPRENANT, PAS INSCRIT)
avec des filtres possible sur les session et les ue
filtre :
- session (list)
- ue (list)
- appreant (list)
"""
def Export_To_Excel_List_Apprenant_Notes_With_Filter(diction):
try:
diction = mycommon.strip_dictionary(diction)
"""
Verification des input acceptés
"""
field_list = ['token', 'list_session_id', 'list_ue_id', 'list_apprenant_id' ]
incom_keys = diction.keys()
for val in incom_keys:
if val not in field_list and val.startswith('my_') is False:
mycommon.myprint(str(
inspect.stack()[0][3]) + " Le champ '" + val + "' n'est pas autorisé")
return False, " Les informations fournies sont incorrectes"
"""
Verification des champs obligatoires
"""
field_list_obligatoire = ['token', 'list_apprenant_id' ]
for val in field_list_obligatoire:
if val not in diction:
mycommon.myprint(
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans la liste des arguments ")
return False, " Les informations fournies sont incorrectes"
"""
Verification de l'identité et autorisation de l'entité qui
appelle cette API
"""
token = ""
if ("token" in diction.keys()):
if diction['token']:
token = diction['token']
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
if (local_status is not True):
return local_status, my_partner
### Les sessions de formation
my_session_ids = ""
if ("list_session_id" in diction.keys()):
if diction['list_session_id']:
my_session_ids = diction['list_session_id']
tab_my_session_ids = str(my_session_ids).split(",")
tab_my_session_ids_ObjectId = []
for tmp in tab_my_session_ids:
if( tmp ):
tab_my_session_ids_ObjectId.append(ObjectId(str(tmp)))
filt_session_ids = {}
if(len(tab_my_session_ids) > 0 ):
filt_session_ids = {'session_id':{'$in':tab_my_session_ids}}
### Les ue
my_ue_ids = ""
if ("list_ue_id" in diction.keys()):
if diction['list_ue_id']:
my_ue_ids = diction['list_ue_id']
tab_my_ue_ids = str(my_ue_ids).split(",")
tab_my_ue_ids_ObjectId = []
for tmp in tab_my_ue_ids:
if (tmp):
tab_my_ue_ids_ObjectId.append(ObjectId(str(tmp)))
filt_ue_ids = {}
if (len(tab_my_ue_ids) > 0):
filt_ue_ids = {'ue_id': {'$in': tab_my_ue_ids}}
### Les apprenants
my_apprenant_ids = ""
if ("list_apprenant_id" in diction.keys()):
if diction['list_apprenant_id']:
my_apprenant_ids = diction['list_apprenant_id']
tab_my_apprenant_ids = str(my_apprenant_ids).split(",")
tab_my_apprenant_ids_ObjectId = []
for tmp in tab_my_apprenant_ids:
if (tmp):
tab_my_apprenant_ids_ObjectId.append(ObjectId(str(tmp)))
filt_apprenant_ids = {}
if (len(tab_my_apprenant_ids) > 0):
filt_apprenant_ids = {'apprenant_id': {'$in': tab_my_apprenant_ids}}
"""
1 - Recuperer les inscription_id
"""
filt_concerned_tab_inscription_id = {}
concerned_tab_inscription_id = []
for val in MYSY_GV.dbname['inscription'].find({'apprenant_id':{'$in': tab_my_apprenant_ids } ,
'valide':'1',
'locked':'0',
'partner_owner_recid':str(my_partner['recid'])}):
concerned_tab_inscription_id.append((str(val['_id'])))
if(len(concerned_tab_inscription_id) > 0 ):
filt_concerned_tab_inscription_id = {"inscription_id": {"$in": concerned_tab_inscription_id}}
"""
2 - Recuperer les evaluation_id concernée par l'UE
"""
filt_concerned_tab_evaluation_id = {}
concerned_tab_evaluation_id = []
for val in MYSY_GV.dbname['note_evaluation'].find({'class_eu_id': {'$in': tab_my_ue_ids},
'valide': '1',
'locked': '0',
'partner_owner_recid': str(my_partner['recid'])}):
concerned_tab_evaluation_id.append((str(val['_id'])))
if (len(concerned_tab_evaluation_id) > 0):
filt_concerned_tab_evaluation_id = {"evaluation_id": {"$in": concerned_tab_evaluation_id}}
"""
3 - Recuperer les session_id
"""
filt_concerned_tab_session_id = {}
concerned_tab_session_id = []
for val in MYSY_GV.dbname['note_evaluation'].find({'class_eu_id': {'$in': tab_my_session_ids},
'valide': '1',
'locked': '0',
'partner_owner_recid': str(my_partner['recid'])}):
concerned_tab_session_id.append((str(val['_id'])))
if (len(concerned_tab_session_id) > 0):
filt_concerned_tab_session_id = {"evaluation_id": {"$in": concerned_tab_session_id}}
qery_match = {'$and': [{"partner_owner_recid": str(my_partner['recid'])},
{"valide": '1'},
{"locked": '0'},
filt_concerned_tab_inscription_id,
filt_concerned_tab_evaluation_id,
filt_concerned_tab_session_id,
]}
pipe_qry = ([
{'$match': qery_match},
{'$lookup': {
'from': 'note_evaluation',
"let": {'evaluation_id': "$evaluation_id", 'partner_owner_recid': '$partner_owner_recid'},
'pipeline': [
{'$match':
{'$expr':
{'$and':
[
{'$eq': ["$_id", {'$convert': {
'input': "$$evaluation_id",
'to': "objectId",
'onError': {'error': 'true'},
'onNull': {'isnull': 'true'}
}}]},
{'$eq': ["$valide", "1"]},
{'$eq': ["$partner_owner_recid", '$$partner_owner_recid']},
]
}
}
},
{'$project': {'_id': 1, 'code': 1, 'titre': 1, 'class_id': 1, 'class_eu_id': 1,
'type_eval_id': 1, 'session_id': 1, 'partner_owner_recid': 1,
'eval_date_heure_debut':1, 'eval_date_heure_fin':1}}
],
'as': 'note_evaluation_collection'
}}
])
ts = datetime.now().timestamp()
ts = str(ts).replace(".", "").replace(",", "")[-5:]
orig_file_name = "Export_Reponse_" + str(ts) + ".xlsx"
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
tab_exported_fields_header = ["formation", "classe", "evaluation_code", "evaluation_titre",
"evaluation_eval_date_heure_debut", "evaluation_eval_date_heure_fin",
"nom_apprenant",
"prenom_apprenant", "email_apprenant", "evaluation_note", ]
# Create a workbook and add a worksheet.
workbook = xlsxwriter.Workbook(outputFilename)
worksheet = workbook.add_worksheet()
nb_val = 0
row = 0
column = 0
"""
Creation de l'entete du fichier excel
"""
for header_item in tab_exported_fields_header:
worksheet.write(row, column, header_item)
column += 1
"""
Creation des data du fichier excel
"""
#print(" ### Get_List_Apprenant_Notes_With_Filter ici pipe_qry = ", pipe_qry)
cpt = 0
tab_lines_inscription_data = []
RetObject = []
for retval in MYSY_GV.dbname['note_evaluation_participant'].aggregate(pipe_qry):
if ("note_evaluation_collection" in retval.keys()):
user = {}
nom_apprenant = ""
prenom_apprenant = ""
email_apprenant = ""
groupe = ""
if ("inscription_id" in retval and retval['inscription_id']):
# Recuprer les données de l'inscrit
inscription_data = MYSY_GV.dbname['inscription'].find_one(
{'_id': ObjectId(str(retval['inscription_id']))},
{'_id': 1, 'apprenant_id': 1})
apprenant_data = MYSY_GV.dbname['apprenant'].find_one(
{'_id': ObjectId(str(inscription_data['apprenant_id']))},
{'_id': 1, 'nom': 1, 'prenom': 1, 'email': 1})
nom_apprenant = apprenant_data['nom']
prenom_apprenant = apprenant_data['prenom']
email_apprenant = apprenant_data['email']
user['_id'] = str(retval['_id'])
user['evaluation_id'] = str(retval['evaluation_id'])
user['inscription_id'] = str(retval['inscription_id'])
user['note'] = str(retval['note'])
user['note_evaluation_id'] = str(retval['note_evaluation_collection'][0]['_id'])
user['note_evaluation_code'] = str(retval['note_evaluation_collection'][0]['code'])
user['note_evaluation_titre'] = str(retval['note_evaluation_collection'][0]['titre'])
user['session_id'] = str(retval['note_evaluation_collection'][0]['session_id'])
user['class_eu_id'] = str(retval['note_evaluation_collection'][0]['class_eu_id'])
class_ue_code = ""
class_ue_titre = ""
ue_data = MYSY_GV.dbname['unite_enseignement'].find_one({'_id': ObjectId(str(user['class_eu_id'])),
'valide': '1',
'locked': '0',
'partner_owner_recid': str(
my_partner['recid'])})
if ("code" in ue_data.keys()):
class_ue_code = str(ue_data['code'])
if ("titre" in ue_data.keys()):
class_ue_titre = str(ue_data['titre'])
user['class_ue_code'] = class_ue_code
user['class_ue_titre'] = class_ue_titre
user['type_eval_id'] = str(retval['note_evaluation_collection'][0]['type_eval_id'])
type_eval_data = MYSY_GV.dbname['type_eval_id'].find_one({'_id': ObjectId(str(user['type_eval_id'])),
'valide': '1',
'locked': '0',
'partner_owner_recid': str(
my_partner['recid'])})
if (type_eval_data and 'code' in type_eval_data.keys()):
user['type_eval_code'] = type_eval_data['code']
else:
user['type_eval_code'] = ""
user['eval_date_heure_debut'] = str(retval['note_evaluation_collection'][0]['eval_date_heure_debut'])
user['eval_date_heure_fin'] = str(retval['note_evaluation_collection'][0]['eval_date_heure_fin'])
user['nom'] = nom_apprenant
user['prenom'] = prenom_apprenant
user['email'] = email_apprenant
user['id'] = str(cpt)
if ("note" not in retval.keys()):
user['note'] = "-1"
evaluation_formation = ""
evaluation_code_session = ""
# Recuperation des données de la session
session_data = MYSY_GV.dbname['session_formation'].find_one(
{'_id': ObjectId(str(user['session_id'])),
'valide': '1',
'partner_owner_recid': str(my_partner['recid'])})
if (session_data and "code_session" in session_data.keys()):
evaluation_code_session = session_data['code_session']
# Recuperer les données de la formation
if( "class_internal_url" in session_data and session_data['class_internal_url']):
qry_class = {'internal_url': str(session_data['class_internal_url']),
'valide': '1', 'locked': '0',
'partner_owner_recid': str(my_partner['recid'])}
class_data = MYSY_GV.dbname['myclass'].find_one(qry_class)
if (class_data and "title" in class_data.keys()):
evaluation_formation = class_data['title']
column = 0
row = row + 1
# Champ : formation
worksheet.write(row, column, evaluation_formation)
column += 1
# Champ : classe / evaluation_code_session
worksheet.write(row, column, evaluation_code_session)
column += 1
# Champ : evaluation_code
worksheet.write(row, column, str(retval['note_evaluation_collection'][0]['code']) )
column += 1
# Champ : evaluation_titre
worksheet.write(row, column, str(retval['note_evaluation_collection'][0]['titre']) )
column += 1
# Champ : evaluation_eval_date_heure_debut
worksheet.write(row, column, str(retval['note_evaluation_collection'][0]['eval_date_heure_debut']) )
column += 1
# Champ : evaluation_eval_date_heure_fin
worksheet.write(row, column, str(retval['note_evaluation_collection'][0]['eval_date_heure_fin']) )
column += 1
# Champ : nom
worksheet.write(row, column, user['nom'])
column += 1
# Champ : prenom
worksheet.write(row, column, user['prenom'])
column += 1
# Champ : email
worksheet.write(row, column, user['email'])
column += 1
# Champ : note
worksheet.write(row, column, user['note'])
column += 1
cpt = cpt + 1
RetObject.append(mycommon.JSONEncoder().encode(user))
#print(" ### user = ", user)
workbook.close()
if os.path.exists(outputFilename):
# print(" ### ok os.path.exists(outputFilename) "+str(outputFilename))
return True, send_file(outputFilename, as_attachment=True)
return True, RetObject
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
return False, "Impossible d'exporter les notes de l'apprenant"

View File

@ -1435,7 +1435,7 @@ def Get_List_Partner_Document_with_filter(diction):
"""
Verification des input acceptés
"""
field_list = ['token', 'nom', 'ref_interne', ]
field_list = ['token', 'nom', 'ref_interne', 'type_doc' ]
incom_keys = diction.keys()
for val in incom_keys:
@ -1476,6 +1476,11 @@ def Get_List_Partner_Document_with_filter(diction):
filt_ref_interne = {
'ref_interne': {'$regex': str(diction['ref_interne']), "$options": "i"}}
filt_type_document = {}
if ("type_doc" in diction.keys()):
filt_type_document = {
'type_doc': {'$regex': str(diction['type_document']), "$options": "i"}}
"""
@ -1489,9 +1494,10 @@ def Get_List_Partner_Document_with_filter(diction):
find_qry = {'$and': [ {'partner_owner_recid': str(my_partner['recid']), 'valide':'1', 'locked':'0' }, filt_nom,
filt_ref_interne, ]}
filt_ref_interne, filt_type_document]}
#print(" ### find_qry document = ", find_qry)
#print(" ### materiel find_qry = ", find_qry)
RetObject = []
val_tmp = 1
@ -1513,12 +1519,107 @@ def Get_List_Partner_Document_with_filter(diction):
return False, " Impossible de récupérer la liste des modèles de document "
"""
Recherche de la liste des modèles de document avec des .
SANS retourner les champs :
- contenu_doc
- corps_mail
"""
def Get_List_Partner_Document_with_filter_No_HTML_Fields(diction):
try:
diction = mycommon.strip_dictionary(diction)
"""
Verification des input acceptés
"""
field_list = ['token', 'nom', 'ref_interne', 'type_doc' ]
incom_keys = diction.keys()
for val in incom_keys:
if val not in field_list and val.startswith('my_') is False:
mycommon.myprint(str(
inspect.stack()[0][3]) + " Le champ '" + val + "' n'existe pas")
return False, " Les informations fournies sont incorrectes",
"""
Verification des champs obligatoires
"""
field_list_obligatoire = ['token', ]
for val in field_list_obligatoire:
if val not in diction:
mycommon.myprint(
str(inspect.stack()[0][3]) + " - La valeur '" + val + "' n'est pas presente dans la liste des arguments ")
return False, " Les informations fournies sont incorrectes",
"""
Verification de l'identité et autorisation de l'entité qui
appelle cette API
"""
token = ""
if ("token" in diction.keys()):
if diction['token']:
token = diction['token']
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
if (local_status is not True):
return local_status, my_partner
filt_nom = {}
if ("nom" in diction.keys()):
filt_nom = {'nom': {'$regex': str(diction['nom']), "$options": "i"}}
filt_ref_interne = {}
if ("ref_interne" in diction.keys()):
filt_ref_interne = {
'ref_interne': {'$regex': str(diction['ref_interne']), "$options": "i"}}
filt_type_document = {}
if ("type_doc" in diction.keys()):
filt_type_document = {
'type_doc': {'$regex': str(diction['type_doc']), "$options": "i"}}
"""
Clés de mise à jour
"""
data_cle = {}
data_cle['partner_owner_recid'] = str(my_partner['recid'])
data_cle['locked'] = "0"
data_cle['valide'] = "1"
find_qry = {'$and': [ {'partner_owner_recid': str(my_partner['recid']), 'valide':'1', 'locked':'0' }, filt_nom,
filt_ref_interne, filt_type_document]}
#print(" ### find_qry document = ", find_qry)
RetObject = []
val_tmp = 1
for retval in MYSY_GV.dbname['courrier_template'].find(find_qry, {'contenu_doc':0, 'corps_mail':0}).sort([("_id", pymongo.DESCENDING)]):
user = retval
user['id'] = str(val_tmp)
val_tmp = val_tmp + 1
if( "duplicate" not in retval.keys()):
user['duplicate'] = "0"
RetObject.append(mycommon.JSONEncoder().encode(user))
return True, RetObject
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
return False, " Impossible de récupérer la liste des modèles de document "
"""
Recherche d'un document avec filter pour en mode super Admin
"""
"""
Recherche de la liste des modèles de document avec des filter
"""
def Get_List_Partner_Document_with_filter_Admin(diction):
try:
diction = mycommon.strip_dictionary(diction)

View File

@ -205,6 +205,8 @@ def Upload_Save_IMG_File(file=None, Folder=None):
Global_file_name = str(Folder) + str(file.filename)
print(" ### Global_file_name == ", Global_file_name)
return True, Global_file_name
except Exception as e :
@ -1941,7 +1943,7 @@ def recordClassImage(file=None, Folder=None, diction=None):
return False, "Impossible d'inserer l'image de la formation "
# " Lecture du fichier "
#print(" Lecture du fichier : " + saved_file + ". le token est :" + str(mytoken))
print(" Lecture du fichier : " + saved_file + ". le token est :" + str(mytoken))
nb_line = 0
coll_name = MYSY_GV.dbname['image_ch']
@ -2440,7 +2442,6 @@ def getRecodedClassImage_no_token(diction=None):
coll_name = MYSY_GV.dbname['image_ch']
RetObject = []
@ -4637,7 +4638,7 @@ def clean_session_dates():
"""
Cette fonction retourne les champs a utiliser pour les template de document/
/!\ : Les tables en paramettres contiennent des valeurs du type ObjectId("idddd")
/!\ : Les tables en paramettre contiennent des valeurs du type ObjectId("idddd")
Cette fonction retour un json de ce type :
convention_dictionnary_data =
@ -4664,7 +4665,7 @@ def Get_Dictionnary_data_For_Template(diction):
Verification des input acceptés
"""
field_list = ['token', 'list_stagiaire_id', 'list_session_id', 'list_class_id', 'list_client_id',
'list_apprenant_id', 'list_sequence_session_id']
'list_apprenant_id', 'list_sequence_session_id', 'list_jury_soutenance_id']
incom_keys = diction.keys()
for val in incom_keys:
@ -5124,6 +5125,172 @@ def Get_Dictionnary_data_For_Template(diction):
dictionnary_data['list_sequence_session_data'] = list_sequence_session_data
"""
Recuperartion des champs de la soutenance de jury
"""
list_jury_soutenance_data = []
if( "list_jury_soutenance_id" in diction.keys() and diction['list_jury_soutenance_id'] ):
tab_jury_soutenance_id = diction['list_jury_soutenance_id']
query_soutenance_match = {'_id': {'$in': tab_jury_soutenance_id, }, 'valide': '1', 'locked':'0',
'partner_owner_recid': str(my_partner['recid'])}
query_soutenance = [{'$match': query_soutenance_match},
{'$lookup': {
'from': 'jury',
"let": {'jury_id': "$jury_id", 'partner_owner_recid': '$partner_owner_recid'},
'pipeline': [
{'$match':
{'$expr':
{'$and':
[
{'$eq': ["$_id", {'$convert': {
'input': "$$jury_id",
'to': "objectId",
'onError': {'error': 'true'},
'onNull': {'isnull': 'true'}
}}]},
{'$eq': ["$valide", "1"]},
{'$eq': ["$partner_owner_recid", '$$partner_owner_recid']}
]
}
}
},
],
'as': 'jury_collection'
}
},
{'$lookup': {
'from': 'agenda',
"let": {'agenda_id': "$agenda_id", 'partner_owner_recid': '$partner_owner_recid'},
'pipeline': [
{'$match':
{'$expr':
{'$and':
[
{'$eq': ["$_id", {'$convert': {
'input': "$$agenda_id",
'to': "objectId",
'onError': {'error': 'true'},
'onNull': {'isnull': 'true'}
}}]},
{'$eq': ["$valide", "1"]},
{'$eq': ["$partner_owner_recid", '$$partner_owner_recid']}
]
}
}
},
],
'as': 'agenda_collection'
}
},
]
for jury_soutenance_data in MYSY_GV.dbname['jury_soutenance'].aggregate(query_soutenance):
new_jury_soutenance_data = {}
if( "_id" in jury_soutenance_data.keys() ):
new_jury_soutenance_data['jury_soutenance_id'] = str(jury_soutenance_data['_id'])
if ("sujet" in jury_soutenance_data.keys()):
new_jury_soutenance_data['jury_soutenance_sujet'] = jury_soutenance_data['sujet']
else:
new_jury_soutenance_data['jury_soutenance_sujet'] = ""
if ("observation" in jury_soutenance_data.keys()):
new_jury_soutenance_data['observation'] = jury_soutenance_data['observation']
else:
new_jury_soutenance_data['observation'] = ""
if ("note" in jury_soutenance_data.keys()):
new_jury_soutenance_data['jury_soutenance_note'] = jury_soutenance_data['note']
else:
new_jury_soutenance_data['jury_soutenance_note'] = ""
if ("jury_soutenance_adresse" in jury_soutenance_data.keys()):
new_jury_soutenance_data['jury_soutenance_adresse'] = jury_soutenance_data['jury_soutenance_adresse']
else:
new_jury_soutenance_data['jury_soutenance_adresse'] = ""
if ("jury_soutenance_code_postal" in jury_soutenance_data.keys()):
new_jury_soutenance_data['jury_soutenance_code_postal'] = jury_soutenance_data['jury_soutenance_code_postal']
else:
new_jury_soutenance_data['jury_soutenance_code_postal'] = ""
if ("jury_soutenance_pays" in jury_soutenance_data.keys()):
new_jury_soutenance_data['jury_soutenance_pays'] = jury_soutenance_data['jury_soutenance_pays']
else:
new_jury_soutenance_data['jury_soutenance_pays'] = ""
if ("jury_soutenance_salle" in jury_soutenance_data.keys()):
new_jury_soutenance_data['jury_soutenance_salle'] = jury_soutenance_data['jury_soutenance_salle']
else:
new_jury_soutenance_data['jury_soutenance_salle'] = ""
if ("jury_soutenance_ville" in jury_soutenance_data.keys()):
new_jury_soutenance_data['jury_soutenance_ville'] = jury_soutenance_data['jury_soutenance_ville']
else:
new_jury_soutenance_data['jury_soutenance_ville'] = ""
if( "jury_collection" in jury_soutenance_data.keys() ):
if( "code" in jury_soutenance_data["jury_collection"][0].keys() ):
new_jury_soutenance_data['jury_code'] = jury_soutenance_data["jury_collection"][0]['code']
else:
new_jury_soutenance_data['jury_code'] = ""
if ("description" in jury_soutenance_data["jury_collection"][0].keys()):
new_jury_soutenance_data['jury_description'] = jury_soutenance_data["jury_collection"][0]['description']
else:
new_jury_soutenance_data['jury_description'] = ""
if ("agenda_collection" in jury_soutenance_data.keys()):
if ("event_start" in jury_soutenance_data["agenda_collection"][0].keys()):
if( jury_soutenance_data["agenda_collection"][0]['event_start'] ):
local_date = str( jury_soutenance_data["agenda_collection"][0]['event_start'])[0:16]
new_date = datetime.strptime(str(local_date ), '%Y-%m-%dT%H:%M').strftime( "%d/%m/%Y %H:%M")
new_jury_soutenance_data['event_start'] = str(new_date)
else:
new_jury_soutenance_data['event_start'] = ""
else:
new_jury_soutenance_data['event_start'] = ""
if ("event_end" in jury_soutenance_data["agenda_collection"][0].keys()):
if (jury_soutenance_data["agenda_collection"][0]['event_end']):
local_date = str(jury_soutenance_data["agenda_collection"][0]['event_end'])[0:16]
new_date = datetime.strptime(str(local_date), '%Y-%m-%dT%H:%M').strftime("%d/%m/%Y %H:%M")
new_jury_soutenance_data['event_end'] = str(new_date)
else:
new_jury_soutenance_data['event_end'] = ""
else:
new_jury_soutenance_data['event_end'] = ""
list_jury_soutenance_data.append(new_jury_soutenance_data)
dictionnary_data['list_jury_soutenance_data'] = list_jury_soutenance_data
# Recuperation des données système
# Ajout des champs système comme la date du jour
systeme_data = {}

View File

@ -1,25 +1,25 @@
flask
Pillow
textdistance
unidecode
wrapper
flask~=2.2.3
Pillow~=9.5.0
textdistance~=4.5.0
unidecode~=1.3.6
wrapper~=1.1.0b1
google-search-results
sib_api_v3_sdk
xhtml2pdf
pysftp
pymongo
xhtml2pdf~=0.2.9
pysftp~=0.2.9
pymongo~=4.3.3
flask_mongoengine
unicodecsv
pdfminer
flask_cors
spacy
nltk
spacy~=3.5.1
nltk~=3.8.1
pyspellchecker
textblob
autocorrect
pandas
stripe
python-dotenv
autocorrect~=2.6.1
pandas~=2.0.0
stripe~=5.4.0
python-dotenv~=1.0.0
pyopenssl
arabic-reshaper
coverage
@ -31,6 +31,31 @@ reportlab
svglib
pyHanko
pyhanko-certvalidator
zeep
mariadb
validate_email
zeep~=4.2.1
mariadb~=1.1.6
validate_email
argparse~=1.4.0
pip~=25.1.1
wheel~=0.37.1
cryptography~=40.0.1
lxml~=4.9.2
setuptools~=60.2.0
six~=1.16.0
APScheduler~=3.10.1
Jinja2~=3.1.2
openai~=1.55.0
numpy~=1.24.2
XlsxWriter~=3.1.9
requests~=2.28.2
bcrypt~=4.0.1
paramiko~=3.1.0
Levenshtein~=0.21.0
pytz~=2023.3
python-dateutil~=2.8.2
dnspython~=2.3.0
certifi~=2022.12.7
Werkzeug~=2.2.3
colorama~=0.4.6
spellchecker~=0.4
psutil~=7.0.0
segno~=1.6.1

View File

@ -16,6 +16,10 @@ function global:deactivate([switch] $NonDestructive) {
Remove-Item env:VIRTUAL_ENV -ErrorAction SilentlyContinue
}
if ($env:VIRTUAL_ENV_PROMPT) {
Remove-Item env:VIRTUAL_ENV_PROMPT -ErrorAction SilentlyContinue
}
if (!$NonDestructive) {
# Self destruct!
Remove-Item function:deactivate
@ -33,6 +37,13 @@ deactivate -nondestructive
$VIRTUAL_ENV = $BASE_DIR
$env:VIRTUAL_ENV = $VIRTUAL_ENV
if ("" -ne "") {
$env:VIRTUAL_ENV_PROMPT = ""
}
else {
$env:VIRTUAL_ENV_PROMPT = $( Split-Path $env:VIRTUAL_ENV -Leaf )
}
New-Variable -Scope global -Name _OLD_VIRTUAL_PATH -Value $env:PATH
$env:PATH = "$env:VIRTUAL_ENV/Scripts;" + $env:PATH
@ -42,19 +53,9 @@ if (!$env:VIRTUAL_ENV_DISABLE_PROMPT) {
}
$function:_old_virtual_prompt = $function:prompt
if ("" -ne "") {
function global:prompt {
# Add the custom prefix to the existing prompt
$previous_prompt_value = & $function:_old_virtual_prompt
("() " + $previous_prompt_value)
}
}
else {
function global:prompt {
# Add a prefix to the current prompt, but don't discard it.
$previous_prompt_value = & $function:_old_virtual_prompt
$new_prompt_value = "($( Split-Path $env:VIRTUAL_ENV -Leaf )) "
($new_prompt_value + $previous_prompt_value)
}
function global:prompt {
# Add the custom prefix to the existing prompt
$previous_prompt_value = & $function:_old_virtual_prompt
("(" + $env:VIRTUAL_ENV_PROMPT + ") " + $previous_prompt_value)
}
}

View File

@ -35,6 +35,7 @@ deactivate () {
fi
unset VIRTUAL_ENV
unset VIRTUAL_ENV_PROMPT
if [ ! "${1-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
@ -44,7 +45,7 @@ deactivate () {
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV='C:\Users\cheri\Documents\myclass.com\Siteweb\Production\Ela_back\Back_Office\venv'
VIRTUAL_ENV='C:\Users\Cherif\Documents\myclass.com\Siteweb\Elyos_Ftion_Continue\Ela_back\Back_Office\venv'
if ([ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]) && $(command -v cygpath &> /dev/null) ; then
VIRTUAL_ENV=$(cygpath -u "$VIRTUAL_ENV")
fi
@ -54,6 +55,13 @@ _OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/Scripts:$PATH"
export PATH
if [ "x" != x ] ; then
VIRTUAL_ENV_PROMPT=""
else
VIRTUAL_ENV_PROMPT=$(basename "$VIRTUAL_ENV")
fi
export VIRTUAL_ENV_PROMPT
# unset PYTHONHOME if set
if ! [ -z "${PYTHONHOME+_}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
@ -62,11 +70,7 @@ fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1-}"
if [ "x" != x ] ; then
PS1="() ${PS1-}"
else
PS1="(`basename \"$VIRTUAL_ENV\"`) ${PS1-}"
fi
PS1="(${VIRTUAL_ENV_PROMPT}) ${PS1-}"
export PS1
fi

View File

@ -1,39 +1,38 @@
@echo off
@set "VIRTUAL_ENV=C:\Users\Cherif\Documents\myclass.com\Siteweb\Elyos_Ftion_Continue\Ela_back\Back_Office\venv"
set "VIRTUAL_ENV=C:\Users\cheri\Documents\myclass.com\Siteweb\Production\Ela_back\Back_Office\venv"
@set "VIRTUAL_ENV_PROMPT="
@if NOT DEFINED VIRTUAL_ENV_PROMPT (
@for %%d in ("%VIRTUAL_ENV%") do @set "VIRTUAL_ENV_PROMPT=%%~nxd"
)
if defined _OLD_VIRTUAL_PROMPT (
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
@if defined _OLD_VIRTUAL_PROMPT (
@set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
) else (
if not defined PROMPT (
set "PROMPT=$P$G"
@if not defined PROMPT (
@set "PROMPT=$P$G"
)
if not defined VIRTUAL_ENV_DISABLE_PROMPT (
set "_OLD_VIRTUAL_PROMPT=%PROMPT%"
@if not defined VIRTUAL_ENV_DISABLE_PROMPT (
@set "_OLD_VIRTUAL_PROMPT=%PROMPT%"
)
)
if not defined VIRTUAL_ENV_DISABLE_PROMPT (
if "" NEQ "" (
set "PROMPT=() %PROMPT%"
) else (
for %%d in ("%VIRTUAL_ENV%") do set "PROMPT=(%%~nxd) %PROMPT%"
)
@if not defined VIRTUAL_ENV_DISABLE_PROMPT (
@set "PROMPT=(%VIRTUAL_ENV_PROMPT%) %PROMPT%"
)
REM Don't use () to avoid problems with them in %PATH%
if defined _OLD_VIRTUAL_PYTHONHOME goto ENDIFVHOME
set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%"
@REM Don't use () to avoid problems with them in %PATH%
@if defined _OLD_VIRTUAL_PYTHONHOME @goto ENDIFVHOME
@set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%"
:ENDIFVHOME
set PYTHONHOME=
@set PYTHONHOME=
REM if defined _OLD_VIRTUAL_PATH (
if not defined _OLD_VIRTUAL_PATH goto ENDIFVPATH1
set "PATH=%_OLD_VIRTUAL_PATH%"
@REM if defined _OLD_VIRTUAL_PATH (
@if not defined _OLD_VIRTUAL_PATH @goto ENDIFVPATH1
@set "PATH=%_OLD_VIRTUAL_PATH%"
:ENDIFVPATH1
REM ) else (
if defined _OLD_VIRTUAL_PATH goto ENDIFVPATH2
set "_OLD_VIRTUAL_PATH=%PATH%"
@REM ) else (
@if defined _OLD_VIRTUAL_PATH @goto ENDIFVPATH2
@set "_OLD_VIRTUAL_PATH=%PATH%"
:ENDIFVPATH2
set "PATH=%VIRTUAL_ENV%\Scripts;%PATH%"
@set "PATH=%VIRTUAL_ENV%\Scripts;%PATH%"

View File

@ -1,19 +1,18 @@
@echo off
@set VIRTUAL_ENV=
@set VIRTUAL_ENV_PROMPT=
set VIRTUAL_ENV=
REM Don't use () to avoid problems with them in %PATH%
if not defined _OLD_VIRTUAL_PROMPT goto ENDIFVPROMPT
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
set _OLD_VIRTUAL_PROMPT=
@REM Don't use () to avoid problems with them in %PATH%
@if not defined _OLD_VIRTUAL_PROMPT @goto ENDIFVPROMPT
@set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
@set _OLD_VIRTUAL_PROMPT=
:ENDIFVPROMPT
if not defined _OLD_VIRTUAL_PYTHONHOME goto ENDIFVHOME
set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
set _OLD_VIRTUAL_PYTHONHOME=
@if not defined _OLD_VIRTUAL_PYTHONHOME @goto ENDIFVHOME
@set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
@set _OLD_VIRTUAL_PYTHONHOME=
:ENDIFVHOME
if not defined _OLD_VIRTUAL_PATH goto ENDIFVPATH
set "PATH=%_OLD_VIRTUAL_PATH%"
set _OLD_VIRTUAL_PATH=
@if not defined _OLD_VIRTUAL_PATH @goto ENDIFVPATH
@set "PATH=%_OLD_VIRTUAL_PATH%"
@set _OLD_VIRTUAL_PATH=
:ENDIFVPATH

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,8 +1,8 @@
home = C:\Users\cheri\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0
home = C:\Users\Cherif\AppData\Local\Programs\Python\Python312
implementation = CPython
version_info = 3.11.0.final.0
virtualenv = 20.13.0
include-system-site-packages = false
version = 3.11.0
executable = C:\Users\cheri\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\python.exe
command = C:\Users\cheri\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\python.exe -m venv --without-pip C:\Users\cheri\Documents\myclass.com\Siteweb\Production\Ela_back\Back_Office\venv
version_info = 3.12.9.final.0
virtualenv = 20.24.5
include-system-site-packages = true
base-prefix = C:\Users\Cherif\AppData\Local\Programs\Python\Python312
base-exec-prefix = C:\Users\Cherif\AppData\Local\Programs\Python\Python312
base-executable = C:\Users\Cherif\AppData\Local\Programs\Python\Python312\python.exe

View File

@ -252,7 +252,7 @@ def get_all_class(diction):
]}
},
{'$project': { 'indexed': 0, 'indexed_desc': 0, 'indexed_obj': 0, "indexed_title": 0,
"valide": 0, "locked": 0}},
"valide": 0, "locked": 0, }},
{'$lookup':
{
'from': 'business_prices',
@ -1023,7 +1023,7 @@ def recherche_text_simple(diction):
pipe = [
{ '$match': {'external_code': {"$in": tab_training}, 'published':'1'} },
{ '$project': { '_id': 0, 'indexed': 0, 'indexed_desc': 0, 'indexed_obj': 0, "indexed_title": 0, "valide": 0, "locked": 0} },
{ '$project': { 'indexed': 0, 'indexed_desc': 0, 'indexed_obj': 0, "indexed_title": 0, "valide": 0, "locked": 0} },
{ '$lookup':
{
'from': 'business_prices',
@ -1080,7 +1080,8 @@ def recherche_text_simple(diction):
mydict_combined['type_view'] = "summary"
#print( "mydict_combined YYYYYYYYY = "+str(mydict_combined))
if ("_id" in mydict_combined.keys()):
if("_id" in mydict_combined.keys()):
#print(" ### mydict_combined[_id] = ", str(mydict_combined['_id']))
mydict_combined['class_id'] = mydict_combined.pop('_id')
@ -1102,7 +1103,9 @@ def recherche_text_simple(diction):
x['description'] = no_html[:MYSY_GV.MAX_CARACT] + " ..."
else:
x['description'] = no_html
insertObject.append(JSONEncoder().encode(user))
#print(" ### user = ", user)
insertObject.append(mycommon.JSONEncoder().encode(user))
'''
/!\ Important : Recuperation des elements de la recherche etendue