2022-10-26 10:33:35 +02:00
|
|
|
from ..dependencies import db
|
|
|
|
from ..base.models import Base
|
|
|
|
|
|
|
|
|
|
|
|
class ExaminationSchedule(Base):
|
|
|
|
__tablename__ = 'examination_schedules'
|
|
|
|
|
|
|
|
title = db.Column(db.String(100), unique=True, nullable=False)
|
2022-11-16 20:42:40 +01:00
|
|
|
duration_time = db.Column(db.Integer) # in minutes
|
2022-11-12 16:18:07 +01:00
|
|
|
start_date_for_enrollment_students = db.Column(db.DateTime)
|
|
|
|
end_date_for_enrollment_students = db.Column(db.DateTime)
|
|
|
|
start_date = db.Column(db.DateTime, nullable=False)
|
|
|
|
end_date = db.Column(db.DateTime, nullable=False)
|
|
|
|
year_group_id = db.Column(db.Integer, db.ForeignKey('year_groups.id'), nullable=False)
|
|
|
|
year_group = db.relationship('YearGroup', backref='examination_schedules')
|
|
|
|
|
2022-10-26 10:33:35 +02:00
|
|
|
|
2022-11-12 16:18:07 +01:00
|
|
|
committee = db.Table(
|
|
|
|
"committees",
|
|
|
|
db.Column("term_of_defence_id", db.ForeignKey("term_of_defences.id")),
|
|
|
|
db.Column("project_supervisor_id", db.ForeignKey("project_supervisors.id")),
|
|
|
|
)
|
2022-10-26 10:33:35 +02:00
|
|
|
|
2022-11-12 16:18:07 +01:00
|
|
|
|
|
|
|
class TermOfDefence(Base):
|
|
|
|
__tablename__ = 'term_of_defences'
|
2022-10-26 10:33:35 +02:00
|
|
|
|
|
|
|
start_date = db.Column(db.DateTime, nullable=False)
|
|
|
|
end_date = db.Column(db.DateTime, nullable=False)
|
|
|
|
examination_schedule_id = db.Column(db.Integer, db.ForeignKey('examination_schedules.id'))
|
2022-11-12 16:18:07 +01:00
|
|
|
examination_schedule = db.relationship('ExaminationSchedule', backref='term_of_defences')
|
2022-10-26 10:33:35 +02:00
|
|
|
group_id = db.Column(db.Integer, db.ForeignKey('groups.id'))
|
2022-11-12 16:18:07 +01:00
|
|
|
group = db.relationship("Group", uselist=False, backref='term_of_defence')
|
|
|
|
members_of_committee = db.relationship("ProjectSupervisor", secondary=committee)
|
2022-10-26 10:33:35 +02:00
|
|
|
|
|
|
|
|
2022-11-12 16:18:07 +01:00
|
|
|
class TemporaryAvailability(Base):
|
|
|
|
__tablename__ = 'temporary_availabilities'
|
2022-10-26 10:33:35 +02:00
|
|
|
|
2022-11-12 16:18:07 +01:00
|
|
|
start_date = db.Column(db.DateTime, nullable=False)
|
|
|
|
end_date = db.Column(db.DateTime, nullable=False)
|
|
|
|
examination_schedule_id = db.Column(db.Integer, db.ForeignKey('examination_schedules.id'), nullable=False)
|
|
|
|
examination_schedule = db.relationship("ExaminationSchedule", backref='temporary_availabilities')
|
|
|
|
project_supervisor_id = db.Column(db.Integer, db.ForeignKey('project_supervisors.id'), nullable=False)
|
|
|
|
project_supervisor = db.relationship("ProjectSupervisor", backref='temporary_availabilities')
|