{"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495079705", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495079705, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA3OTcwNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T06:03:40Z", "updated_at": "2019-05-23T06:04:03Z", "author_association": "OWNER", "body": "I think an approach similar to how `?_where=` works would do the job here.\r\n\r\nCan address this feedback from @psychemedia while I'm at it: https://github.com/simonw/datasette/issues/429#issuecomment-483202658\r\n\r\n![image](https://user-images.githubusercontent.com/82988/56127017-2bf78e80-5f74-11e9-9120-9393eb5d4988.png)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495079393", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495079393, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA3OTM5Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T06:02:11Z", "updated_at": "2019-05-23T06:02:11Z", "author_association": "OWNER", "body": "I'm re-opening because we need a UI mechanism for deselecting this:\r\n\r\n\"fixtures__roadside_attractions__2_rows_where_where_roadside_attraction_characteristics_characteristic_id____1__and_fixtures__roadside_attractions__2_rows_where_w", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495077528", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495077528, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA3NzUyOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T05:53:20Z", "updated_at": "2019-05-23T05:53:20Z", "author_association": "OWNER", "body": "Demo: https://latest.datasette.io/fixtures/roadside_attractions?_through={%22table%22:%22roadside_attraction_characteristics%22,%22column%22:%22characteristic_id%22,%22value%22:%221%22}", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495077443", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495077443, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA3NzQ0Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T05:52:52Z", "updated_at": "2019-05-23T05:52:52Z", "author_association": "OWNER", "body": "Documentation here: https://datasette.readthedocs.io/en/latest/json_api.html#special-table-arguments", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495061686", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495061686, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA2MTY4Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T04:21:00Z", "updated_at": "2019-05-23T04:21:00Z", "author_association": "OWNER", "body": "Filtering through one table already works - you need to know that table's primary key, then you do `?column_id=pk` against the first table.\r\n\r\nFiltering through a m2m table will be handled by the new `?_through=` parameter.\r\n\r\nI'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.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495059236", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495059236, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA1OTIzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T04:03:04Z", "updated_at": "2019-05-23T04:03:04Z", "author_association": "OWNER", "body": "This assumes that our current table has a single, unambiguous foreign key relationship with the table indicated by the `?through=` parameter.\r\n\r\nI 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).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495058964", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495058964, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA1ODk2NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T04:01:17Z", "updated_at": "2019-05-23T04:01:17Z", "author_association": "OWNER", "body": "I think I like this better. I don't think `?_m2m=` is the correct name for it though.\r\n\r\n`?_through={\"table\":\"ad_targets\",\"column\":\"target_id\",\"value\":\"ec3ac\"}` feels a little more accurate.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495058828", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495058828, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA1ODgyOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T04:00:27Z", "updated_at": "2019-05-23T04:00:27Z", "author_association": "OWNER", "body": "The alternative would be to use JSON:\r\n\r\n`?_m2m={\"table\":\"ad_targets\",\"column\":\"target_id\",\"value\":\"ec3ac\"}`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-495058622", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 495058622, "node_id": "MDEyOklzc3VlQ29tbWVudDQ5NTA1ODYyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-05-23T03:58:58Z", "updated_at": "2019-05-23T03:58:58Z", "author_association": "OWNER", "body": "So the design I have so far is:\r\n\r\n`?_m2m_linktablename__linktablecolumn=value`\r\n\r\nI'm concerned that this doesn't take tables or columns with `__` in their name into account. Does that matter? Could I support this without them?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/355#issuecomment-409087871", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/355", "id": 409087871, "node_id": "MDEyOklzc3VlQ29tbWVudDQwOTA4Nzg3MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-31T04:06:22Z", "updated_at": "2018-07-31T04:06:22Z", "author_association": "OWNER", "body": "I started playing with this in the `m2m` branch - work so far: https://github.com/simonw/datasette/compare/295d005ca48747faf046ed30c3c61e7563c61ed2...af4ce463e7518f9d7828b846efd5b528a1905eca\r\n\r\nHere'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", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 346027040, "label": "Table view should support filtering via many-to-many relationships"}, "performed_via_github_app": null}