From 01efceca450ba82c3dda886f3ec1a105b1f64a76 Mon Sep 17 00:00:00 2001 From: Benjamyn Love Date: Mon, 10 Feb 2020 18:09:32 +1100 Subject: [PATCH] Better filtering for lists on homepage --- shop.py | 5 ++--- templates/index.html | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/shop.py b/shop.py index f07e735..1b1bfa5 100644 --- a/shop.py +++ b/shop.py @@ -109,11 +109,10 @@ def get_items(user_id, list_id=None): return runQuery(query, data) def get_list_ids(user_id): - query = "select list_id from USER_META where user_id = %s" + query = "select USER_META.list_id, LISTS.name from USER_META inner join LISTS on LISTS.id = USER_META.list_id where USER_META.user_id = %s" data = (user_id,) ret = runQuery(query, data) - list_ids = [idx for idx, in ret] - return list_ids + return ret app = Flask(__name__) app.config["DEBUG"] = True diff --git a/templates/index.html b/templates/index.html index 168924b..df23087 100644 --- a/templates/index.html +++ b/templates/index.html @@ -25,6 +25,9 @@ vpn_key +
+ {{data["list_ids"]}} +