From 80ec3d23a6a3222281e27d2083d1f47aaf6de785 Mon Sep 17 00:00:00 2001 From: Sunpy Date: Fri, 26 Apr 2019 05:52:27 +0100 Subject: [PATCH] Fetch bills --- routes.py | 3 ++- templates/pages/bills.html | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/routes.py b/routes.py index 1ab3671..2bc81fe 100644 --- a/routes.py +++ b/routes.py @@ -22,7 +22,7 @@ def dashboard(): @glob.app.route("/bills") @flask_login.login_required def bills(): - conn = glob.get_sql_connection() + conn = glob.make_sql_connection() cur = conn.cursor() cur.execute(""" @@ -36,6 +36,7 @@ def bills(): data.append(row) cur.close() + conn.close() return render_template("pages/bills.html", data=data) @glob.app.route("/warranties") diff --git a/templates/pages/bills.html b/templates/pages/bills.html index 5f43645..740d1ff 100644 --- a/templates/pages/bills.html +++ b/templates/pages/bills.html @@ -11,21 +11,22 @@ Payment to Description - Sum - KID - Date Due - Payment status + Sum + KID + Date Due + Payment status {% for row in data %} + {{ row[0] }} {{ row[1] }} {{ row[2] }} {{ row[3] }} {{ row[4] }} - {{ row[5] }} + {% endfor %}