diff options
| author | FivePixels <dylan.bolger00@gmail.com> | 2023-02-19 20:52:42 -0600 |
|---|---|---|
| committer | FivePixels <dylan.bolger00@gmail.com> | 2023-02-19 20:52:42 -0600 |
| commit | 157ddaa68fafb1f8e0bd0d8335517eb402c5988f (patch) | |
| tree | c47f545424b5e7cae811fb5d9448c8399bb9d528 /app/routes | |
| parent | 34988c3d22dd00f5dc7f68ff06ba71d146008257 (diff) | |
| download | Strengthy-main.tar.xz Strengthy-main.zip | |
Add progress page, cleanup timer formattingmain
Diffstat (limited to 'app/routes')
| -rw-r--r-- | app/routes/basic.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/routes/basic.py b/app/routes/basic.py index 584d837..d5d7461 100644 --- a/app/routes/basic.py +++ b/app/routes/basic.py @@ -45,3 +45,18 @@ def home(): return render_template( "home.html", records=records, sets_completed=sets_completed, top3=top3 ) + + +@app.route("/progress", methods=["GET"]) +@login_required +def progress(): + exercises = ( + db.session.query(Exercise) + .join(SetRecord) + .filter(SetRecord.exercise_id == Exercise.id) + .group_by(Exercise.id) + .order_by(db.func.count(SetRecord.id).desc()) + .having(db.func.count(SetRecord.id) > 1) + .all() + ) + return render_template("progress.html", exercises=exercises) |
