08/11/22 - 21H
parent
51e4f94853
commit
c52902e72e
15
class_mgt.py
15
class_mgt.py
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
|
|
|
|
@ -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}
|
||||
]
|
||||
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue