update 24/03/2022 - 11h30

master
cbalde 2022-03-24 14:01:07 +01:00 committed by cherif
parent 5035c1c26d
commit 267febf45b
3 changed files with 15804 additions and 89527 deletions

File diff suppressed because one or more lines are too long

View File

@ -174,6 +174,9 @@ def add_class(diction):
mydata['indexed_desc'] = '0'
mydata['indexed_obj'] = '0'
# Create internal ref. of class
mydata['internal_code'] = mycommon.Create_internal_call_ref()
coll_name = dbname['myclass']
'''
@ -213,7 +216,9 @@ def update_class(diction):
# field_list.
'''
field_list = ['external_code', 'title', 'description', 'trainer', 'institut_formation', 'distantiel',
'presentiel','price', 'url', 'duree_formation', 'token','plus_produit', 'mots_cle', 'domaine']
'presentiel','price', 'url', 'duree_formation', 'token','plus_produit', 'mots_cle',
'domaine', 'internal_code']
incom_keys = diction.keys()
for val in incom_keys:
if val not in field_list:
@ -261,7 +266,11 @@ def update_class(diction):
return False, " Les informations d'identification sont incorrectes"
partner_recid = user_recid
my_internal_code = ""
if ("internal_code" in diction.keys()):
if diction['internal_code']:
my_internal_code = diction['internal_code']
if ("external_code" in diction.keys()):

View File

@ -12,6 +12,7 @@ import os
import csv
import inspect
import sys
from datetime import datetime
TOKEN_SIZE = 25
CONNECTION_STRING = "mongodb://localhost/cherifdb"
@ -195,7 +196,14 @@ def get_user_recid_from_email(email = ""):
return user_recid
'''
Cette fonction créer la reference interne d'une formation
'''
def Create_internal_call_ref():
retval = None
now = datetime.now()
retval = "Mysy_"+now
return retval
def textdist():
val = textdistance.mra("doe", "dough")