Files
SST/PythonProject/model/student_model.py
T

34 lines
1.3 KiB
Python

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