Skip to content

[M2M] Query dependent incl. link_model fields #1529

Answered by JakNowy
Pk13055 asked this question in Questions
Discussion options

You must be logged in to vote
query = (
            select(Team)
            .join(Membership, Membership.team_id == Team.id)
            .options(joinedload(Team.heroes))
            .where(Team.id == id)
        )

should work for you

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #535 on August 16, 2025 18:37.