join where with many to many relations
#1372
Unanswered
amirreza-sf80
asked this question in
Q&A
Replies: 1 comment
-
|
@amirreza-sf80 Yes, you're right, it's not documented anywhere. For genre = await Genre.objects().get(Genre.name == "Rock")
await genre.get_m2m(Genre.bands)That's what you can use for now. Will there be any special API for that, I don't know. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi 👋
it is documented how to use
wherewhen doing a join using a one to many https://piccolo-orm.readthedocs.io/en/latest/piccolo/query_clauses/where.html#joinsbut doing thiswith m2m is not documented
the docs have some join examples https://piccolo-orm.readthedocs.io/en/latest/piccolo/schema/m2m.html#select-queries but it doesn't show how one should use a where clause
specifically, what i'm looking for (using the tables from docs) is to select
Band.namewhere Genre.name is something specific, but not return anything from Genre itselfsomething like
sorry if this is already documented somewhere, i couldn't find anything
Beta Was this translation helpful? Give feedback.
All reactions