summaryrefslogtreecommitdiff
path: root/app/tables
diff options
context:
space:
mode:
authorstilbruch <stilbruch@protonmail.com>2022-05-09 00:25:31 -0500
committerstilbruch <stilbruch@protonmail.com>2022-05-09 00:25:31 -0500
commit0cce988f119b80fd69b9a415c9e9b983325a12af (patch)
treea1ff33b817b28fc64065cc3396a42750f6ef9a45 /app/tables
parent3fd02681d178298551b0f8f3bba93964be30d4ca (diff)
downloadStrengthy-0cce988f119b80fd69b9a415c9e9b983325a12af.tar.xz
Strengthy-0cce988f119b80fd69b9a415c9e9b983325a12af.zip
Improve history page
Diffstat (limited to 'app/tables')
-rw-r--r--app/tables/workout.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/tables/workout.py b/app/tables/workout.py
index bdb200e..ff9208c 100644
--- a/app/tables/workout.py
+++ b/app/tables/workout.py
@@ -75,6 +75,10 @@ class SetRecord(db.Model):
# relationships
exercise = db.relationship("Exercise")
+ # Calculates using https://www.athlegan.com/calculate-1rm
+ def one_rep_max(self):
+ return int(self.lbs / (1.0278 - (0.0278 * self.reps)))
+
# Represents a recording of a workout
class WorkoutRecord(db.Model):
@@ -95,3 +99,6 @@ class WorkoutRecord(db.Model):
self.workout = workout
self.finished = finished
self.user = current_user
+
+ def finished_nice(self, fmt="%m/%d/%y %-I:%M %p"):
+ return self.finished.strftime(fmt)