bug修改

This commit is contained in:
2026-09-21 21:23:43 +08:00
parent ce3cae0b82
commit 0b72cb78ee
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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")