Skip to content

CRUD update pattern is broken with fastapi 0.61 #249

@shawnwall

Description

@shawnwall

The first line of the CRUDBase update method is:

obj_data = jsonable_encoder(db_obj)

This now stack overflows when using fastapi 0.61. We need an updated base CRUD pattern in this project, along with updating the various dependencies. I'll additionally be filing an issue to the fastapi project itself with the need for CRUD update examples.

From what I've figured out so far, we may need a reference to the ModelInDB or Model pydantic models, and then:

obj_data = ModelInDB.from_orm(db_obj)

and change the iteration to:

for field in obj_data.dict():

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions