Merge branch 'master' of git.elab.kth.se:davide/KUKapp

master
Davide Bongiovanni 6 years ago
commit 17428dffdf

3
.gitignore vendored

@ -0,0 +1,3 @@
bin/
lib/
*.pyc

@ -28,7 +28,7 @@ def connect(user, password, db, host='localhost', port=5432):
return con, meta return con, meta
def getLeaderboard(): def getLeaderboard():
s = 'select u.username as name, u.score as score, max(m.meal_date) as last_meal from users as u inner join meals as m on u.id = m.kuk where m.kuk>0 and m.status>0 group by u.id order by u.score, last_meal;' s = 'select u.username as name, u.score as score, max(m.meal_date) as last_meal from users as u left join meals as m on m.kuk = u.id group by u.id order by score, last_meal;'
r = db_engine.execute(text(s)) r = db_engine.execute(text(s))
leaders=[] leaders=[]
for row in r: for row in r:

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Loading…
Cancel
Save