From 0b72cb78ee9e955cbd517af0c7f03819e4d28095 Mon Sep 17 00:00:00 2001 From: lookerzz <1031516901@qq.com> Date: Mon, 21 Sep 2026 21:23:43 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/student.py | 2 +- models/class_model.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/student.py b/api/student.py index 9299659..99daec7 100644 --- a/api/student.py +++ b/api/student.py @@ -6,7 +6,7 @@ from schemas.student import StudentCreate student_router = APIRouter() @student_router.post("/student") -def create_student(request:StudentCreate,db:Session,create = Depends(create_students)): +def create_student(request:StudentCreate,db:Session=Depends(create_students)): d = request.model_dump() r = create_students(d,db) if not r: diff --git a/models/class_model.py b/models/class_model.py index 50ff873..dc6ce4a 100644 --- a/models/class_model.py +++ b/models/class_model.py @@ -35,7 +35,7 @@ class Classes( Base ): # 在python里的名字 , nullable = False # 声明是"非空" ) # ————创建班级"更新时间"的字段名———— - updated_at = Column( DATETIME # 声明是字段数据类型是"日期时间" + update_at = Column( DATETIME # 声明是字段数据类型是"日期时间" , default=datetime.now #声明是第一次更新的时间就是第一次创建的时间一致 , onupdate=datetime.now # 声明"最后修改的时间" , server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")