08/11/22 - 21H

master
cherif 2022-11-08 21:49:51 +01:00
parent 51e4f94853
commit c52902e72e
4 changed files with 14 additions and 11 deletions

View File

@ -375,9 +375,11 @@ def add_class(diction):
diction['external_code']) + " sont incorrectes. Le format attendu : " \
"jj/mm/aaaa-jj/mm/aaaa-ville-code_postale-adresse;jj/mm/aaaa-jj/mm/aaaa-ville-code_postale-adresse 2"
#print("### isdate = " + str(tab_date_lieu[0]) + " CM isdate_au = " + str(tab_date_lieu[1]))
if (datetime.strptime(str(tab_date_lieu[0]), '%d/%m/%Y') >= datetime.strptime(
str(tab_date_lieu[1]), '%d/%m/%Y')):
#print("### isdate = '" + str(tab_date_lieu[0]) + "' CM isdate_au = '" + str(tab_date_lieu[1])+"' ")
if (datetime.strptime(str(tab_date_lieu[0]).strip(), '%d/%m/%Y') > datetime.strptime(
str(tab_date_lieu[1]).strip(), '%d/%m/%Y')):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " - la date debut est posterieure à la date de fin pour la formation : " + str(
@ -386,7 +388,7 @@ def add_class(diction):
diction['external_code']) + " "
mytoday = datetime.today().strftime("%d/%m/%Y")
if (datetime.strptime(str(tab_date_lieu[0]), '%d/%m/%Y') < datetime.strptime(str(mytoday),
if (datetime.strptime(str(tab_date_lieu[0]).strip(), '%d/%m/%Y') < datetime.strptime(str(mytoday).strip(),
'%d/%m/%Y')):
mycommon.myprint(
str(inspect.stack()[0][
@ -766,7 +768,8 @@ def update_class(diction):
#print(" ### tmp_dl = "+str(tmp_dl))
if (len(str(tmp_dl)) > 0 and ("-" in tmp_dl)):
# print(" ###### DATE LIEU = "+tmp_dl)
tab_date_lieu = tmp_dl.split('-')
#tab_date_lieu = tmp_dl.split('-')
tab_date_lieu = [x.strip() for x in tmp_dl.split('-')]
if (len(tab_date_lieu) != 5):
return False, "Les Dates et Lieux de la formation " + str(
diction['external_code']) + " sont incorrectes. Le format attendu : " \
@ -792,7 +795,7 @@ def update_class(diction):
#print("### isdate = " + str(tab_date_lieu[0]) + " CM isdate_au = " + str(tab_date_lieu[1]))
if (datetime.strptime(str(tab_date_lieu[0]), '%d/%m/%Y') >= datetime.strptime(str(tab_date_lieu[1]), '%d/%m/%Y')):
if (datetime.strptime(str(tab_date_lieu[0]).strip(), '%d/%m/%Y') > datetime.strptime(str(tab_date_lieu[1]).strip(), '%d/%m/%Y')):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " - la date debut est posterieure à la date de fin pour la formation : " + str(

View File

@ -1,3 +1,3 @@
,index,mots,occurence,moyenne,id_formation,source_field
0,0,sociale,1,0.5,POT_191206,title
1,1,actualite,1,0.5,POT_191206,title
0,0,formation,1,0.5,POT_191236,title
1,1,tuteur,1,0.5,POT_191236,title

1 index mots occurence moyenne id_formation source_field
2 0 0 sociale formation 1 0.5 POT_191206 POT_191236 title
3 1 1 actualite tuteur 1 0.5 POT_191206 POT_191236 title

View File

@ -752,7 +752,7 @@ def ela_recherche_tokens(sentence):
'sum_occurence': {'$sum': '$occurence'}
}
},
{'$sort': {'count_class': -1, 'sum_occurence': -1}},
{'$sort': { 'sum_occurence': -1, 'count_class': -1,}},
{'$limit': MYSY_GV.QUERY_LIMIT_ROW}
]

View File

@ -1,3 +1,3 @@
mots occurence moyenne id_formation source_field
0 sociale 1 0.5 POT_191206 title
1 actualite 1 0.5 POT_191206 title
0 formation 1 0.5 POT_191236 title
1 tuteur 1 0.5 POT_191236 title