You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying out the update blog action, I get a 500 response, with the following error in console:
AttributeError: 'Blog' object has no attribute 'items'
It appears others have run into this sort of issue. See this link.
I'm using the enviroment provided with the repo, so I'm not sure what other variation there could be. Looking at other examples. it seems other developers opt to loop through the contents of the request, instead of passing the whole object as an argument into update().
Using Python 3.7.8
The text was updated successfully, but these errors were encountered:
def updateBlog(id:int,request:schemas.Blog, db:Session):
blog = db.query(models.Blog).filter(models.Blog.id == id).first()`
if not blog:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f"Blog with the id {id} is not available")
else:
db.query(models.Blog).filter(models.Blog.id == id).update(request.dict())
When trying out the update blog action, I get a 500 response, with the following error in console:
It appears others have run into this sort of issue. See this link.
I'm using the enviroment provided with the repo, so I'm not sure what other variation there could be. Looking at other examples. it seems other developers opt to loop through the contents of the request, instead of passing the whole object as an argument into update().
Using Python 3.7.8
The text was updated successfully, but these errors were encountered: