Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Join Should Return List When Necessary #91

Closed
igorbenav opened this issue May 21, 2024 · 0 comments · Fixed by #93
Closed

Nested Join Should Return List When Necessary #91

igorbenav opened this issue May 21, 2024 · 0 comments · Fixed by #93
Assignees
Labels
bug Something isn't working FastCRUD Methods Related to FastCRUD methods

Comments

@igorbenav
Copy link
Owner

This was mentioned in #90

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,
                    )
                ]
            )

Assuming a card has multiple articles, articles in joined response should be a list of articles.

@igorbenav igorbenav added bug Something isn't working FastCRUD Methods Related to FastCRUD methods labels May 21, 2024
@igorbenav igorbenav self-assigned this May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working FastCRUD Methods Related to FastCRUD methods
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant