63 lines
2.3 KiB
Python
63 lines
2.3 KiB
Python
from databases import engine_all,Base_all,Session
|
|
from sqlalchemy import Column, Integer, String, Date, ForeignKey
|
|
from sqlalchemy.dialects.mysql import DATETIME
|
|
from datetime import datetime
|
|
from class_management.database import Base
|
|
|
|
class ClassInfo(Base_all):
|
|
__tablename__ = 'classes'
|
|
|
|
id = Column(Integer
|
|
,primary_key=True
|
|
,autoincrement=True
|
|
,comment='班级id主键'
|
|
)
|
|
num = Column(String(50)
|
|
,nullable=False
|
|
,comment='班级编号'
|
|
)
|
|
name = Column(String(50)
|
|
,nullable=False
|
|
,comment='班级名称'
|
|
)
|
|
head_teacher_id = Column(Integer
|
|
# ,ForeignKey('teacher.id')
|
|
,comment='班主任编号'
|
|
)
|
|
|
|
coach_teacher_id = Column(Integer
|
|
# ,ForeignKey('teacher.id')
|
|
,comment='授课老师编号'
|
|
)
|
|
tutor_teacher_id = Column(Integer
|
|
# ,ForeignKey('teacher.id')
|
|
,comment='助教老师编号'
|
|
)
|
|
# class_teacher = Column(String(50)
|
|
# ,nullable=False
|
|
# ,comment='班主任'
|
|
# )
|
|
# class_lecturer = Column(String(50)
|
|
# ,nullable=False
|
|
# ,comment='授课老师'
|
|
# )
|
|
class_start_time = Column(Date
|
|
,comment='开班日期'
|
|
)
|
|
class_end_time = Column(Date
|
|
,comment='结课日期'
|
|
)
|
|
is_delete = Column(Integer
|
|
,default=0
|
|
,comment='逻辑删除 0未删除 1已删除'
|
|
)
|
|
create_time = Column(DATETIME
|
|
,default=datetime.now
|
|
,comment='记录创建时间'
|
|
)
|
|
update_time = Column(DATETIME
|
|
,default=datetime.now
|
|
,onupdate=datetime.now
|
|
,comment='记录更新时间'
|
|
)
|