2022-01-05 13:42:24 +01:00
|
|
|
from app import db
|
|
|
|
from flask_login import UserMixin
|
|
|
|
|
|
|
|
|
|
|
|
class User(UserMixin, db.Model):
|
|
|
|
"""User model class for a user in distribusi-verse"""
|
|
|
|
|
|
|
|
__tablename__ = "users"
|
|
|
|
|
|
|
|
id = db.Column(db.Integer, primary_key=True)
|
2022-03-18 14:58:30 +01:00
|
|
|
username = db.Column(db.String(150), unique=True, nullable=False)
|
2022-01-05 13:42:24 +01:00
|
|
|
email = db.Column(db.String(150), unique=True, nullable=False)
|
2022-01-05 19:36:18 +01:00
|
|
|
password = db.Column(db.String(300), nullable=False, unique=False)
|
2022-02-18 12:41:20 +01:00
|
|
|
currentdistribusi = db.Column(db.String(300), nullable=True, unique=False)
|
2022-03-27 16:07:44 +02:00
|
|
|
resethash = db.Column(db.String(300), nullable=True, unique=True)
|
|
|
|
resettime = db.Column(db.DateTime)
|
2022-04-01 16:00:43 +02:00
|
|
|
#active = db.Column(db.Boolean, default=False)
|
2022-03-20 10:46:23 +01:00
|
|
|
tutor = db.Column(db.Boolean, default=False)
|
|
|
|
admin = db.Column(db.Boolean, default=False)
|
|
|
|
|
2022-01-05 13:42:24 +01:00
|
|
|
def __repr__(self):
|
2022-01-07 16:55:40 +01:00
|
|
|
return "<User %r>" % self.email
|