ajout expedition
This commit is contained in:
parent
0c3fe53ef2
commit
55279f99e1
5
app.py
5
app.py
@ -26,6 +26,11 @@ def sauveteur(idsauveteur):
|
|||||||
def bateau(idbateau):
|
def bateau(idbateau):
|
||||||
return pages.bateau(idbateau)
|
return pages.bateau(idbateau)
|
||||||
|
|
||||||
|
@app.route('/expeditions/<int:idexpe>')
|
||||||
|
@app.route('/expedition/<int:idexpe>')
|
||||||
|
def expe(idexpe):
|
||||||
|
return pages.expeditions(idexpe)
|
||||||
|
|
||||||
@app.errorhandler(404)
|
@app.errorhandler(404)
|
||||||
def error(e):
|
def error(e):
|
||||||
return pages.error()
|
return pages.error()
|
||||||
|
12
pages.py
12
pages.py
@ -29,6 +29,18 @@ def bateau(idbateau):
|
|||||||
dico["DateInstallation"] = result["date_naissance"]
|
dico["DateInstallation"] = result["date_naissance"]
|
||||||
dico["DateCondamnation"] = result["date_mort"]
|
dico["DateCondamnation"] = result["date_mort"]
|
||||||
return render_template("sauveteur.html",**dico)
|
return render_template("sauveteur.html",**dico)
|
||||||
|
else:
|
||||||
|
return error()
|
||||||
|
|
||||||
|
def expeditions(idexpedition):
|
||||||
|
dico = {}
|
||||||
|
result = lib.ex_sql(dbname,"SELECT * FROM expedition WHERE expedition_id=?",(idexpedition,))
|
||||||
|
if len(result) >= 1:
|
||||||
|
result = result[0]
|
||||||
|
dico["evenement"] = result["nom"]
|
||||||
|
dico["Date"] = result["date"]
|
||||||
|
print("dico")
|
||||||
|
return render_template("expedition.html",**dico)
|
||||||
else:
|
else:
|
||||||
return error()
|
return error()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user