Replies: 4 comments 4 replies
-
in Usual SQL I would use this but how can I make this in FastCRUD |
Beta Was this translation helpful? Give feedback.
-
I think what you are looking for is the get_joined method. Here's a comprehensive guide to joins in |
Beta Was this translation helpful? Give feedback.
-
I don't found this article when read documentation, and it is my case. But how can I make nested many records? async def get_card(self, card_id: uuid.UUID):
async with async_session_maker() as db:
return await card_crud.get_joined(
db=db,
id=card_id,
nest_joins=True,
joins_config=[
JoinConfig(
model=Article,
join_on=Article.card_id == Card.id,
join_type="left",
join_prefix="articles_",
schema_to_select=Article_schema,
)
]
) |
Beta Was this translation helpful? Give feedback.
-
The pr #93 will fix the related issue in #91. I just need to write the docs. |
Beta Was this translation helpful? Give feedback.
-
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)
code of getting record
result of this response
Why "true" ....?
How did it appeared ....?
how can I implement this?
Beta Was this translation helpful? Give feedback.
All reactions