1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-11-08 21:21:06 +00:00

Add done to models

This commit is contained in:
Mo 2022-09-16 20:02:55 +02:00
parent b02a6683f7
commit 28e80c27fa

View file

@ -515,6 +515,8 @@ class Semester(db.Model):
id = db.Column(db.Integer, primary_key=True) id = db.Column(db.Integer, primary_key=True)
label = db.Column(db.String(10), db.CheckConstraint("label IN ('WS', 'SS')"), nullable=False) label = db.Column(db.String(10), db.CheckConstraint("label IN ('WS', 'SS')"), nullable=False)
year = db.Column(db.Integer, db.CheckConstraint(f"year BETWEEN {MIN_YEAR} AND {MAX_YEAR}"), nullable=False) year = db.Column(db.Integer, db.CheckConstraint(f"year BETWEEN {MIN_YEAR} AND {MAX_YEAR}"), nullable=False)
# Assistants can not work in semesters that are done
done = db.Column(db.Boolean, default=False, nullable=False)
parts = db.relationship("Part", back_populates="semester", lazy=True) parts = db.relationship("Part", back_populates="semester", lazy=True)
semester_experiments = db.relationship("SemesterExperiment", back_populates="semester", lazy=True) semester_experiments = db.relationship("SemesterExperiment", back_populates="semester", lazy=True)