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.
21 lines
751 B
21 lines
751 B
3 years ago
|
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)
|
||
|
distribusiname = db.Column(db.String(300), nullable=True, unique=True)
|
||
|
userid = db.Column(db.Integer, db.ForeignKey("users.id"))
|
||
|
term = db.Column(db.Integer, nullable=False, unique=False)
|
||
|
|
||
|
# 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)
|
||
|
visible = db.Column(db.Boolean, server_default="false")
|
||
|
|
||
|
def __repr__(self):
|
||
|
return "<Distribusi %r>" % self.distribusiname
|