summaryrefslogtreecommitdiff
path: root/app/tables/workout.py
diff options
context:
space:
mode:
authorstilbruch <stilbruch@protonmail.com>2022-04-30 12:56:15 -0500
committerstilbruch <stilbruch@protonmail.com>2022-04-30 12:56:15 -0500
commit11ca7472f0736ed7f7cc4447f8fa59cd8765eb2f (patch)
tree0d8a360753d97077171d087fac131b5e50c6906b /app/tables/workout.py
parent509a7bd8955138b2ff864dd75059d397b3fbb31e (diff)
downloadStrengthy-11ca7472f0736ed7f7cc4447f8fa59cd8765eb2f.tar.xz
Strengthy-11ca7472f0736ed7f7cc4447f8fa59cd8765eb2f.zip
Start workout history page
Diffstat (limited to 'app/tables/workout.py')
-rw-r--r--app/tables/workout.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/tables/workout.py b/app/tables/workout.py
index cc8478e..bdb200e 100644
--- a/app/tables/workout.py
+++ b/app/tables/workout.py
@@ -1,4 +1,5 @@
from app import db, login_manager
+from flask_login import current_user
import enum
@@ -84,6 +85,7 @@ class WorkoutRecord(db.Model):
finished = db.Column(db.DateTime)
# foreign keys
+ user_id = db.Column(db.Integer, db.ForeignKey("users.id"))
workout_id = db.Column(db.Integer, db.ForeignKey("workouts.id"))
# relationships
@@ -92,3 +94,4 @@ class WorkoutRecord(db.Model):
def __init__(self, workout, finished):
self.workout = workout
self.finished = finished
+ self.user = current_user