Updated query to use the USER_META table

This commit is contained in:
Benjamyn Love 2020-02-09 03:08:01 +11:00
parent a7ca76d1e6
commit 32c0baedaf

View File

@ -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):