Skip to content

classes should have a config subclass with orm_mode = True #419

@extreme4all

Description

@extreme4all

https://fastapi.tiangolo.com/tutorial/sql-databases/#use-pydantics-orm_mode

with this, the Pydantic model is compatible with ORMs, and you can just declare it in the response_model argument in your path operations.

You will be able to return a database model and it will read the data from it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions