Commit 7a5fa28d authored by Lysander Trischler's avatar Lysander Trischler

Fix weight diagram data SELECT SQL query

parent 19a40beb
......@@ -749,11 +749,13 @@ if __name__ == "__main__":
hourly[day.hour][day.discipline] += day.count
weights = self.db.query("""
SELECT date, grams/1000 AS kg
FROM weights
WHERE username = %s
ORDER BY date
LIMIT 0, 100""", username)
SELECT date, kg
FROM (SELECT date, grams/1000 AS kg
FROM weights
WHERE username = %s
ORDER BY date DESC
LIMIT 0, 100) AS tmp
ORDER BY date ASC""", username)
self.render("user.html",
user=self.application.users[username],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment