diff options
| author | stilbruch <stilbruch@protonmail.com> | 2022-04-06 13:50:32 -0500 |
|---|---|---|
| committer | stilbruch <stilbruch@protonmail.com> | 2022-04-06 13:50:32 -0500 |
| commit | 45bf2ad8707b67b2f756c80edb877a6bfe3897fb (patch) | |
| tree | 4ebbb8eea62af889c940e561b75c4175e6d75965 /app/tables/user.py | |
| parent | d0c2bb02d91382d99d72ce5e80b321a53a80e576 (diff) | |
| download | Strengthy-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.py | 2 |
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) |
