I am using vscode with type checking mode at basic. My code is working properly but I still get the red squiggly line underneath the model. I am using fastapi and sqlite for the database. It is a basic todo app.
Here is the code of that route
@app.put("/todo/{todo_id}", status_code=status.HTTP_204_NO_CONTENT)
async def update_todo(
db: db_dependency, todo_requestBody: TodoRequest, todo_id: int = Path(gt=0)
):
todo_model = db.query(Todos).filter(Todos.id == todo_id).first()
if todo_model is not None:
todo_model.title = todo_requestBody.title
todo_model.description = todo_requestBody.description
todo_model.priority = todo_requestBody.priority
todo_model.complete = todo_requestBody.complete
db.add(todo_model)
db.commit()
# return
else:
raise HTTPException(status_code=404, detail="todo not found")
1