You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
837 B
24 lines
837 B
7 months ago
|
from flask_login import UserMixin
|
||
|
|
||
|
from app import db
|
||
|
|
||
|
|
||
|
class User(UserMixin, db.Model):
|
||
|
"""User model class for a user in distribusi-verse"""
|
||
|
|
||
|
__tablename__ = "users"
|
||
|
|
||
|
id = db.Column(db.Integer, primary_key=True)
|
||
|
username = db.Column(db.String(150), unique=True, nullable=False)
|
||
|
email = db.Column(db.String(150), unique=True, nullable=False)
|
||
|
password = db.Column(db.String(300), nullable=False, unique=False)
|
||
|
currentdistribusi = db.Column(db.String(300), nullable=True, unique=False)
|
||
|
resethash = db.Column(db.String(300), nullable=True, unique=True)
|
||
|
resettime = db.Column(db.DateTime)
|
||
|
# active = db.Column(db.Boolean, default=False)
|
||
|
tutor = db.Column(db.Boolean, default=False)
|
||
|
admin = db.Column(db.Boolean, default=False)
|
||
|
|
||
|
def __repr__(self):
|
||
|
return "<User %r>" % self.email
|