{"html_url": "https://github.com/simonw/datasette/issues/904#issuecomment-712483066", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/904", "id": 712483066, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjQ4MzA2Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T22:46:48Z", "updated_at": "2020-10-19T22:46:48Z", "author_association": "OWNER", "body": "OK, I'm committing to `datasette.urls.table()` and friends, which will be available to (and documented for use in) plugins and will be exposed to templates as `{{ urls.table(...) }}`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 663228985, "label": "datasette.urls.table() / .instance() / .database() methods for constructing URLs, also exposed to templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1020#issuecomment-712482504", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1020", "id": 712482504, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjQ4MjUwNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T22:45:01Z", "updated_at": "2020-10-19T22:45:01Z", "author_association": "OWNER", "body": "I'm having trouble coming up with the syntax for this. Here's one option:\r\n```python\r\nresponse = await datasette.client.get(path, request=request)\r\n```\r\nBut this feels confusing to me. We're not using the `request=` argument as a request - we're using it as a source of some default request values (the cookies and incoming headers, but not the path).\r\n\r\nWe're essentially combining that request with the other arguments passed to `.get()`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721068929, "label": "Method for datasette.client() to forward on authentication"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1020#issuecomment-712482015", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1020", "id": 712482015, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjQ4MjAxNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T22:43:24Z", "updated_at": "2020-10-19T22:43:24Z", "author_association": "OWNER", "body": "... unless I want to support authentication mechanisms that work based on incoming IP address instead, in which case there's an argument for copying more over from the incoming request.\r\n\r\nTailscale is a good example of a system where authentication based on IP address can actually work well, so this is worth doing. Also, there might be authentication mechanisms which work by setting a custom header on the incoming request (not to mention the `Authorization` header).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721068929, "label": "Method for datasette.client() to forward on authentication"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1020#issuecomment-712481568", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1020", "id": 712481568, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjQ4MTU2OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T22:41:59Z", "updated_at": "2020-10-19T22:41:59Z", "author_association": "OWNER", "body": "It turns out this works just fine:\r\n```python\r\nresponse = await datasette.client.get(path, cookies=request.cookies)\r\n```\r\nSo I don't need a mechanism for this. I'm going to add this to the documentation instead.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 721068929, "label": "Method for datasette.client() to forward on authentication"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1028#issuecomment-712480866", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1028", "id": 712480866, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjQ4MDg2Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T22:39:51Z", "updated_at": "2020-10-19T22:39:51Z", "author_association": "OWNER", "body": "Documentation: https://docs.datasette.io/en/latest/spatialite.html", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 723803777, "label": "--load-extension=spatialite shortcut"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1032#issuecomment-712367285", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1032", "id": 712367285, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjM2NzI4NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T18:39:32Z", "updated_at": "2020-10-19T18:39:32Z", "author_association": "OWNER", "body": "https://github.com/digital-land/brownfield-land-collection/blob/a09ddf9960a6af59e72dc02448f7b645e59bf227/bin/harmonise.py#L217-L247 is a beautiful example of this problem.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724878151, "label": "Bring date parsing into Datasette core"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1032#issuecomment-712365439", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1032", "id": 712365439, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjM2NTQzOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T18:35:50Z", "updated_at": "2020-10-19T18:37:57Z", "author_association": "OWNER", "body": "Maybe I don't need to add `dateutil` as a dependency here?\r\n\r\n`pendulum` and `arrow` both depend on it so it's pretty deeply embedded in the Python date ecosystem. Adding it as a dependency seems reasonable.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724878151, "label": "Bring date parsing into Datasette core"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1032#issuecomment-712365236", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1032", "id": 712365236, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjM2NTIzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T18:35:25Z", "updated_at": "2020-10-19T18:35:25Z", "author_association": "OWNER", "body": "Since I'm dealing with tables of data I usually have a whole column of examples, so heuristics that check for numbers-greater-than-12 could actually work well for many cases.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724878151, "label": "Bring date parsing into Datasette core"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1032#issuecomment-712364532", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1032", "id": 712364532, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjM2NDUzMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T18:34:10Z", "updated_at": "2020-10-19T18:34:10Z", "author_association": "OWNER", "body": "Lots of great example date data in https://biglocal.datasettes.com/COVID_WARN_Notices", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724878151, "label": "Bring date parsing into Datasette core"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1032#issuecomment-712364317", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1032", "id": 712364317, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjM2NDMxNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T18:33:42Z", "updated_at": "2020-10-19T18:33:42Z", "author_association": "OWNER", "body": "Related challenge: timezones. I think I'll punt on those for the moment and just concentrate on dates, but I should keep them in mind.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724878151, "label": "Bring date parsing into Datasette core"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1032#issuecomment-712363825", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1032", "id": 712363825, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjM2MzgyNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T18:32:43Z", "updated_at": "2020-10-19T18:32:43Z", "author_association": "OWNER", "body": "Horrible thought: I bet there is data out there that uses more than one date format in the same table! So this needs to be exposed as a visible per-column setting.\r\n\r\nColumn action menu can help here, although it's not yet the full solution because it isn't yet visible on mobile.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724878151, "label": "Bring date parsing into Datasette core"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1032#issuecomment-712363344", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1032", "id": 712363344, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjM2MzM0NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T18:31:46Z", "updated_at": "2020-10-19T18:31:46Z", "author_association": "OWNER", "body": "As always with dates, the challenge is America. `mm/dd/yy` is indistinguishable from the more sensible `dd/mm/yy`. It's crucially important to visibly tell people which format you assumed, otherwise all kinds of weird invisible bugs can manifest.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 724878151, "label": "Bring date parsing into Datasette core"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/904#issuecomment-712355877", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/904", "id": 712355877, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjM1NTg3Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T18:17:22Z", "updated_at": "2020-10-19T18:17:22Z", "author_association": "OWNER", "body": "I quite like `datasette.urls.table()` but I'm not sure why.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 663228985, "label": "datasette.urls.table() / .instance() / .database() methods for constructing URLs, also exposed to templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/904#issuecomment-712355706", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/904", "id": 712355706, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjM1NTcwNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T18:17:03Z", "updated_at": "2020-10-19T18:17:03Z", "author_association": "OWNER", "body": "Options:\r\n- `datasette.urls.instance()` (or `datasette.urls.root()`), `datasette.urls.table()` etc\r\n- `datasette.url_for.instance()`...\r\n- `datasette.url.instance()`...\r\n- `datasette.root_url()`, `datasette.table_url()`...", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 663228985, "label": "datasette.urls.table() / .instance() / .database() methods for constructing URLs, also exposed to templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/904#issuecomment-712354600", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/904", "id": 712354600, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjM1NDYwMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T18:15:03Z", "updated_at": "2020-10-19T18:15:39Z", "author_association": "OWNER", "body": "Related: #1026 (How should datasette.client interact with base_url)\r\n\r\nAlso this comment from https://github.com/simonw/datasette/issues/943#issuecomment-675752436\r\n\r\n> One thing to consider here: Datasette's table and database name escaping rules can be a little bit convoluted.\r\n> \r\n> If a plugin wants to get back the first five rows of a table, it will need to construct a URL `/dbname/tablename?_size=5` - but it will need to know how to turn the database and table names into the correctly escaped `dbname` and `tablename` values.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 663228985, "label": "datasette.urls.table() / .instance() / .database() methods for constructing URLs, also exposed to templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/904#issuecomment-712324077", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/904", "id": 712324077, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjMyNDA3Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T17:39:38Z", "updated_at": "2020-10-19T17:39:38Z", "author_association": "OWNER", "body": "If I do these methods I think this should be available on the `datasette` object too, as an internal API for plugins to use to construct redirects and suchlike.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 663228985, "label": "datasette.urls.table() / .instance() / .database() methods for constructing URLs, also exposed to templates"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1027#issuecomment-712320103", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1027", "id": 712320103, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjMyMDEwMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T17:35:04Z", "updated_at": "2020-10-19T17:35:04Z", "author_association": "OWNER", "body": "Still need to configure proxying though. https://www.netnea.com/cms/apache-tutorial-9_setting-up-a-reverse-proxy/", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 722758132, "label": "Add documentation on serving Datasette behind a proxy using base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/991#issuecomment-712317638", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/991", "id": 712317638, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMjMxNzYzOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-19T17:30:56Z", "updated_at": "2020-10-19T17:30:56Z", "author_association": "OWNER", "body": "https://biglocal.datasettes.com/ is one of my larger Datasettes in terms of number of databases.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 714377268, "label": "Redesign application homepage"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/904#issuecomment-710487083", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/904", "id": 710487083, "node_id": "MDEyOklzc3VlQ29tbWVudDcxMDQ4NzA4Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-10-16T19:34:10Z", "updated_at": "2020-10-19T17:39:04Z", "author_association": "OWNER", "body": "Alternatively, I could expose a single object that knows how to construct all kinds of URLs. Something like this:\r\n```\r\n{{ urls.instance() }}\r\n{{ urls.database(database_name) }}\r\n{{ urls.table(database_name, table_name) }}\r\netc\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 663228985, "label": "datasette.urls.table() / .instance() / .database() methods for constructing URLs, also exposed to templates"}, "performed_via_github_app": null}