diff --git a/wotstats/models/__init__.py b/wotstats/models/__init__.py new file mode 100644 index 0000000..ee4c00b --- /dev/null +++ b/wotstats/models/__init__.py @@ -0,0 +1 @@ +from .user import User diff --git a/wotstats/models/user.py b/wotstats/models/user.py new file mode 100644 index 0000000..23c8d3f --- /dev/null +++ b/wotstats/models/user.py @@ -0,0 +1,16 @@ +from wotstats.database import db + + +class User(db.Model): + id = db.Column(db.Integer, primary_key=True) + # 0 Inaactive, 1 Active, 2 Blocked + status = db.Column(db.Integer, default=0, nullable=False) + email = db.Column(db.String(256), unique=True, nullable=False) + password = db.Column(db.String(32), nullable=False) + openid = db.Column(db.String(256), unique=True, nullable=True) + + def __init__(self, email): + self.password = email + + def __repr__(self): + return ''.format(self.id, self.email)