mattermore/app/models.py

17 lines
457 B
Python
Raw Normal View History

2018-09-24 20:57:36 +02:00
from .app import db
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
2018-09-24 21:26:12 +02:00
username = db.Column(db.String(255), unique=True, nullable=False)
2018-09-24 20:57:36 +02:00
authorized = db.Column(db.Boolean, default=True)
admin = db.Column(db.Boolean, default=False)
def __repr__(self):
return '<User %r>' % self.username
def __init__(self, username, admin=False):
super()
self.username = username
self.admin = admin