X-Git-Url: https://git.immae.eu/?p=perso%2FDenise%2Foms.git;a=blobdiff_plain;f=gestion_donnees.py;h=880614de16c1235cd1aba63b6365200202df1e1b;hp=3523e7e25f908edd8433e1645e2718d038072e0c;hb=b5ac625bdf312851ad3d7acf5dfdc5a94fcbf0be;hpb=d5687a7f2b929f28bb8fc2de503812ec3b27cd9e diff --git a/gestion_donnees.py b/gestion_donnees.py index 3523e7e..880614d 100644 --- a/gestion_donnees.py +++ b/gestion_donnees.py @@ -21,6 +21,7 @@ def convertit_jours_vers_python(chaine,liste_err): Si un des caractères n'est ni un nombre, ni une lettre "autorisée" ni une espace, on affiche un warning et on ignore ce caractère """ +# debug("conversion de "+chaine+" vers un nb de jours",liste_err) chainenombre = "" agejours = 0. for lettre in chaine: @@ -52,6 +53,7 @@ def convertit_jours_vers_python(chaine,liste_err): if agejours<0: warning("L'âge est négatif !",liste_err) agejours = 0 +# debug("On a convertit ! Résultat : "+str(agejours),liste_err) return agejours # python -> json @@ -209,6 +211,12 @@ def gere_configuration(data,liste_err): naissance = convertit_date_vers_python(naissance,liste_err) configuration["naissance"] = naissance + prematurite = data.get("prematurite","") + j = convertit_jours_vers_python(prematurite,liste_err) + configuration["prematurite"] = convertit_age_vers_texte(j) + + configuration["agecorrige"] = gere_checkbox(data.get("agecorrige","")) + # Type de courbe. Au pire on met P tyc = data.get("typecourbe","") if not (tyc in ["P","Z"]): @@ -383,7 +391,7 @@ def fusionne_donnees(listes_jours,listes_donnees): if lj[cle_mini]== []: cle_mini = cle elif lj[cle] != []: - if convertit_jours_vers_python(lj[cle][0],[])