25/12/2024 - 14h

master
cherif 2024-12-25 14:17:50 +01:00
parent af9d74d4c8
commit 9e41066257
6 changed files with 2582 additions and 24 deletions

View File

@ -1,22 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="14/12/2024 - 14h">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="24/12/2024 - 22h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/E_Sign_Document.py" beforeDir="false" afterPath="$PROJECT_DIR$/E_Sign_Document.py" afterDir="false" />
<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$/Session_Formation.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/attached_file_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/attached_file_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ela_factures_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/ela_factures_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ela_user_account.py" beforeDir="false" afterPath="$PROJECT_DIR$/ela_user_account.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_client.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_client.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partner_invoice.py" beforeDir="false" afterPath="$PROJECT_DIR$/partner_invoice.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/partners.py" beforeDir="false" afterPath="$PROJECT_DIR$/partners.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/prj_common.py" beforeDir="false" afterPath="$PROJECT_DIR$/prj_common.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/tools_cherif/mysy_openai_file.py" beforeDir="false" afterPath="$PROJECT_DIR$/tools_cherif/mysy_openai_file.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/user_session.py" beforeDir="false" afterPath="$PROJECT_DIR$/user_session.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -87,13 +78,6 @@
<option name="presentableId" value="Default" />
<updated>1680804787304</updated>
</task>
<task id="LOCAL-00370" summary="dd">
<created>1723488781960</created>
<option name="number" value="00370" />
<option name="presentableId" value="LOCAL-00370" />
<option name="project" value="LOCAL" />
<updated>1723488781961</updated>
</task>
<task id="LOCAL-00371" summary="ddd">
<created>1723555903066</created>
<option name="number" value="00371" />
@ -430,7 +414,14 @@
<option name="project" value="LOCAL" />
<updated>1734181586200</updated>
</task>
<option name="localTasksCounter" value="419" />
<task id="LOCAL-00419" summary="24/12/2024 - 22h">
<created>1735075121021</created>
<option name="number" value="00419" />
<option name="presentableId" value="LOCAL-00419" />
<option name="project" value="LOCAL" />
<updated>1735075121021</updated>
</task>
<option name="localTasksCounter" value="420" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -472,7 +463,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="08/09/2024 - 21terth" />
<MESSAGE value="12/09/2024 - 13:00" />
<MESSAGE value="15/09/2024 - 18:00" />
<MESSAGE value="18/09/2024 - 21h" />
@ -497,6 +487,7 @@
<MESSAGE value="08/12/2024 - 12h" />
<MESSAGE value="10/12/2024 - 22h" />
<MESSAGE value="14/12/2024 - 14h" />
<option name="LAST_COMMIT_MESSAGE" value="14/12/2024 - 14h" />
<MESSAGE value="24/12/2024 - 22h" />
<option name="LAST_COMMIT_MESSAGE" value="24/12/2024 - 22h" />
</component>
</project>

File diff suppressed because one or more lines are too long

View File

@ -6656,6 +6656,8 @@ def Sent_Convocation_Stagiaire_By_Email(tab_files, Folder, diction):
"params": convention_dictionnary_data,
}
orig_file_name = None
outputFilename = None
# Verifier s'il s'agit d'un document à envoyer avec une version de pièce jointe.
if ("joint_pdf" in courrier_template_data.keys() and str(courrier_template_data['joint_pdf']) == "1"):
# Il s'agit bien d'un envoie avec 'contenu_doc' en pièce jointe PDF
@ -6827,6 +6829,38 @@ def Sent_Convocation_Stagiaire_By_Email(tab_files, Folder, diction):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(history_event_dict))
"""
Après avoir loggé l'envoie reelle en production, on va aller stocker le document dans la collection : download_files
si et seulement si on bien un fichier PDF (voir variables : orig_file_name et outputFilename)
"""
if( orig_file_name and outputFilename ):
new_file = {}
new_file['token'] = diction['token']
type_document = "Convocation"
new_file['file_business_object'] = str(orig_file_name)
new_file['file_name'] = str(orig_file_name)
new_file['status'] = "1"
new_file['type_document'] = str(type_document)
new_file['object_owner_collection'] = "partner_client"
new_file['object_owner_id'] = str(inscription_data['client_rattachement_id'])
new_file['file_name_to_store'] = outputFilename
# print(" ### new_file new_file = ", new_file)
local_status, local_retval = attached_file_mgt.Internal_Usage_Store_User_Downloaded_File(
MYSY_GV.upload_folder, new_file)
if (local_status is False):
print(" ## WARINNGGG Impossible de stocker le fichier de Convocation ")
return True, "L'email a été correctement envoyé "
except Exception as e:
@ -7217,6 +7251,8 @@ def Sent_Attestation_Stagiaire_By_Email(tab_files, Folder, diction):
"params": convention_dictionnary_data,
}
orig_file_name = None
outputFilename = None
# Verifier s'il s'agit d'un document à envoyer avec une version de pièce jointe.
if ("joint_pdf" in courrier_template_data.keys() and str(courrier_template_data['joint_pdf']) == "1"):
# Il s'agit bien d'un envoie avec 'contenu_doc' en pièce jointe PDF
@ -7231,7 +7267,7 @@ def Sent_Attestation_Stagiaire_By_Email(tab_files, Folder, diction):
ts = datetime.now().timestamp()
ts = str(ts).replace(".", "").replace(",", "")[-5:]
orig_file_name = "Convocation_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
orig_file_name = "Attestation_" + str(my_partner['recid'])[0:5] + "_" + str(ts) + ".pdf"
outputFilename = str(MYSY_GV.TEMPORARY_DIRECTORY) + "/" + str(orig_file_name)
# open output file for writing (truncated binary)
@ -7388,6 +7424,39 @@ def Sent_Attestation_Stagiaire_By_Email(tab_files, Folder, diction):
mycommon.myprint(
" WARNING : Impossible de logguer l'historique pour l'évènement : " + str(history_event_dict))
"""
Après avoir loggé l'envoie reelle en production, on va aller stocker le document dans la collection : download_files
si et seulement si on bien un fichier PDF (voir variables : orig_file_name et outputFilename)
"""
print(" ### orig_file_name = ", orig_file_name)
print(" ### outputFilename = ", outputFilename)
if (orig_file_name and outputFilename):
new_file = {}
new_file['token'] = diction['token']
type_document = "Attestation"
new_file['file_business_object'] = str(orig_file_name)
new_file['file_name'] = str(orig_file_name)
new_file['status'] = "1"
new_file['type_document'] = str(type_document)
new_file['object_owner_collection'] = "partner_client"
new_file['object_owner_id'] = str(inscription_data['client_rattachement_id'])
new_file['file_name_to_store'] = outputFilename
# print(" ### new_file new_file = ", new_file)
local_status, local_retval = attached_file_mgt.Internal_Usage_Store_User_Downloaded_File(
MYSY_GV.upload_folder, new_file)
if (local_status is False):
print(" ## WARNINGGG Impossible de stocker le fichier d'attestation")
return True, "L'email a été correctement envoyé "
except Exception as e:

View File

@ -73,6 +73,8 @@ metadata :
/!\ : 24/12/2024
- type_document : le champs 'file_business_object' semble problematique, nous allons donc introduire un champs : 'type_document' qui permettra de savori si c'est un devis, une convention, etc
(ce champs n'est pas obligatoire)
- metadata_field : est un champs de texte qui prends au maximum 500 caractère pour stocker des metadata pour effectuer des recherches
"""
def Store_User_Downloaded_File(file=None, Folder=None, diction=None):
try:
@ -84,7 +86,7 @@ def Store_User_Downloaded_File(file=None, Folder=None, diction=None):
Verification des input acceptés
"""
field_list = ['token', 'file_business_object', 'file_name', 'status','object_owner_collection',
'object_owner_id', 'type_document']
'object_owner_id', 'type_document', 'metadata_field']
incom_keys = diction.keys()
for val in incom_keys:
if val not in field_list and val.startswith('my_') is False:
@ -150,6 +152,14 @@ def Store_User_Downloaded_File(file=None, Folder=None, diction=None):
if diction['type_document']:
type_document = diction['type_document']
metadata_field = ""
if ("metadata_field" in diction.keys()):
if ( diction['metadata_field'] and str( diction['metadata_field'] ) > 500 ) :
metadata_field = diction['metadata_field'][0:500]
elif ( diction['metadata_field'] and str( diction['metadata_field'] ) <= 500 ) :
metadata_field = diction['metadata_field']
object_owner_id = ""
if ("object_owner_id" in diction.keys()):
if diction['object_owner_id']:
@ -174,6 +184,7 @@ def Store_User_Downloaded_File(file=None, Folder=None, diction=None):
mydata['date_update'] = str(datetime.now())
mydata['file_name'] = file.filename
mydata['type_document'] = type_document
mydata['metadata_field'] = metadata_field
mydata['full_path'] = Global_file_name
mydata['file_extention'] = file_extention
mydata['object_owner_collection'] = object_owner_collection
@ -182,6 +193,9 @@ def Store_User_Downloaded_File(file=None, Folder=None, diction=None):
mydata['partner_owner_recid'] = str(my_partner['recid'])
mydata['valide'] = "1"
mydata['status'] = "0"
mydata['locked'] = "0"
mydata['created_date'] = str(datetime.now())
mydata['created_by'] = str(my_partner['_id'])
ret_val = MYSY_GV.dbname['download_files'].find_one_and_update({'file_business_object': str(file_business_object),
'object_owner_collection':str(object_owner_collection),
@ -207,6 +221,9 @@ Cette fonction est la copie de la première a l'exception qu'il s'agit d'une uti
/!\ : 24/12/2024
- type_document : le champs 'file_business_object' semble problematique, nous allons donc introduire un champs : 'type_document' qui permettra de savori si c'est un devis, une convention, etc
(ce champs n'est pas obligatoire)
- metadata_field : est un champs de texte qui prends au maximum 500 caractère pour stocker des metadata pour effectuer des recherches
"""
def Internal_Usage_Store_User_Downloaded_File(Folder=None, diction=None):
try:
@ -218,7 +235,7 @@ def Internal_Usage_Store_User_Downloaded_File(Folder=None, diction=None):
Verification des input acceptés
"""
field_list = ['token', 'file_business_object', 'file_name', 'status','object_owner_collection', 'object_owner_id',
'file_name_to_store', 'type_document']
'file_name_to_store', 'type_document', 'metadata_field']
incom_keys = diction.keys()
for val in incom_keys:
if val not in field_list and val.startswith('my_') is False:
@ -294,6 +311,14 @@ def Internal_Usage_Store_User_Downloaded_File(Folder=None, diction=None):
if diction['type_document']:
type_document = diction['type_document']
metadata_field = ""
if ("metadata_field" in diction.keys()):
if (diction['metadata_field'] and str(diction['metadata_field']) > 500):
metadata_field = diction['metadata_field'][0:500]
elif (diction['metadata_field'] and str(diction['metadata_field']) <= 500):
metadata_field = diction['metadata_field']
document_display_order = ""
if ("document_display_order" in diction.keys()):
if diction['document_display_order']:
@ -305,6 +330,7 @@ def Internal_Usage_Store_User_Downloaded_File(Folder=None, diction=None):
mydata['file_name'] = partial_file_name_without_folder
mydata['full_path'] = Global_file_name
mydata['type_document'] = type_document
mydata['metadata_field'] = metadata_field
mydata['file_extention'] = file_extention
mydata['object_owner_collection'] = object_owner_collection
mydata['object_owner_id'] = object_owner_id
@ -312,6 +338,9 @@ def Internal_Usage_Store_User_Downloaded_File(Folder=None, diction=None):
mydata['partner_owner_recid'] = str(my_partner['recid'])
mydata['valide'] = "1"
mydata['status'] = "0"
mydata['locked'] = "0"
mydata['created_date'] = str(datetime.now())
mydata['created_by'] = str(my_partner['_id'])
ret_val = MYSY_GV.dbname['download_files'].find_one_and_update({'file_business_object': str(file_business_object),
'object_owner_collection':str(object_owner_collection),
@ -648,10 +677,18 @@ def Get_List_object_owner_collection_Stored_Files(diction):
nb_val = 0
for retval in MYSY_GV.dbname['download_files'].find(my_query).sort([("_id", pymongo.DESCENDING), ("document_display_order", pymongo.DESCENDING)]):
ret_file = {}
ret_file['id'] = str(nb_val)
ret_file['_id'] = str(retval['_id'])
ret_file['file_business_object'] = retval['file_business_object']
if ("created_date" in retval.keys()):
ret_file['created_date'] = retval['created_date']
else:
ret_file['created_date'] = "9999-99-99"
if ("file_business_object" in retval.keys()):
ret_file['file_business_object'] = retval['file_business_object']
@ -891,3 +928,273 @@ def Delete_Entity_Stored_Downloaded_File(diction):
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
return False, " Impossible de supprimer les fichier"
"""
Cette fonction permet de recuperer une liste de documents
avec plusieurs filtre
"""
def Get_List_object_owner_collection_Stored_Files_With_Filter(diction):
try:
diction = mycommon.strip_dictionary(diction)
"""
Verification des input acceptés
"""
field_list = ['token', 'filter_object_owner_collection', 'filter_object_owner_id',
'date_create_start_date', 'date_create_end_date', 'filter_type_document',
'filter_nom_client', 'filter_formation_external_code', 'filter_session_code',
'filter_class_external_code']
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",
'''
Une fois qu'on a controlé que toutes les clés mise dans l'API sont correcte. etape precedente,
On controle que les champs obligatoires sont presents dans la liste
'''
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 liste ")
return False, "Tous les champs obligatoires ne sont pas fournis"
"""
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_object_owner_collection = {}
if ("filter_object_owner_collection" in diction.keys() and diction['filter_object_owner_collection']):
filt_object_owner_collection = {'object_owner_collection': str(diction['filter_object_owner_collection'])}
filt_filter_object_owner_id = {}
if ("filter_object_owner_id" in diction.keys() and diction['filter_object_owner_id']):
filt_filter_object_owner_id = {'object_owner_id': str(diction['filter_object_owner_id'])}
filt_type_document = {}
if ("filter_type_document" in diction.keys() and diction['filter_type_document']):
filt_type_document = {'type_document': {'$regex': "^"+str(diction['filter_type_document'])+"$", "$options": 'i'}}
filt_date_create_start_date = ""
if ("date_create_start_date" in diction.keys() and diction['date_create_start_date']):
filt_date_create_start_date = str(diction['date_create_start_date'])[0:10]
local_status = mycommon.CheckisDate(filt_date_create_start_date)
if (local_status is False):
mycommon.myprint(str(
inspect.stack()[0][3]) + " Le filtre : 'date de debut' n'est pas au format jj/mm/aaaa.")
return False, " Le filtre : 'date de debut' n'est pas au format jj/mm/aaaa."
filt_date_create_end_date = ""
if ("date_create_end_date" in diction.keys() and diction['date_create_end_date']):
filt_date_create_end_date = str(diction['date_create_end_date'])[0:10]
local_status = mycommon.CheckisDate(filt_date_create_end_date)
if (local_status is False):
mycommon.myprint(str(
inspect.stack()[0][3]) + " Le filtre : 'date de fin' n'est pas au format jj/mm/aaaa.")
return False, " Le filtre : 'date de fin' n'est pas au format jj/mm/aaaa."
"""
Gestion du filtre code session.
Si ce champs est fourni, voici comment il faut proceder :
1 - aller recuperer l'_id de session concernée (==> session_id)
2 - Dans la collection 'download_files' faire un filtre comme suit :
download_files.object_owner_id = session_id
"""
filt_session_code = {}
Lists_session_id = []
if ("filter_session_code" in diction.keys() and diction['filter_session_code']):
sub_filt_session_code = {'code_session': {'$regex': str(diction['filter_session_code']), "$options": "i"},
'partner_owner_recid': str(my_partner['recid']), 'valide': '1'}
# Recuperation des '_id' des session dont le nom match en regexp
for List_session_Data in MYSY_GV.dbname['session_formation'].find(sub_filt_session_code, {'_id': 1}):
Lists_session_id.append(str(List_session_Data['_id']))
filt_session_code = {'object_owner_id': {'$in': Lists_session_id, }}
"""
Gestion du filtre code formation.
Si ce champs est fourni, voici comment il faut proceder :
1 - aller recuperer l'_id des formations concernées (==> class_id)
2 - Dans la collection 'download_files' faire un filtre comme suit :
download_files.object_owner_id = class_id
"""
filt_class_external_code = {}
Lists_class_id = []
if ("filter_class_external_code" in diction.keys() and diction['filter_class_external_code']):
sub_filt_class_external_code = {'external_code': {'$regex': str(diction['filter_class_external_code']), "$options": "i"},
'partner_owner_recid': str(my_partner['recid']), 'valide': '1', 'locked':'0'}
# Recuperation des '_id' des session dont le nom match en regexp
for List_class_Data in MYSY_GV.dbname['myclass'].find(sub_filt_class_external_code, {'_id': 1}):
Lists_class_id.append(str(List_class_Data['_id']))
filt_class_external_code = {'object_owner_id': {'$in': Lists_class_id, }}
"""
Gestion du filtre nom client.
"""
filt_partner_client_nom = {}
Lists_partner_client_id = []
if ("filter_nom_client" in diction.keys() and diction['filter_nom_client']):
sub_filt_partner_client_nom = {
'nom': {'$regex': str(diction['filter_nom_client']), "$options": "i"},
'partner_recid': str(my_partner['recid']), 'valide': '1', 'locked': '0'}
# Recuperation des '_id' des session dont le nom match en regexp
print(" ## verif sub_filt_partner_client_nom = ", sub_filt_partner_client_nom)
for List_partner_client_Data in MYSY_GV.dbname['partner_client'].find(sub_filt_partner_client_nom, {'_id': 1}):
Lists_partner_client_id.append(str(List_partner_client_Data['_id']))
filt_partner_client_nom = {'object_owner_id': {'$in': Lists_partner_client_id, }}
"""
Construction de la recherche
"""
filt_date_create_start_date_ISODATE = None
filt_date_create_end_date_ISODATE = None
if (filt_date_create_start_date):
filt_date_create_start_date_ISODATE = datetime.strptime(str(filt_date_create_start_date), '%d/%m/%Y')
if (filt_date_create_end_date):
filt_date_create_end_date_ISODATE = datetime.strptime(str(filt_date_create_end_date), '%d/%m/%Y')
filt_date_creation = {}
if(filt_date_create_start_date_ISODATE and filt_date_create_end_date_ISODATE ):
filt_date_creation = { 'created_date': {'$gte': filt_date_create_start_date_ISODATE,
'$lte': filt_date_create_end_date_ISODATE}
}
elif (filt_date_create_start_date_ISODATE ):
filt_date_creation = {'created_date': {'$gte': filt_date_create_start_date_ISODATE,
}
}
elif (filt_date_create_end_date_ISODATE ):
filt_date_creation = {'created_date': {'$lte': filt_date_create_end_date_ISODATE,
}
}
my_query = {'$and': [ filt_object_owner_collection, filt_filter_object_owner_id, filt_date_creation,
filt_type_document, filt_session_code,filt_partner_client_nom,
filt_class_external_code, {'partner_owner_recid': str(my_partner['recid']),
'valide':'1'}]}
print(" ##### myquery = " + str(my_query))
RetObject = []
nb_val = 0
for retval in MYSY_GV.dbname['download_files'].find(my_query).sort(
[("_id", pymongo.DESCENDING), ("document_display_order", pymongo.DESCENDING)]):
ret_file = {}
ret_file['id'] = str(nb_val)
ret_file['_id'] = str(retval['_id'])
ret_file['file_business_object'] = retval['file_business_object']
if ("created_date" in retval.keys()):
ret_file['created_date'] = retval['created_date']
else:
ret_file['created_date'] = "9999-99-99"
if ("file_business_object" in retval.keys()):
ret_file['file_business_object'] = retval['file_business_object']
if ("object_owner_collection" in retval.keys()):
ret_file['object_owner_collection'] = retval['object_owner_collection']
if ("object_owner_id" in retval.keys()):
ret_file['object_owner_id'] = retval['object_owner_id']
if ("file_name" in retval.keys()):
ret_file['file_name'] = retval['file_name']
if ("status" in retval.keys()):
ret_file['status'] = retval['status']
if ("document_display_order" in retval.keys()):
ret_file['document_display_order'] = retval['document_display_order']
if ("full_path" in retval.keys()):
ret_file['full_path'] = retval['full_path']
if ("file_cononical_name" in retval.keys()):
ret_file['file_cononical_name'] = retval['file_cononical_name']
else:
ret_file['file_cononical_name'] = "Anonyme"
if ("type_document" in retval.keys()):
ret_file['type_document'] = retval['type_document']
else:
ret_file['type_document'] = "Autre"
if ("file_extention" in retval.keys()):
ret_file['file_extention'] = retval['file_extention']
else:
ret_file['file_extention'] = "file_extention"
"""
Recuperation du nom du client
"""
client_raison_sociale = ""
client_nom = ""
if ("object_owner_id" in retval.keys() and retval["object_owner_id"]):
partner_client_data = MYSY_GV.dbname['partner_client'].find_one(
{'_id': ObjectId(str(retval["object_owner_id"]))}, {'raison_sociale': 1, 'nom': 1})
if (partner_client_data and "raison_sociale" in partner_client_data.keys()):
client_raison_sociale = partner_client_data['raison_sociale']
if (partner_client_data and "nom" in partner_client_data.keys()):
client_nom = partner_client_data['nom']
ret_file['client_raison_sociale'] = client_raison_sociale
ret_file['client_nom'] = client_nom
RetObject.append(mycommon.JSONEncoder().encode(ret_file))
nb_val = nb_val + 1
#print(" ### Get_List_object_owner_collection_Stored_Files = ", RetObject)
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 récupérer la liste des documents "

15
main.py
View File

@ -6819,6 +6819,21 @@ def Get_object_owner_collection_Stored_Files():
return jsonify(status=status, message=retval)
"""
API de recuperation de la liste des fichiers stock"s dans la collection 'download_files'
avec plusieurs filtres
"""
@app.route('/myclass/api/Get_List_object_owner_collection_Stored_Files_With_Filter/', methods=['POST','GET'])
@crossdomain(origin='*')
def Get_List_object_owner_collection_Stored_Files_With_Filter():
# On recupere le corps (payload) de la requete
payload = mycommon.strip_dictionary (request.form.to_dict())
print(" ### Get_List_object_owner_collection_Stored_Files_With_Filter : payload = ",payload)
status, retval = attached_file_mgt.Get_List_object_owner_collection_Stored_Files_With_Filter(payload)
return jsonify(status=status, message=retval)
"""
API de suppression d'un fichier stocké
"""

View File

@ -1572,7 +1572,7 @@ def UpgradetoPro(diction):
if val not in diction:
mycommon.myprint(
str(inspect.stack()[0][3]) + " - : La valeur '" + val + "' n'est pas presente dans liste ")
return False, "Impossible de créer le partenaire"
return False, "Tous les champs obligatoires ne sont pas fournis"
token = ""
new_diction = {}