Formulaire de suggestion fonctionnel

This commit is contained in:
theo@manjaro 2021-12-03 06:42:13 +01:00
parent d4174e3ed0
commit ac29bde193
3 changed files with 17 additions and 5 deletions

19
app.py
View File

@ -25,12 +25,21 @@ def sauveteur(idsauveteur):
def bateau(idbateau):
return pages.bateau(idbateau)
@app.route('/modifications')
@app.route('/modifications/')
@app.route('/modification')
@app.route('/modification/')
@app.route('/modifications', methods=['GET', 'POST'])
@app.route('/modifications/', methods=['GET', 'POST'])
@app.route('/modification', methods=['GET', 'POST'])
@app.route('/modification/', methods=['GET', 'POST'])
def modifs():
return pages.modifs()
if request.method == 'POST':
nom = request.form["nom"]
prenom = request.form["prenom"]
mail = request.form["email"]
article = request.form["article"]
modif = request.form["modif"]
pages.suggestion(nom,prenom,mail,article,modif)
return pages.main()
else:
return pages.modifs()
@app.route('/expeditions/<int:idexpe>')
@app.route('/expedition/<int:idexpe>')

View File

@ -116,3 +116,6 @@ def search(texte):
results.append(r)
return render_template("searchresults.html",liste=results)
def suggestion(nom,prenom,mail,article,modif):
lib.ex_sql(dbname,"INSERT INTO suggestion(prenom, nom, mail, nomarticle, suggestion) VALUES (?, ?, ?, ?, ?);",(nom,prenom,mail,article,modif))

BIN
site.db

Binary file not shown.