Files
SST/PythonProject/model/student_model.py
T

51 lines
1.4 KiB
Python
Raw Normal View History

2026-09-20 14:26:23 +08:00
from sqlalchemy import DATETIME,Column, Integer, String, Date,ForeignKey
from datetime import datetime
from util.database import Base,engine
class Student_Model(Base):
2026-09-20 14:26:23 +08:00
__tablename__ = 'wl_student'
2026-09-21 11:20:34 +08:00
2026-09-20 14:26:23 +08:00
stu_id = Column(Integer
, primary_key=True
, autoincrement=True
,comment='学生编号')
2026-09-21 11:20:34 +08:00
2026-09-21 09:54:25 +08:00
class_id=Column(Integer
,ForeignKey('wl_class.class_id')
,nullable=False
,comment='班级编号')
2026-09-21 11:20:34 +08:00
2026-09-20 14:26:23 +08:00
stu_name=Column(String(100),comment='学生姓名')
2026-09-21 11:20:34 +08:00
2026-09-20 14:26:23 +08:00
age=Column(Integer,comment='年龄')
2026-09-21 11:20:34 +08:00
2026-09-20 14:26:23 +08:00
gender=Column(String(50),comment='性别')
2026-09-21 11:20:34 +08:00
2026-09-20 14:26:23 +08:00
native_place=Column(String(200),comment='籍贯')
2026-09-21 11:20:34 +08:00
2026-09-20 14:26:23 +08:00
birthday=Column(Date,comment='生日')
2026-09-21 11:20:34 +08:00
2026-09-20 14:26:23 +08:00
school=Column(String(100),comment='毕业学校')
2026-09-21 11:20:34 +08:00
2026-09-20 14:26:23 +08:00
major=Column(String(50),comment='专业')
2026-09-21 11:20:34 +08:00
degree=Column(String(50),comment='学历')
2026-09-21 11:20:34 +08:00
2026-09-20 14:26:23 +08:00
admission_date=Column(Date,comment='入学日期')
2026-09-21 11:20:34 +08:00
2026-09-20 14:26:23 +08:00
graduation_date=Column(Date,comment='毕业日期')
2026-09-21 11:20:34 +08:00
progress=Column(Integer,default=0,comment='课程进度:学习中=0,求职中=1,已就业=2')
2026-09-21 11:20:34 +08:00
2026-09-20 14:26:23 +08:00
create_date=Column(DATETIME
,default=datetime.now)
2026-09-21 11:20:34 +08:00
2026-09-20 14:26:23 +08:00
update_date=Column(DATETIME
,default=datetime.now
,onupdate=datetime.now)
2026-09-21 11:20:34 +08:00
delete_status = Column(
Integer,default=0,comment='删除状态:0未删除,1已删除')
Base.metadata.create_all(engine)