01/11/22 - 14h
parent
5c46f45b1a
commit
990f859d20
17
class_mgt.py
17
class_mgt.py
|
@ -46,7 +46,7 @@ def add_class(diction):
|
|||
field_list = ['external_code', 'title', 'description', 'trainer', 'institut_formation', 'distantiel', 'presentiel',
|
||||
'price', 'url','duration', 'duration_unit', 'token', 'plus_produit', 'mots_cle','domaine',
|
||||
'internal_url', 'zone_diffusion', 'metier', 'date_lieu', 'published', 'img_url', 'objectif',
|
||||
'programme', 'prerequis', 'note']
|
||||
'programme', 'prerequis', 'note', 'cpf']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -145,6 +145,10 @@ def add_class(diction):
|
|||
if diction['note']:
|
||||
mydata['note'] = diction['note']
|
||||
|
||||
if ("cpf" in diction.keys()):
|
||||
if diction['cpf']:
|
||||
mydata['cpf'] = diction['cpf']
|
||||
|
||||
if ("objectif" in diction.keys()):
|
||||
if diction['objectif']:
|
||||
mydata['objectif'] = diction['objectif']
|
||||
|
@ -509,7 +513,7 @@ def update_class(diction):
|
|||
field_list = ['external_code', 'title', 'description', 'trainer', 'institut_formation', 'distantiel',
|
||||
'presentiel','price', 'url', 'duration', 'token','plus_produit', 'mots_cle',
|
||||
'domaine', 'internal_code', 'internal_url','zone_diffusion', 'metier',
|
||||
'date_lieu', 'published', 'img_url', 'objectif', 'programme', 'prerequis', 'note']
|
||||
'date_lieu', 'published', 'img_url', 'objectif', 'programme', 'prerequis', 'note', 'cpf']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
@ -583,6 +587,9 @@ def update_class(diction):
|
|||
if ("programme" in diction.keys()):
|
||||
mydata['programme'] = diction['programme']
|
||||
|
||||
if ("cpf" in diction.keys()):
|
||||
mydata['cpf'] = diction['cpf']
|
||||
|
||||
if ("prerequis" in diction.keys()):
|
||||
mydata['prerequis'] = diction['prerequis']
|
||||
|
||||
|
@ -2191,7 +2198,7 @@ def add_class_mass(file=None, Folder=None, diction=None):
|
|||
field_list = ['external_code', 'titre', 'description', 'formateur', 'institut_formation',
|
||||
'distantiel', 'presentiel', 'prix', 'domaine', 'url','duree', 'plus_produit',
|
||||
'mots_cle', 'zone_diffusion', 'metier', 'date_lieu', 'publie', 'img_url',
|
||||
'objectif', 'programme', 'prerequis', 'formateur', 'note']
|
||||
'objectif', 'programme', 'prerequis', 'formateur', 'note', 'cpf']
|
||||
|
||||
total_rows = len(df)
|
||||
|
||||
|
@ -2253,6 +2260,10 @@ def add_class_mass(file=None, Folder=None, diction=None):
|
|||
mydata['metier'] = str(df['metier'].values[n])
|
||||
mydata['published'] = str(df['publie'].values[n])
|
||||
|
||||
if ("cpf" in df.keys()):
|
||||
if (str(df['cpf'].values[n])):
|
||||
mydata['cpf'] = str(df['cpf'].values[n])
|
||||
|
||||
if ("objectif" in df.keys()):
|
||||
if (str(df['objectif'].values[n])):
|
||||
mydata['objectif'] = str(df['objectif'].values[n])
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
,index,mots,occurence,moyenne,id_formation,source_field
|
||||
0,0,effect,1,0.33,VP14120,title
|
||||
1,1,essentiel,1,0.33,VP14120,title
|
||||
2,2,after,1,0.33,VP14120,title
|
||||
0,0,effect,1,0.33,VP10619,title
|
||||
1,1,effet,1,0.33,VP10619,title
|
||||
2,2,after,1,0.33,VP10619,title
|
||||
|
|
|
|
@ -1,4 +1,4 @@
|
|||
mots occurence moyenne id_formation source_field
|
||||
0 effect 1 0.33 VP14120 title
|
||||
1 essentiel 1 0.33 VP14120 title
|
||||
2 after 1 0.33 VP14120 title
|
||||
mots occurence moyenne id_formation source_field
|
||||
0 effect 1 0.33 VP10619 title
|
||||
1 effet 1 0.33 VP10619 title
|
||||
2 after 1 0.33 VP10619 title
|
10
wrapper.py
10
wrapper.py
|
@ -127,7 +127,7 @@ def get_all_class(diction):
|
|||
# Dictionnaire des champs utilisables
|
||||
field_list = ['token', 'user_ip', 'user_country_code', 'user_country_name', 'user_city',
|
||||
'user_postal', 'user_latitude', 'user_longitude', 'user_state', 'search_text', 'certif',
|
||||
'support', 'type', 'lang', 'price', 'distance', 'duration']
|
||||
'support', 'type', 'lang', 'price', 'distance', 'duration', 'cpf']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
|
||||
|
@ -251,7 +251,7 @@ def get_all_class(diction):
|
|||
tab_training_inzone.append(JSONEncoder().encode(user))
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
#print(" insertObject = ", str(tab_training_inzone))
|
||||
#print(" ### insertObject = ", str(tab_training_inzone))
|
||||
#return True, insertObject
|
||||
return True, tab_training_inzone
|
||||
except Exception as e:
|
||||
|
@ -283,7 +283,7 @@ def get_training_in_user_zone(diction):
|
|||
# Dictionnaire des champs utilisables
|
||||
field_list = ['token', 'user_ip', 'user_country_code', 'user_country_name', 'user_city',
|
||||
'user_postal', 'user_latitude', 'user_longitude', 'user_state', 'search_text', 'certif',
|
||||
'support', 'type', 'lang', 'price', 'distance', 'duration']
|
||||
'support', 'type', 'lang', 'price', 'distance', 'duration', 'cpf']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
|
||||
|
@ -339,7 +339,7 @@ def get_training_in_user_zone(diction):
|
|||
insertObject = []
|
||||
|
||||
|
||||
print(" ########## critère de recherche : user_country_code = "+str(mydata['user_country_code']).lower()+" ---- user_city = "+str(mydata['user_city']).lower())
|
||||
#print(" ########## critère de recherche : user_country_code = "+str(mydata['user_country_code']).lower()+" ---- user_city = "+str(mydata['user_city']).lower())
|
||||
for x in coll_name.find({ "$or": [ {'valide':'1', 'locked':'0', 'isalaune':'1','published':'1', "zone_diffusion.country":str(mydata['user_country_code']).lower()},
|
||||
{'valide':'1', 'locked':'0', 'isalaune':'1', 'published':'1', "zone_diffusion.city":str(mydata['user_city']).lower()} ] },
|
||||
{"_id": 0, "indexed": 0, "indexed_desc": 0, "indexed_obj": 0, "indexed_title": 0,
|
||||
|
@ -401,7 +401,7 @@ def recherche_text_simple(diction):
|
|||
'''
|
||||
field_list = ['token', 'user_ip', 'user_country_code', 'user_country_name', 'user_city',
|
||||
'user_postal', 'user_latitude', 'user_longitude', 'user_state', 'search_text', 'certif',
|
||||
'support', 'type', 'lang', 'price', 'distance', 'duration']
|
||||
'support', 'type', 'lang', 'price', 'distance', 'duration', 'cpf']
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list:
|
||||
|
|
Loading…
Reference in New Issue