fini
This commit is contained in:
parent
b518224831
commit
1bd58c5886
27
pages.py
27
pages.py
@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from flask import render_template
|
||||
import definitions as lib
|
||||
from difflib import SequenceMatcher
|
||||
@ -30,7 +31,6 @@ 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()
|
||||
@ -69,7 +69,6 @@ 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,))
|
||||
@ -84,10 +83,11 @@ def sauveteur(idsauveteur):
|
||||
return error()
|
||||
|
||||
def search(texte):
|
||||
if texte.lower() == "chuck norris" :
|
||||
return render_template("chuck.html")
|
||||
sauveurs = lib.ex_sql(dbname,"SELECT * FROM sauveteur")
|
||||
bateaux = lib.ex_sql(dbname,"SELECT * FROM bateau")
|
||||
expeditions = lib.ex_sql(dbname,"SELECT * FROM expedition")
|
||||
totals = sauveurs+bateaux+expeditions
|
||||
totals = sauveurs+bateaux
|
||||
for i in totals:
|
||||
i["score"] = 0
|
||||
for key in i.keys():
|
||||
@ -105,27 +105,10 @@ 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"])
|
||||
n = "Sauveteurs"
|
||||
elif "expedition_id" in i.keys():
|
||||
r["lien"] = "/expeditions/"+str(i["expedition_id"])
|
||||
n = "Expeditions"
|
||||
r["nom"] = i["nom"]+" - "+n
|
||||
r["nom"] = i["nom"]
|
||||
|
||||
results.append(r)
|
||||
return render_template("searchresults.html",liste=results)
|
||||
|
||||
def bateau(idsecret):
|
||||
dico = {}
|
||||
dico["Message"] = "messi"
|
||||
|
||||
result = lib.ex_sql(dbname,"SELECT * from secret",(idsecret,))
|
||||
if len(result)>=1:
|
||||
result = result[0]
|
||||
dico["Message"] = result["Message"]
|
||||
|
||||
return render_template("chuck.html",**dico)
|
||||
else:
|
||||
return error()
|
BIN
site.db-journal
Normal file
BIN
site.db-journal
Normal file
Binary file not shown.
13
templates/chuck.html
Normal file
13
templates/chuck.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<title>Chuck Norris - Sauveteurs du Dunkerquois</title>
|
||||
{% include 'head.html' %}
|
||||
</head>
|
||||
<body>
|
||||
{% include "smallheader.html" %}
|
||||
<h1>Chuck Norris</h1>
|
||||
<div class="flexbox">
|
||||
<p>Vous ne pouvez pas trouver Chuck Norris, c'est lui qui vous trouve.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user