Open northpowered opened 1 year ago
It's an interesting idea - thanks.
I think we do need something like this. I'm just working my way through some other PRs at the moment, but hope to get to this soon!
Any thoughts? ;-)
@dantownsend Pls, run linters, I hope I fixed typing problems for Python < 3.10
@northpowered I've fixed the linter errors - the tests are running now.
@dantownsend mb we can merge #566 ?
566 PR
Adds join_m2m method for a Table class, which runs get_m2m() method for all M2M fields of object. Can be useful for complex PyDantic models in READ actions. Returns empty list() for an attribute, if there are no relations to this object.
Optional, you can include or exclude fields to define which attrs should be joined. Setting either include_fields, and exclude_fields will raise AssertionError.
Model example:
Usage: