28/09/22 - 23h
parent
6be68f0039
commit
25b6c510e6
45
class_mgt.py
45
class_mgt.py
|
@ -44,7 +44,8 @@ def add_class(diction):
|
||||||
'''
|
'''
|
||||||
field_list = ['external_code', 'title', 'description', 'trainer', 'institut_formation', 'distantiel', 'presentiel',
|
field_list = ['external_code', 'title', 'description', 'trainer', 'institut_formation', 'distantiel', 'presentiel',
|
||||||
'price', 'url','duration', 'duration_unit', 'token', 'plus_produit', 'mots_cle','domaine',
|
'price', 'url','duration', 'duration_unit', 'token', 'plus_produit', 'mots_cle','domaine',
|
||||||
'internal_url', 'zone_diffusion', 'metier', 'date_lieu', 'published', 'img_url']
|
'internal_url', 'zone_diffusion', 'metier', 'date_lieu', 'published', 'img_url', 'objectif',
|
||||||
|
'programme', 'prerequis']
|
||||||
|
|
||||||
incom_keys = diction.keys()
|
incom_keys = diction.keys()
|
||||||
for val in incom_keys:
|
for val in incom_keys:
|
||||||
|
@ -139,6 +140,18 @@ def add_class(diction):
|
||||||
if diction['title']:
|
if diction['title']:
|
||||||
mydata['title'] = diction['title']
|
mydata['title'] = diction['title']
|
||||||
|
|
||||||
|
if ("objectif" in diction.keys()):
|
||||||
|
if diction['objectif']:
|
||||||
|
mydata['objectif'] = diction['objectif']
|
||||||
|
|
||||||
|
if ("programme" in diction.keys()):
|
||||||
|
if diction['programme']:
|
||||||
|
mydata['programme'] = diction['programme']
|
||||||
|
|
||||||
|
if ("prerequis" in diction.keys()):
|
||||||
|
if diction['prerequis']:
|
||||||
|
mydata['prerequis'] = diction['prerequis']
|
||||||
|
|
||||||
if ("description" in diction.keys()):
|
if ("description" in diction.keys()):
|
||||||
if diction['description']:
|
if diction['description']:
|
||||||
mydata['description'] = diction['description']
|
mydata['description'] = diction['description']
|
||||||
|
@ -403,7 +416,7 @@ def update_class(diction):
|
||||||
field_list = ['external_code', 'title', 'description', 'trainer', 'institut_formation', 'distantiel',
|
field_list = ['external_code', 'title', 'description', 'trainer', 'institut_formation', 'distantiel',
|
||||||
'presentiel','price', 'url', 'duration', 'token','plus_produit', 'mots_cle',
|
'presentiel','price', 'url', 'duration', 'token','plus_produit', 'mots_cle',
|
||||||
'domaine', 'internal_code', 'internal_url','zone_diffusion', 'metier',
|
'domaine', 'internal_code', 'internal_url','zone_diffusion', 'metier',
|
||||||
'date_lieu', 'published', 'img_url']
|
'date_lieu', 'published', 'img_url', 'objectif', 'programme', 'prerequis']
|
||||||
|
|
||||||
incom_keys = diction.keys()
|
incom_keys = diction.keys()
|
||||||
for val in incom_keys:
|
for val in incom_keys:
|
||||||
|
@ -468,6 +481,15 @@ def update_class(diction):
|
||||||
if ("title" in diction.keys()):
|
if ("title" in diction.keys()):
|
||||||
mydata['title'] = diction['title']
|
mydata['title'] = diction['title']
|
||||||
|
|
||||||
|
if ("objectif" in diction.keys()):
|
||||||
|
mydata['objectif'] = diction['objectif']
|
||||||
|
|
||||||
|
if ("programme" in diction.keys()):
|
||||||
|
mydata['programme'] = diction['programme']
|
||||||
|
|
||||||
|
if ("prerequis" in diction.keys()):
|
||||||
|
mydata['prerequis'] = diction['prerequis']
|
||||||
|
|
||||||
if ("img_url" in diction.keys()):
|
if ("img_url" in diction.keys()):
|
||||||
if diction['img_url']:
|
if diction['img_url']:
|
||||||
# Verifier si l'image existe
|
# Verifier si l'image existe
|
||||||
|
@ -1398,8 +1420,9 @@ def get_class(diction):
|
||||||
for retVal in coll_name.find({'valide':'1','locked':'0','internal_url':internal_url, 'published':'1'},
|
for retVal in coll_name.find({'valide':'1','locked':'0','internal_url':internal_url, 'published':'1'},
|
||||||
{"_id": 0, "indexed": 0, "indexed_desc": 0, "indexed_obj": 0, "indexed_title": 0,
|
{"_id": 0, "indexed": 0, "indexed_desc": 0, "indexed_obj": 0, "indexed_title": 0,
|
||||||
"valide": 0, "locked": 0, "partner_owner_recid": 0, }
|
"valide": 0, "locked": 0, "partner_owner_recid": 0, }
|
||||||
):
|
).limit(1):
|
||||||
|
|
||||||
|
#print('ICI retVal = '+str(retVal))
|
||||||
my_recid = {}
|
my_recid = {}
|
||||||
my_recid['user_rec_id'] = str(user_recid)
|
my_recid['user_rec_id'] = str(user_recid)
|
||||||
mydict_combined = {**diction, **retVal, **my_recid}
|
mydict_combined = {**diction, **retVal, **my_recid}
|
||||||
|
@ -1985,7 +2008,8 @@ def add_class_mass(file=None, Folder=None, diction=None):
|
||||||
'''
|
'''
|
||||||
field_list = ['external_code', 'titre', 'description', 'formateur', 'institut_formation',
|
field_list = ['external_code', 'titre', 'description', 'formateur', 'institut_formation',
|
||||||
'distantiel', 'presentiel', 'prix', 'domaine', 'url','duree', 'plus_produit',
|
'distantiel', 'presentiel', 'prix', 'domaine', 'url','duree', 'plus_produit',
|
||||||
'mots_cle', 'zone_diffusion', 'metier', 'date_lieu', 'publie', 'img_url']
|
'mots_cle', 'zone_diffusion', 'metier', 'date_lieu', 'publie', 'img_url',
|
||||||
|
'objectif', 'programme', 'prerequis']
|
||||||
|
|
||||||
total_rows = len(df)
|
total_rows = len(df)
|
||||||
|
|
||||||
|
@ -2047,6 +2071,19 @@ def add_class_mass(file=None, Folder=None, diction=None):
|
||||||
mydata['metier'] = str(df['metier'].values[n])
|
mydata['metier'] = str(df['metier'].values[n])
|
||||||
mydata['published'] = str(df['publie'].values[n])
|
mydata['published'] = str(df['publie'].values[n])
|
||||||
|
|
||||||
|
if ("objectif" in df.keys()):
|
||||||
|
if (str(df['objectif'].values[n])):
|
||||||
|
mydata['objectif'] = str(df['objectif'].values[n])
|
||||||
|
|
||||||
|
if ("programme" in df.keys()):
|
||||||
|
if (str(df['programme'].values[n])):
|
||||||
|
mydata['programme'] = str(df['programme'].values[n])
|
||||||
|
|
||||||
|
if ("prerequis" in df.keys()):
|
||||||
|
if (str(df['prerequis'].values[n])):
|
||||||
|
mydata['prerequis'] = str(df['prerequis'].values[n])
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
Verification de l'image
|
Verification de l'image
|
||||||
'''
|
'''
|
||||||
|
|
Loading…
Reference in New Issue