数据库模型类名修改以及文件名修改

This commit is contained in:
maruizhi
2026-09-20 15:32:28 +08:00
parent 7f419fb8ad
commit 67e8f49c80
6 changed files with 60 additions and 11 deletions
+8 -9
View File
@@ -1,7 +1,6 @@
from sqlalchemy import DATETIME,Column, Integer, String, Date,ForeignKey
from sqlalchemy.orm import declarative_base
import datetime
Base = declarative_base()
from datetime import datetime
from util.database import Base,engine
class Student_Model(Base):
__tablename__ = 'wl_student'
@@ -9,10 +8,10 @@ class Student_Model(Base):
, primary_key=True
, autoincrement=True
,comment='学生编号')
class_id=Column(Integer
,ForeignKey('wl_class.class_id')
,nullable=False
,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='性别')
@@ -23,12 +22,12 @@ class Student_Model(Base):
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)
progress=Column(Integer,default=0)
Base.metadata.create_all(engine)