Skip to content

nested model #89

@matv864

Description

@matv864

I try to create api on sqlmodel with relationships (In my case, I have table Card and Article with link to Card (key: card_id))
one-to-many

And now I try to understand how it works (joined isn't my solving, I need record which contain Card model with list of Article models inside)
image

code of getting record

return await card_crud.get(
                db=db,
                id=card_id,
                schema_to_select=Card_schema,
            )

result of this response
image

Why "true" ....?
How did it appeared ....?

how can I implement this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions