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):
|
||||
return pages.bateau(idbateau)
|
||||
|
||||
@app.route('/expeditions/<int:idexpe>')
|
||||
@app.route('/expedition/<int:idexpe>')
|
||||
def expe(idexpe):
|
||||
return pages.expeditions(idexpe)
|
||||
|
||||
@app.errorhandler(404)
|
||||
def error(e):
|
||||
return pages.error()
|
||||
|
12
pages.py
12
pages.py
@ -32,6 +32,18 @@ def bateau(idbateau):
|
||||
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:
|
||||
return error()
|
||||
|
||||
def sauveteur(idsauveteur):
|
||||
dico = {}
|
||||
dico["nom"] = "John"
|
||||
|
Loading…
Reference in New Issue
Block a user