Skip to content

Conversation

@sinisaos
Copy link
Member

Related to #554. Also a little refactoring for the M2M test.

@sinisaos sinisaos added the enhancement New feature or request label Jul 29, 2025
Copy link
Member

@dantownsend dantownsend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this 👍

Comment on lines +54 to +58
bands = Band.insert(
Band(name="Pythonistas"),
Band(name="Rustaceans"),
Band(name="C-Sharps"),
).run_sync()
Copy link
Member

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!

Comment on lines 192 to 196
class GenreToMovie(Table):
id: Serial
movie = ForeignKey(Movie)
genre = ForeignKey(Genre)
reason = Text(help_text="For testing additional columns on join tables.")
Copy link
Member

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.

Copy link
Member Author

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

@dantownsend
Copy link
Member

Looks great, thanks! 👍

@dantownsend dantownsend merged commit 2e1e6f9 into piccolo-orm:master Aug 5, 2025
46 checks passed
@sinisaos sinisaos deleted the add_m2m_to_playground branch August 6, 2025 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants