31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
from sqlalchemy import *
|
|||
|
|
from datetime import datetime
|
||
|
|
from database import Base
|
||
|
|
class Class(Base):
|
||
|
|
'''
|
||
|
|
班级信息数据库类模型
|
||
|
|
'''
|
||
|
|
__tablename__ = "s_class"
|
||
|
|
id = Column(Integer,
|
||
|
|
primary_key=True,
|
||
|
|
autoincrement=True,
|
||
|
|
index=True,#为该列创建索引,加快查询速度
|
||
|
|
comment='班级主键id')
|
||
|
|
class_id = Column(String(32),
|
||
|
|
nullable=False,
|
||
|
|
index=True,
|
||
|
|
unique=True,
|
||
|
|
comment='班级编号')
|
||
|
|
class_name = Column(String(32),
|
||
|
|
nullable=False,
|
||
|
|
index=True,
|
||
|
|
comment='班级名字')
|
||
|
|
ht_id = Column(Integer,nullable=False,
|
||
|
|
comment='班主任ID')
|
||
|
|
t_id = Column(Integer,nullable=False,
|
||
|
|
comment='授课老师ID')
|
||
|
|
start_time = Column(DATETIME,default=datetime.now,comment='开课时间')
|
||
|
|
update_time = Column(DATETIME,default=datetime.now,onupdate=datetime.now)
|
||
|
|
is_deleted = Column(Integer,default=0,index=True)
|
||
|
|
|