Exemplo n.º 1
0
class Teacher(db.Model):

    """
    The model of teachers
    """

    __tablename__ = 'teacher'

    id = db.Column(db.Integer, nullable=False, primary_key=True)

    name = db.Column(db.String(20), nullable=False)

    teacher_id = db.Column(db.String(20), nullable=False)

    password = db.Column(db.String(20), nullable=False)

    candidates = db.relationship('Candidate', backref='teacher', lazy=True)

    permission_id = db.Column(db.Integer, db.ForeignKey('permission.id'))
Exemplo n.º 2
0
class Vedio(db.Model):
    """
    The model of the vedio
    """

    __tablename__ = 'vedio'

    id = db.Column(db.Integer,
                   nullable=False,
                   autoincrement=True,
                   primary_key=True)

    name = db.Column(db.String(50), nullable=False)

    url = db.Column(db.String(200))

    subject_id = db.Column(db.Integer,
                           db.ForeignKey('subject.id'),
                           nullable=False)
Exemplo n.º 3
0
class Image(db.Model):
    """
    The model of the image
    """

    __tablename__ = 'image'

    id = db.Column(db.Integer, autoincrement=True, primary_key=True)

    url = db.Column(db.String(200))
Exemplo n.º 4
0
class Subject(db.Model):
    """
    The model of the subject
    """

    __tablename__ = 'subject'

    id = db.Column(db.Integer,
                   nullable=False,
                   autoincrement=True,
                   primary_key=True)

    subject = db.Column(db.String(50), unique=True)

    vedios = db.relationship('Vedio', backref='subject', lazy=True)
Exemplo n.º 5
0
class Candidate(db.Model):
    """
    The model of the candidates
    """

    __tablename__ = 'candidate'  # name the candidate

    id = db.Column(db.Integer,
                   nullable=False,
                   autoincrement=True,
                   primary_key=True)

    identity_number = db.Column(db.String(20), nullable=False, unique=True)

    ticket_number = db.Column(db.String(20), nullable=False, unique=True)

    name = db.Column(db.String(64), unique=True, nullable=False)

    sex = db.Column(db.String(10), nullable=False)

    age = db.Column(db.Integer)

    phone = db.Column(db.String(20), nullable=False)

    address = db.Column(db.String(50), nullable=False)

    email = db.Column(db.String(64), nullable=False)

    examination_time = db.Column(db.DateTime, nullable=False)

    grades = db.Column(db.Integer)

    vedio_id = db.Column(db.Integer, db.ForeignKey('vedio.id'), nullable=False)

    examination_status = db.Column(db.Integer, nullable=False, default=0)

    photo_id = db.Column(db.ForeignKey('image.id'), nullable=False)

    teacher_id = db.Column(db.Integer,
                           db.ForeignKey('teacher.id'),
                           nullable=False)