2022-02-13 21:49:07 +01:00
|
|
|
from app import db
|
|
|
|
|
|
|
|
|
|
|
|
class Distribusis(db.Model):
|
|
|
|
"""distribusi model class for a single distribusi in distribusi-verse"""
|
|
|
|
|
|
|
|
__tablename__ = "distribusis"
|
|
|
|
|
|
|
|
id = db.Column(db.Integer, primary_key=True)
|
2022-02-13 23:06:16 +01:00
|
|
|
distribusiname = db.Column(db.String(300), nullable=True, unique=True)
|
2022-02-13 21:49:07 +01:00
|
|
|
userid = db.Column(db.Integer, db.ForeignKey("users.id"))
|
2022-02-18 14:47:37 +01:00
|
|
|
term = db.Column(db.String(5), nullable=False, unique=False)
|
2022-02-18 12:41:20 +01:00
|
|
|
course = db.Column(db.String(500), nullable=True, unique=False)
|
2022-02-18 14:47:37 +01:00
|
|
|
|
2022-02-13 21:49:07 +01:00
|
|
|
# Academic year eg:2020-2021, so no need for a Datetime object
|
|
|
|
year = db.Column(db.String(9), nullable=True, unique=False)
|
|
|
|
tags = db.Column(db.String(500), nullable=True, unique=False)
|
2022-02-18 14:47:37 +01:00
|
|
|
visible = db.Column(db.Boolean, default=False)
|
2022-02-13 21:49:07 +01:00
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
return "<Distribusi %r>" % self.distribusiname
|