add model user

This commit is contained in:
vanzhiganov 2017-08-27 01:30:22 +03:00
parent 365e0491b2
commit e49dd74a21
2 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1 @@
from .user import User

16
wotstats/models/user.py Normal file
View file

@ -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 '<User id={} email={}>'.format(self.id, self.email)