summaryrefslogtreecommitdiff
path: root/app/tables
diff options
context:
space:
mode:
authorstilbruch <stilbruch@protonmail.com>2022-04-24 20:20:49 -0500
committerstilbruch <stilbruch@protonmail.com>2022-04-24 20:20:49 -0500
commit34548b1273d1e5a3a8140dd41f23d68e2e742301 (patch)
tree13f84acd64b2d40220a4e4cc883cc200d7d70f66 /app/tables
parent0bcfd4a9a26d66af8a44ff36686b54ad2572d9e1 (diff)
downloadStrengthy-34548b1273d1e5a3a8140dd41f23d68e2e742301.tar.xz
Strengthy-34548b1273d1e5a3a8140dd41f23d68e2e742301.zip
Recent workouts are shown on the homepage
Diffstat (limited to 'app/tables')
-rw-r--r--app/tables/user.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/tables/user.py b/app/tables/user.py
index ddf3702..483e56f 100644
--- a/app/tables/user.py
+++ b/app/tables/user.py
@@ -10,11 +10,14 @@ def get_user(user_id):
class User(db.Model, UserMixin):
__tablename__ = "users"
+
+ # fields
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True, nullable=False)
password = db.Column(db.String(80))
email = db.Column(db.String(120), unique=True, nullable=False)
+ # relationships
workouts = db.relationship("Workout", backref="user", lazy="dynamic")
def __init__(self, username, password, email):