-
-
Notifications
You must be signed in to change notification settings - Fork 693
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
Table view should support filtering via many-to-many relationships #355
Comments
I started playing with this in the Here's a demo: https://datasette-m2m-work-in-progress.now.sh/russian-ads-e8e09e2/ads?_m2m_ad_targets__target_id=ec3ac&_m2m_ad_targets__target_id=e128e |
So the design I have so far is:
I'm concerned that this doesn't take tables or columns with |
The alternative would be to use JSON:
|
I think I like this better. I don't think
|
This assumes that our current table has a single, unambiguous foreign key relationship with the table indicated by the I think that's reasonable. The JSON format could be extended to allow that side of the relationship to optionally be defined there (if the foreign key relationship is missing). |
Filtering through one table already works - you need to know that table's primary key, then you do Filtering through a m2m table will be handled by the new I'm going to leave out filtering through a second levels of joins for the moment. Potentially that could be added later as some extra complicated JSON. |
Documentation here: https://datasette.readthedocs.io/en/latest/json_api.html#special-table-arguments |
I think an approach similar to how Can address this feedback from @psychemedia while I'm at it: #429 (comment) |
Parent: #354
The text was updated successfully, but these errors were encountered: