Initial commit

This commit is contained in:
openSIRP
2022-09-07 17:12:49 +02:00
commit b19a1150ec
14 changed files with 506 additions and 0 deletions

16
Models/User.py Normal file
View File

@@ -0,0 +1,16 @@
from app import db, ma
from werkzeug.security import check_password_hash
class User(db.Model):
__tablename__ = "user"
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50))
email = db.Column(db.String(255))
password = db.Column(db.String(255))
def __repr__(self):
return '<User %s>' % self.name
def check_password(self, password):
return check_password_hash(self.password, password)