Пример #1
0
class examiner(db.Model):
    ex_id = db.Column('ex_id', db.Integer, primary_key=True)
    ex_name = db.Column('ex_name', db.String(20), nullable=False)

    students = db.relationship('student', backref='examiner', lazy=True)

    def __repr__(self):
        return f"examiner('{self.ex_id}', '{self.ex_name}')"
Пример #2
0
class User(db.Model, UserMixin):
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(20), unique=True, nullable=False)
    email = db.Column(db.String(120), unique=True, nullable=False)
    image_file = db.Column(db.String(20), nullable=False, default='default.jpg')
    password = db.Column(db.String(60), nullable=False)
    posts = db.relationship('Post', backref='author', lazy=True)

    def __repr__(self):
        return f"User('{self.username}', '{self.email}', '{self.image_file}')"
Пример #3
0
class coordinator(db.Model):
    cd_id = db.Column('cd_id', db.Integer, primary_key=True)
    cd_name = db.Column('cd_name', db.String(20), nullable=False)
    cd_dept = db.Column('cd_dept', db.String(3), nullable=False)
    cd_phone = db.Column('cd_phone', db.String(12), unique=True)
    cd_email = db.Column('cd_email',
                         db.String(20),
                         unique=True,
                         nullable=False)

    projects = db.relationship('fyp', backref='coordinator', lazy=True)

    def __repr__(self):
        return f"fyp('{self.cd_id}', '{self.cd_email}')"
Пример #4
0
class supervisor(db.Model):
    sv_id = db.Column('sv_id', db.Integer, primary_key=True)
    sv_name = db.Column('sv_name', db.String(20), nullable=False)
    sv_niche = db.Column('sv_niche', db.String(20))
    sv_phone = db.Column('sv_phone', db.String(12), unique=True)
    sv_email = db.Column('sv_email',
                         db.String(20),
                         unique=True,
                         nullable=False)
    sv_dept = db.Column('sv_dept', db.String(3), nullable=False)
    students = db.relationship('student', backref='supervisor', lazy=True)

    def __repr__(self):
        return f"supervisor('{self.sv_id}', '{self.sv_email}')"
Пример #5
0
class schedule(db.Model):
    schedule_id = db.Column('schedule_id', db.Integer, primary_key=True)
    schedule_dept = db.Column('schedule_dept', db.String(3))
    schedule_class_date = db.Column('schedule_date',
                                    db.DateTime,
                                    default=datetime.utcnow)
    schedule_milestone = db.Column('schedule_milestone',
                                   db.DateTime,
                                   default=datetime.utcnow)

    projects = db.relationship('fyp', backref='schedule', lazy=True)

    def __repr__(self):
        return f"schedule('{self.schedule_id}', '{self.schedule_dept}', '{self.schedule_date}', '{self.schedule_milestone}')"
Пример #6
0
class fyp(db.Model):
    proj_id = db.Column('proj_id', db.String(4), primary_key=True)
    proj_title = db.Column('proj_title', db.String(50))
    proj_type = db.Column('proj_type', db.String(11))
    proj_level = db.Column('proj_level', db.String(4))

    cd_id = db.Column('cd_id',
                      db.Integer,
                      db.ForeignKey('coordinator.cd_id'),
                      nullable=False)

    students = db.relationship('student', backref='fyp', lazy=True)

    def __repr__(self):
        return f"fyp('{self.proj_id}', '{self.proj_title}')"