This commit is contained in:
2019-11-14 11:03:19 +01:00
commit 855727cb0d
32 changed files with 1108 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
from sqlalchemy import func
from project import db
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
username = db.Column(db.String, nullable=False)
email = db.Column(db.String, nullable=False)
active = db.Column(db.Boolean, default=True, nullable=False)
created_date = db.Column(db.DateTime, default=func.now(), nullable=False)
def to_json(self):
return {
'id': self.id,
'username': self.username,
'email': self.email,
'active': self.active,
}