Guest User

Untitled

a guest
Nov 21st, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. from run import db
  2.  
  3. class UserModel(db.Model):
  4. __tablename__ = 'users'
  5.  
  6. id = db.Column(db.Integer, primary_key = True)
  7. username = db.Column(db.String(120), unique = True, nullable = False)
  8. password = db.Column(db.String(120), nullable = False)
  9.  
  10. def save_to_db(self):
  11. db.session.add(self)
  12. db.session.commit()
Add Comment
Please, Sign In to add comment