add model user
This commit is contained in:
parent
365e0491b2
commit
e49dd74a21
2 changed files with 17 additions and 0 deletions
1
wotstats/models/__init__.py
Normal file
1
wotstats/models/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
from .user import User
|
16
wotstats/models/user.py
Normal file
16
wotstats/models/user.py
Normal 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)
|
Reference in a new issue