Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from run import db
- class UserModel(db.Model):
- __tablename__ = 'users'
- id = db.Column(db.Integer, primary_key = True)
- username = db.Column(db.String(120), unique = True, nullable = False)
- password = db.Column(db.String(120), nullable = False)
- def save_to_db(self):
- db.session.add(self)
- db.session.commit()
Add Comment
Please, Sign In to add comment