{"html_url": "https://github.com/simonw/datasette/issues/1696#issuecomment-1407767434", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1696", "id": 1407767434, "node_id": "IC_kwDOBm6k_c5T6NOK", "user": {"value": 193185, "label": "cldellow"}, "created_at": "2023-01-29T20:56:20Z", "updated_at": "2023-01-29T20:56:20Z", "author_association": "CONTRIBUTOR", "body": "I did some horrible things in https://github.com/cldellow/datasette-ui-extras/issues/2 to enable this in my plugin -- example here: https://dux-demo.fly.dev/cooking/posts?_facet=owner_user_id&owner_user_id=67\r\n\r\nThe implementation relies on two things:\r\n\r\n- a `filters_from_request` hook that adds a good human description (unfortunately, without the benefit of the CSS styling you mention)\r\n- doing something evil to hijack the `exact` and `not` operators in the `Filters` class. We can't leave them as is, or we'll get 2 human descriptions -- the built-in Datasette one and the one from my plugin. We can't remove them, or the filters UI will stop supporting the `=` and `!=` operators\r\n\r\nThis got me thinking: it'd be neat if the list of operators that the filters UI supported wasn't a closed set.\r\n\r\nA motivating example: adding a geospatial `NEAR` operator. Ideally it'd take two arguments - a target point and a radius, so you could express a filter like `find me all rows whose lat/lng are within 10km of 43.4516\u00b0 N, 80.4925\u00b0 W`. (Optionally, the UI could be enhanced if the geonames database was loaded and queried, so a user could say `find me all rows whose lat/lng are within 10km of Kitchener, ON`, and the city gets translated to a lat/lng for them)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1186696202, "label": "Show foreign key label when filtering"}, "performed_via_github_app": null}