{"html_url": "https://github.com/simonw/datasette/issues/621#issuecomment-997120723", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/621", "id": 997120723, "node_id": "IC_kwDOBm6k_c47btrT", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-18T01:42:33Z", "updated_at": "2021-12-18T01:42:33Z", "author_association": "OWNER", "body": "I refactored this code out into the `filters.py` module in aa7f0037a46eb76ae6fe9bf2a1f616c58738ecdf", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 520681725, "label": "Syntax for ?_through= that works as a form field"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/621#issuecomment-994005634", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/621", "id": 994005634, "node_id": "IC_kwDOBm6k_c47P1KC", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-14T21:02:50Z", "updated_at": "2021-12-14T21:02:50Z", "author_association": "OWNER", "body": "This would also mean that an extra text input box could be easily shown on the page.\r\n\r\nhttps://latest-with-plugins.datasette.io/fixtures/roadside_attractions?_through={\"table\":\"roadside_attraction_characteristics\",\"column\":\"characteristic_id\",\"value\":\"1\"} but with the annotated box added (and made to look good):\r\n\r\n\"image\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 520681725, "label": "Syntax for ?_through= that works as a form field"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/621#issuecomment-993958242", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/621", "id": 993958242, "node_id": "IC_kwDOBm6k_c47Ppli", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-14T20:33:25Z", "updated_at": "2021-12-14T20:33:56Z", "author_association": "OWNER", "body": "Alternative idea: since current syntax is:\r\n\r\n`?_through={\"table\":\"roadside_attraction_characteristics\",\"column\":\"characteristic_id\",\"value\":\"1\"}`\r\n\r\nThe form-encoding-friendly syntax could be:\r\n\r\n`?_through.{\"table\":\"roadside_attraction_characteristics\",\"column\":\"characteristic_id\"}=1`\r\n\r\nWhich is more consistent than the array proposal:\r\n\r\n`?_through.[\"roadside_attraction_characteristics\",\"characteristic_id\"]=1`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 520681725, "label": "Syntax for ?_through= that works as a form field"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/621#issuecomment-993813210", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/621", "id": 993813210, "node_id": "IC_kwDOBm6k_c47PGLa", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-14T17:30:13Z", "updated_at": "2021-12-14T20:23:57Z", "author_association": "OWNER", "body": "Might be able to create a web form that's unambiguous using:\r\n\r\n`https://latest.datasette.io/fixtures/roadside_attractions?_through.[\"roadside_attraction_characteristics\",\"characteristic_id\"]=1`\r\n\r\nSo:\r\n\r\n```html\r\n\r\n```\r\nI'm pretty confident this is allowed by the HTML specification. This works:\r\n\r\n```html\r\n
\r\n \r\n \r\n
\r\n```\r\nASGI parsing seems to work too: https://latest-with-plugins.datasette.io/-/asgi-scope?_through.[%22roadside_attraction_characteristics%22%2C%22characteristic_id%22]=1", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 520681725, "label": "Syntax for ?_through= that works as a form field"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/621#issuecomment-552253208", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/621", "id": 552253208, "node_id": "MDEyOklzc3VlQ29tbWVudDU1MjI1MzIwOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-11T00:39:57Z", "updated_at": "2019-11-11T00:39:57Z", "author_association": "OWNER", "body": "This is a nice opportunity to help with the refactoring of the table view in #617 - the above code snippet takes the request, looks at the `_through=` parameters and appends things to the `where_clauses`, `params` and `extra_human_descriptions` lists. I can factor that out into a separate private method on `TableView` and use that as a pattern for further refactoring.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 520681725, "label": "Syntax for ?_through= that works as a form field"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/621#issuecomment-552251645", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/621", "id": 552251645, "node_id": "MDEyOklzc3VlQ29tbWVudDU1MjI1MTY0NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-11T00:23:56Z", "updated_at": "2019-11-11T00:33:31Z", "author_association": "OWNER", "body": "Current syntax: https://datasette.readthedocs.io/en/stable/json_api.html#special-table-arguments\r\n\r\n`/?_through={\"table\":\"roadside_attraction_characteristics\",\"column\":\"characteristic_id\",\"value\":\"1\"}`\r\n\r\nDemo: https://latest.datasette.io/fixtures/roadside_attractions?_through={%22table%22:%22roadside_attraction_characteristics%22,%22column%22:%22characteristic_id%22,%22value%22:%221%22}\r\n\r\nThe alternative syntax for that could be: \r\n\r\n`https://latest.datasette.io/fixtures/roadside_attractions?_through.roadside_attraction_characteristics.characteristic_id=1`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 520681725, "label": "Syntax for ?_through= that works as a form field"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/621#issuecomment-552251666", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/621", "id": 552251666, "node_id": "MDEyOklzc3VlQ29tbWVudDU1MjI1MTY2Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2019-11-11T00:24:09Z", "updated_at": "2019-11-11T00:32:49Z", "author_association": "OWNER", "body": "Here's the current code:\r\n\r\nhttps://github.com/simonw/datasette/blob/28c4a6db5b5e512db630d7ba6127196185de67c7/datasette/views/table.py#L316-L348", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 520681725, "label": "Syntax for ?_through= that works as a form field"}, "performed_via_github_app": null}