コード例 #1
0
class Pre2019(db.Model):
    __tablename__ = 'pre2019'
    __table_args__ = (db.Index(
        '2019pre_2019pre_coursecode_2019pre_coursetype_2019pre_dpt_uindex',
        'pre2019coursecode', 'pre2019coursetype', 'pre2019dpt'), )

    pre2019coursecode = db.Column(db.ForeignKey('course.course_code'),
                                  nullable=False)
    pre2019score = db.Column(db.Float, nullable=False)
    pre2019labscore = db.Column(db.Float, nullable=False)
    pre2019coursetype = db.Column(db.String(10), nullable=False)
    pre2019courseneed = db.Column(db.String(90), nullable=False)
    pre2019bigdpt = db.Column(db.String(10), nullable=False)
    pre2019dpt = db.Column(db.ForeignKey('dptdet.dptdet_index'),
                           nullable=False,
                           index=True)
    pre2019season = db.Column(db.String(10), nullable=False)
    pre2019index = db.Column(db.Integer, primary_key=True)

    course = db.relationship(
        'Course',
        primaryjoin='Pre2019.pre2019coursecode == Course.course_code',
        backref='pre2019s')
    dptdet = db.relationship(
        'Dptdet',
        primaryjoin='Pre2019.pre2019dpt == Dptdet.dptdet_index',
        backref='pre2019s')
コード例 #2
0
class Studentlearn(db.Model):
    __tablename__ = 'studentlearn'
    __table_args__ = (db.Index('studentlearn_studentid_courseid_uindex',
                               'studentid', 'courseid'), )

    index = db.Column(db.Integer, primary_key=True)
    studentid = db.Column(db.ForeignKey('user2.userid'), nullable=False)
    courseid = db.Column(db.ForeignKey('course.course_index'),
                         nullable=False,
                         index=True)

    course = db.relationship(
        'Course',
        primaryjoin='Studentlearn.courseid == Course.course_index',
        backref='studentlearns')
    user2 = db.relationship(
        'User2',
        primaryjoin='Studentlearn.studentid == User2.userid',
        backref='studentlearns')
コード例 #3
0
class Major(db.Model):
    __tablename__ = 'major'

    id = db.Column(db.Integer, primary_key=True, unique=True)
    name = db.Column(db.String(80), nullable=False)
    dep_code = db.Column(db.ForeignKey('department.code'), index=True)

    department = db.relationship(
        'Department',
        primaryjoin='Major.dep_code == Department.code',
        backref='majors')
コード例 #4
0
class Prefordept(db.Model):
    __tablename__ = 'prefordept'
    __table_args__ = (db.Index('uq_index', 'dept', 'coursecode', 'oneortwo',
                               'year'), )

    coursecode = db.Column(db.ForeignKey('course.course_code'),
                           nullable=False,
                           index=True)
    dept = db.Column(db.ForeignKey('dptdet.dptdet_index'), nullable=False)
    oneortwo = db.Column(db.Integer, nullable=False)
    year = db.Column(db.Integer, nullable=False)
    index = db.Column(db.Integer, primary_key=True)

    course = db.relationship(
        'Course',
        primaryjoin='Prefordept.coursecode == Course.course_code',
        backref='prefordepts')
    dptdet = db.relationship(
        'Dptdet',
        primaryjoin='Prefordept.dept == Dptdet.dptdet_index',
        backref='prefordepts')
コード例 #5
0
class Yearsdeptsch(db.Model):
    __tablename__ = 'yearsdeptsch'
    __table_args__ = (db.Index('yearsdeptsch_years_content_dept_index',
                               'years', 'part', 'dept'), )

    index = db.Column(db.Integer, primary_key=True)
    years = db.Column(db.Integer, nullable=False)
    dept = db.Column(db.ForeignKey('dptdet.dptdet_index'),
                     nullable=False,
                     index=True)
    part = db.Column(db.Integer, nullable=False)
    content = db.Column(db.Text)

    dptdet = db.relationship(
        'Dptdet',
        primaryjoin='Yearsdeptsch.dept == Dptdet.dptdet_index',
        backref='yearsdeptsches')