Skip to content

Commit

Permalink
Add nullable parameter in database columns
Browse files Browse the repository at this point in the history
  • Loading branch information
lulunac27a committed Oct 22, 2024
1 parent 512444a commit 3723654
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ class User(db.Model): # user class
unique=True, nullable=False) # user id
username = db.Column(db.String(80), unique=True,
nullable=False) # username
xp = db.Column(db.Float, default=0) # user XP
xp_required = db.Column(db.Float, default=1) # user XP required
total_xp = db.Column(db.Float, default=0) # user total XP
level = db.Column(db.Integer, default=1) # user level
xp = db.Column(db.Float, default=0, nullable=False) # user XP
xp_required = db.Column(db.Float, default=1,
nullable=False) # user XP required
total_xp = db.Column(db.Float, default=0, nullable=False) # user total XP
level = db.Column(db.Integer, default=1, nullable=False) # user level

def add_xp(self, amount): # add XP
"""
Expand Down

0 comments on commit 3723654

Please sign in to comment.