Better filtering for lists on homepage

This commit is contained in:
Benjamyn Love 2020-02-10 18:09:32 +11:00
parent 2811a784cc
commit 01efceca45
2 changed files with 5 additions and 3 deletions

View File

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

View File

@ -25,6 +25,9 @@
vpn_key
</i></button></a>
</div>
<div>
{{data["list_ids"]}}
</div>
</div>
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>