51 lines
1.7 KiB
Python
51 lines
1.7 KiB
Python
|
|
from sqlalchemy import Column,Integer,String,Date,Boolean
|
|
from sqlalchemy.dialects.mysql import DATETIME
|
|
from datetime import datetime
|
|
from database import Base
|
|
|
|
|
|
|
|
|
|
class ClassInfo(Base):
|
|
__tablename__ = 'class_info'
|
|
|
|
class_id = Column(Integer
|
|
,primary_key=True
|
|
,autoincrement=True
|
|
,comment='班级id主键'
|
|
)
|
|
class_name = Column(String(10)
|
|
,nullable=False
|
|
,comment='班级名称'
|
|
)
|
|
class_teacher = Column(String(50)
|
|
,nullable=False
|
|
,comment='班主任'
|
|
)
|
|
class_lecturer = Column(String(50)
|
|
,nullable=False
|
|
,comment='授课老师'
|
|
)
|
|
class_start_time = Column(Date
|
|
,nullable=False
|
|
,comment='开班日期'
|
|
)
|
|
class_end_time = Column(Date
|
|
,nullable=False
|
|
,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='记录更新时间'
|
|
)
|