Fix de l'univers

This commit is contained in:
theo@manjaro 2021-12-03 06:52:01 +01:00
parent fd20cd6319
commit 533d62b790

View File

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from flask import render_template
import definitions as lib
from difflib import SequenceMatcher
@ -31,6 +30,7 @@ def bateau(idbateau):
dico["date_naissance"] = result["date_naissance"]
dico["date_mort"] = result["date_mort"]
dico["Histoire"] = result["histoire"]
dico["dimensions"] = result["dimension"]
return render_template("bateau.html",**dico)
else:
return error()
@ -56,7 +56,7 @@ def sauveteur(idsauveteur):
dico["nb_sauvetages"] = 666
dico["nb_sauves"] = 666
dico["naissance"] = "vie"
dico["deces"] = "mort" #<3
dico["deces"] = "mort"
dico["gratifications"] = 1
dico["description"] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at odio cursus, rutrum odio non, dignissim risus. Pellentesque non varius ante. Vivamus scelerisque pulvinar mauris, nec imperdiet ante mattis et."
dico["expeditions"] = []
@ -69,6 +69,7 @@ def sauveteur(idsauveteur):
dico["prenom"] = result["prenom"]
dico["date_naissance"] = result["date_naissance"]
dico["date_deces"] = result["date_mort"]
dico["description"] = result["description"]
print(dico["naissance"])
print(dico["deces"])
ids = lib.ex_sql(dbname,"SELECT * FROM mission WHERE personal_id=?",(idsauveteur,))
@ -87,7 +88,8 @@ def search(texte):
return render_template("chuck.html")
sauveurs = lib.ex_sql(dbname,"SELECT * FROM sauveteur")
bateaux = lib.ex_sql(dbname,"SELECT * FROM bateau")
totals = sauveurs+bateaux
expeditions = lib.ex_sql(dbname,"SELECT * FROM expedition")
totals = sauveurs+bateaux+expeditions
for i in totals:
i["score"] = 0
for key in i.keys():
@ -105,15 +107,18 @@ def search(texte):
r = {}
if "ship_id" in i.keys():
r["lien"] = "/bateaux/"+str(i["ship_id"])
n = "Bateau"
elif "personal_id" in i.keys():
r["lien"] = "/sauveteurs/"+str(i["personal_id"])
r["nom"] = i["nom"]
n = "Sauveteurs"
elif "expedition_id" in i.keys():
r["lien"] = "/expeditions/"+str(i["expedition_id"])
n = "Expeditions"
r["nom"] = i["nom"]+" - "+n
results.append(r)
return render_template("searchresults.html",liste=results)
<<<<<<< HEAD
=======
def suggestion(nom,prenom,mail,article,modif):
lib.ex_sql(dbname,"INSERT INTO suggestion(prenom, nom, mail, nomarticle, suggestion) VALUES (?, ?, ?, ?, ?);",(nom,prenom,mail,article,modif))
>>>>>>> a1f4410335d7d6e3a90df8e4ded6d7fa2478086f