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
|
from flask import render_template
|
||||||
import definitions as lib
|
import definitions as lib
|
||||||
from difflib import SequenceMatcher
|
from difflib import SequenceMatcher
|
||||||
@ -31,6 +30,7 @@ def bateau(idbateau):
|
|||||||
dico["date_naissance"] = result["date_naissance"]
|
dico["date_naissance"] = result["date_naissance"]
|
||||||
dico["date_mort"] = result["date_mort"]
|
dico["date_mort"] = result["date_mort"]
|
||||||
dico["Histoire"] = result["histoire"]
|
dico["Histoire"] = result["histoire"]
|
||||||
|
dico["dimensions"] = result["dimension"]
|
||||||
return render_template("bateau.html",**dico)
|
return render_template("bateau.html",**dico)
|
||||||
else:
|
else:
|
||||||
return error()
|
return error()
|
||||||
@ -69,6 +69,7 @@ def sauveteur(idsauveteur):
|
|||||||
dico["prenom"] = result["prenom"]
|
dico["prenom"] = result["prenom"]
|
||||||
dico["date_naissance"] = result["date_naissance"]
|
dico["date_naissance"] = result["date_naissance"]
|
||||||
dico["date_deces"] = result["date_mort"]
|
dico["date_deces"] = result["date_mort"]
|
||||||
|
dico["description"] = result["description"]
|
||||||
print(dico["naissance"])
|
print(dico["naissance"])
|
||||||
print(dico["deces"])
|
print(dico["deces"])
|
||||||
ids = lib.ex_sql(dbname,"SELECT * FROM mission WHERE personal_id=?",(idsauveteur,))
|
ids = lib.ex_sql(dbname,"SELECT * FROM mission WHERE personal_id=?",(idsauveteur,))
|
||||||
@ -85,7 +86,8 @@ def sauveteur(idsauveteur):
|
|||||||
def search(texte):
|
def search(texte):
|
||||||
sauveurs = lib.ex_sql(dbname,"SELECT * FROM sauveteur")
|
sauveurs = lib.ex_sql(dbname,"SELECT * FROM sauveteur")
|
||||||
bateaux = lib.ex_sql(dbname,"SELECT * FROM bateau")
|
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:
|
for i in totals:
|
||||||
i["score"] = 0
|
i["score"] = 0
|
||||||
for key in i.keys():
|
for key in i.keys():
|
||||||
@ -103,9 +105,14 @@ def search(texte):
|
|||||||
r = {}
|
r = {}
|
||||||
if "ship_id" in i.keys():
|
if "ship_id" in i.keys():
|
||||||
r["lien"] = "/bateaux/"+str(i["ship_id"])
|
r["lien"] = "/bateaux/"+str(i["ship_id"])
|
||||||
|
n = "Bateau"
|
||||||
elif "personal_id" in i.keys():
|
elif "personal_id" in i.keys():
|
||||||
r["lien"] = "/sauveteurs/"+str(i["personal_id"])
|
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)
|
results.append(r)
|
||||||
return render_template("searchresults.html",liste=results)
|
return render_template("searchresults.html",liste=results)
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="table_key">Mise en arrêt</td><td>{{date_mort}}</td>
|
<td class="table_key">Mise en arrêt</td><td>{{date_mort}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="table_key">Dimensions</td><td>{{dimensions}}</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -5,11 +5,4 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% include 'header.html' %}
|
{% include 'header.html' %}
|
||||||
<br>
|
|
||||||
<center>
|
|
||||||
<br>
|
|
||||||
<div>
|
|
||||||
<button action="/random">Page au hasard</button>
|
|
||||||
</div>
|
|
||||||
</center>
|
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
Reference in New Issue
Block a user