Updated query to use the USER_META table
This commit is contained in:
parent
a7ca76d1e6
commit
32c0baedaf
4
shop.py
4
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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user