summaryrefslogtreecommitdiff
path: root/app/tables/user.py
diff options
context:
space:
mode:
authorstilbruch <stilbruch@protonmail.com>2022-04-06 13:50:32 -0500
committerstilbruch <stilbruch@protonmail.com>2022-04-06 13:50:32 -0500
commit45bf2ad8707b67b2f756c80edb877a6bfe3897fb (patch)
tree4ebbb8eea62af889c940e561b75c4175e6d75965 /app/tables/user.py
parentd0c2bb02d91382d99d72ce5e80b321a53a80e576 (diff)
downloadStrengthy-45bf2ad8707b67b2f756c80edb877a6bfe3897fb.tar.xz
Strengthy-45bf2ad8707b67b2f756c80edb877a6bfe3897fb.zip
Workout table and user relationship works
Diffstat (limited to 'app/tables/user.py')
-rw-r--r--app/tables/user.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/tables/user.py b/app/tables/user.py
index d384fdb..cfffb80 100644
--- a/app/tables/user.py
+++ b/app/tables/user.py
@@ -13,6 +13,8 @@ class User(db.Model, UserMixin):
password = db.Column(db.String(80))
email = db.Column(db.String(120), unique=True, nullable=False)
+ workouts = db.relationship("Workout", backref='user', lazy='dynamic')
+
def __init__(self, username, password, email):
self.username = username
self.password = generate_password_hash(password)