Replies: 1 comment 3 replies
-
|
I don't think so. You can get objects using I think what you're after is something like: class Band(Table):
name = Varchar()
genres = M2M(LazyTableReference("GenreToBand", module_path=__name__))
class Genre(Table):
name = Varchar()
bands = M2M(LazyTableReference("GenreToBand", module_path=__name__))
# This is our joining table:
class GenreToBand(Table):
band = ForeignKey(Band)
genre = ForeignKey(Genre)
>>> bands = await Band.objects(Band.genres)
>>> band[0].genres
[<Genre 1>, <Genre 2>]Unfortunately we don't have an API like that at the moment. I can see it being useful though, so I'll try and add it at some point. Sorry about that. |
Beta Was this translation helpful? Give feedback.
3 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.
-
I want to use objects as i need data in instance form not in dict form i am unable to eager load an m2m relation is it possible to do that with objects or is there way to use instance with select instead of dict?
Beta Was this translation helpful? Give feedback.
All reactions