diff --git a/shop.py b/shop.py index a398377..385b8e5 100644 --- a/shop.py +++ b/shop.py @@ -52,8 +52,8 @@ def runQuery(query, data=None): return ret def readFromDB(): - # query = '''select * from SHOPLIST''' - query = '''select SHOPLIST.id, SHOPLIST.item, SHOPLIST.gotten, USERS.username from SHOPLIST inner join USERS on SHOPLIST.user_id = USERS.id''' + # By default load all shopping lists the user is a part of (Most users will only have one so this this fine) + query = '''select SHOPLIST.id, SHOPLIST.item, SHOPLIST.gotten, USERS.username, SHOPLIST.list_id from SHOPLIST inner join USERS on SHOPLIST.user_id = USERS.id inner join USER_META on SHOPLIST.list_id = USER_META.list_id''' return runQuery(query) def insertToDB(data):