Merge branch 'master' of https://forge.chapril.org/CretinsMotorisesIngenieux/Marin
This commit is contained in:
commit
b518224831
BIN
definitions.pyc
BIN
definitions.pyc
Binary file not shown.
13
pages.py
13
pages.py
@ -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()
|
||||
@ -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,))
|
||||
@ -85,7 +86,8 @@ def sauveteur(idsauveteur):
|
||||
def search(texte):
|
||||
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():
|
||||
@ -103,9 +105,14 @@ 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)
|
||||
|
@ -28,6 +28,9 @@
|
||||
<tr>
|
||||
<td class="table_key">Mise en arrêt</td><td>{{date_mort}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="table_key">Dimensions</td><td>{{dimensions}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
</div>
|
||||
|
@ -5,11 +5,4 @@
|
||||
</head>
|
||||
<body>
|
||||
{% include 'header.html' %}
|
||||
<br>
|
||||
<center>
|
||||
<br>
|
||||
<div>
|
||||
<button action="/random">Page au hasard</button>
|
||||
</div>
|
||||
</center>
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user