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