コード例 #1
0
class Fornum(db.Model):
    __tablename__ = 'fornum'

    fornumindex = db.Column(db.Integer, primary_key=True)
    fornumhead = db.Column(db.String(10), nullable=False)
    fornumcontent = db.Column(db.Text)
    fornumsender = db.Column(db.String(16), nullable=False)
コード例 #2
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')
コード例 #3
0
class User2(db.Model):
    __tablename__ = 'user2'

    userid = db.Column(db.String(8), primary_key=True)
    usercode = db.Column(db.String(20), nullable=False)
    userauth = db.Column(db.String(10), nullable=False)
    username = db.Column(db.String(20), nullable=False)
    userdept = db.Column(db.String(20), nullable=False)

    def __init__(self, userid):
        self.userid = userid
コード例 #4
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')
コード例 #5
0
class Schema(db.Model):
    __tablename__ = 'schema'

    id = db.Column(db.Integer, primary_key=True, unique=True)
    name = db.Column(db.String(100))
    major_id = db.Column(db.Integer, nullable=False)
    intro1 = db.Column(db.String)
    intro2 = db.Column(db.String)
    intro6 = db.Column(db.String)
    enter_must = db.Column(db.String(700))
    uni_must = db.Column(db.String(700))
    uni_may = db.Column(db.String(700))
    pro_abc = db.Column(db.String(700))
    pro_core = db.Column(db.String(700))
    pro_may = db.Column(db.String(700))
    pro_do = db.Column(db.String(700))
コード例 #6
0
class Dptdet(db.Model):
    __tablename__ = 'dptdet'

    dptdet_index = db.Column(db.Integer, primary_key=True)
    dptdet_name = db.Column(db.String(20), nullable=False, unique=True)
コード例 #7
0
class Department(db.Model):
    __tablename__ = 'department'

    code = db.Column(db.String(10), primary_key=True)
    name = db.Column(db.String(40), nullable=False)
コード例 #8
0
class Course(db.Model):
    __tablename__ = 'course'

    course_index = db.Column(db.Integer, primary_key=True)
    course_name = db.Column(db.String(45), nullable=False)
    course_code = db.Column(db.String(13), nullable=False, unique=True)