Exemplo n.º 1
0
class Group(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String, unique=True)
    major = db.Column(db.Integer)
    teachers = db.relationship('Teachers_group', backref='group')
    subgroups = db.relationship('SubGroup', backref='group')
    schedule = db.relationship('Schedule', backref='group')
Exemplo n.º 2
0
class Discipline(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(50))
    credit = db.Column(db.Integer)
    academic_hours = db.Column(db.Integer)
    groups = db.relationship('Group_discipline', backref='discipline')
    attendance = db.relationship('Attendance', backref='Discipline')
    schedule = db.relationship('Schedule', backref='Discipline')
Exemplo n.º 3
0
class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    public_id = db.Column(db.String, unique=True)
    name = db.Column(db.String(50), unique=True)
    password = db.Column(db.String(50))
    admin = db.Column(db.Boolean)
    teacher = db.Column(db.Boolean)
    student = db.Column(db.Boolean)
    rteacher = db.relationship('Teacher', backref='user')
    rstudent = db.relationship('Student', backref='user')
Exemplo n.º 4
0
class Student(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    full_name = db.Column(db.String, unique=True)
    group_id = db.Column(db.Integer)
    status_id = db.Column(db.Integer)
    phone = db.Column(db.String)
    auth_num = db.Column(db.Integer, db.ForeignKey('user.id'))
    email = db.Column(db.String)
    attendance = db.relationship('Attendance', backref='student')
Exemplo n.º 5
0
class Teacher(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    full_name = db.Column(db.String(50), unique=True)
    auth_num = db.Column(db.Integer, db.ForeignKey('user.id'))
    groups = db.relationship('Teachers_group', backref='teacher')
    disciplines = db.relationship('Group_discipline', backref='teacher')
Exemplo n.º 6
0
class ClassTime(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    begining = db.Column(db.String)
    end = db.Column(db.String)
    disciplines = db.relationship('Schedule', backref='Time')
Exemplo n.º 7
0
class DisciplineType(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(50))
    short = db.Column(db.String(10))
    disciplines = db.relationship('Schedule', backref='DisciplineType')