-
Notifications
You must be signed in to change notification settings - Fork 97
adds m2m column to the playground #1234
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
adds m2m column to the playground #1234
Conversation
dantownsend
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this 👍
| bands = Band.insert( | ||
| Band(name="Pythonistas"), | ||
| Band(name="Rustaceans"), | ||
| Band(name="C-Sharps"), | ||
| ).run_sync() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting - this is much cleaner, thanks!
| class GenreToMovie(Table): | ||
| id: Serial | ||
| movie = ForeignKey(Movie) | ||
| genre = ForeignKey(Genre) | ||
| reason = Text(help_text="For testing additional columns on join tables.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change this to GenreToBand, as we already have a Band table.
Or GenreToAlbum, whichever makes more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll use GenreToBand because as you say the Band table is already here. Thanks
|
Looks great, thanks! 👍 |
Related to #554. Also a little refactoring for the
M2Mtest.