Marin/pages.py

26 lines
876 B
Python

from flask import render_template
import definitions as lib
dbname = "site.db"
# Fonctions qui seront associées à des URLs
def main():
return render_template("index.html")
def error():
return render_template("error.html")
def sauveteur(idsauveteur):
dico = {}
dico["nom"] = "John"
dico["prenom"] = "Doe"
dico["nb_sauvetages"] = 666
dico["nb_sauves"] = 666
dico["gratifications"] = 1
dico["description"] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at odio cursus, rutrum odio non, dignissim risus. Pellentesque non varius ante. Vivamus scelerisque pulvinar mauris, nec imperdiet ante mattis et."
result = lib.ex_sql(dbname,"SELECT * FROM sauveteur WHERE personal_id=?",(idsauveteur,))[0]
dico["nom"] = result["nom"]
dico["prenom"] = result["prenom"]
return render_template("sauveteur.html",**dico)