logic for list and argument passing is working

This commit is contained in:
2022-04-06 14:54:01 +02:00
parent 10160bceed
commit 02f3a7842a
2 changed files with 6 additions and 4 deletions
+3 -1
View File
@@ -36,7 +36,9 @@ def login():
@app.route("/list/<id>", methods=['GET']) @app.route("/list/<id>", methods=['GET'])
def list(id): def list(id):
return render_template("list.html", id=id) get_user_record = db.user_info.find_one({"uuid": id},{"name": 1})
full_name = get_user_record["name"]
return render_template("list.html", full_name=full_name, id=id)
@app.errorhandler(404) @app.errorhandler(404)
def not_found(error): def not_found(error):
+3 -3
View File
@@ -8,9 +8,9 @@
<div class="container"> <div class="container">
<h2>Welcome to GrocList<h2> <h2>Welcome to GrocList<h2>
<br> <br>
Hello {{ id }} Hello {{ full_name }}
<p>Click <a href="/list/"{{ id }}>List</a> to view shopping list</p> <p>Click <a href="/list/{{ id }}">List</a> to view shopping list</p>
<p>Click <a href="/">here</a> to go home. </p> <p>Click <a href="/">here</a> to logout. </p>
</div> </div>
</body> </body>
<html> <html>