github
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/simonw/datasette/issues/1518#issuecomment-973681970 | https://api.github.com/repos/simonw/datasette/issues/1518 | 973681970 | IC_kwDOBm6k_c46CTUy | 9599 | 2021-11-19T02:56:31Z | 2021-11-19T02:56:53Z | OWNER | Here's where I got to with my hacked-together initial plugin prototype - it managed to render the table page with some rows on it (and a bunch of missing functionality such as filters): https://gist.github.com/simonw/281eac9c73b062c3469607ad86470eb2 <img width="899" alt="fixtures__roadside_attractions__4_rows_and__11__Liked___Twitter" src="https://user-images.githubusercontent.com/9599/142557265-6e10c808-5898-49ed-a8e3-7b5207b2872a.png"> | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 1058072543 | |
https://github.com/simonw/datasette/issues/1518#issuecomment-973682389 | https://api.github.com/repos/simonw/datasette/issues/1518 | 973682389 | IC_kwDOBm6k_c46CTbV | 9599 | 2021-11-19T02:57:39Z | 2021-11-19T02:57:39Z | OWNER | Ideally I'd like to execute the existing test suite against the new implementation - that would require me to solve this so I can replace the view with the plugin version though: - #1517 | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 1058072543 | |
https://github.com/simonw/datasette/issues/1518#issuecomment-973687978 | https://api.github.com/repos/simonw/datasette/issues/1518 | 973687978 | IC_kwDOBm6k_c46CUyq | 9599 | 2021-11-19T03:07:47Z | 2021-11-19T03:07:47Z | OWNER | I was wrong about that, you CAN over-ride default routes already. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 1058072543 | |
https://github.com/simonw/datasette/issues/1518#issuecomment-973698917 | https://api.github.com/repos/simonw/datasette/issues/1518 | 973698917 | IC_kwDOBm6k_c46CXdl | 9599 | 2021-11-19T03:26:18Z | 2021-11-19T03:29:03Z | OWNER | A (likely incomplete) list of features on the table page: - [ ] Display table/database/instance metadata - [ ] Show count of all results - [ ] Display table of results - [ ] Special table display treatment for URLs, numbers - [ ] Allow plugins to modify table cells - [ ] Respect `?_col=` and `?_nocol=` - [ ] Show interface for filtering by columns and operations - [ ] Show search box, support executing FTS searches - [ ] Sort table by specified column - [ ] Paginate table - [ ] Show facet results - [ ] Show suggested facets - [ ] Link to available exports - [ ] Display schema for table - [ ] Maybe it should show the SQL for the query too? - [ ] Handle various non-obvious querystring options, like `?_where=` and `?_through=` | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 1058072543 | |
https://github.com/simonw/datasette/issues/1518#issuecomment-973699424 | https://api.github.com/repos/simonw/datasette/issues/1518 | 973699424 | IC_kwDOBm6k_c46CXlg | 9599 | 2021-11-19T03:27:49Z | 2021-11-19T03:27:49Z | OWNER | My goal is to break up a lot of this functionality into separate methods. These methods can be executed in parallel by `asyncinject`, but more importantly they can be used to build a much better JSON representation, where the default representation is lighter and `?_extra=x` options can be used to execute more expensive portions and add them to the response. So the HTML version itself needs to be re-written to use those JSON extras. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 1058072543 | |
https://github.com/simonw/datasette/issues/1518#issuecomment-973700322 | https://api.github.com/repos/simonw/datasette/issues/1518 | 973700322 | IC_kwDOBm6k_c46CXzi | 9599 | 2021-11-19T03:30:30Z | 2021-11-19T03:30:30Z | OWNER | Right now the HTML version gets to cheat - it passes through objects that are not JSON serializable, including custom functions that can then be called by Jinja. I'm interested in maybe removing this cheating - if the HTML version could only request JSON-serializable extras those could be exposed in the API as well. It would also help cleanup the kind-of-nasty pattern I use in the current `BaseView` where everything returns both a bunch of JSON-serializable data AND an awaitable function that then gets to add extra things to the HTML context. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 1058072543 | |
https://github.com/simonw/datasette/issues/1518#issuecomment-973700549 | https://api.github.com/repos/simonw/datasette/issues/1518 | 973700549 | IC_kwDOBm6k_c46CX3F | 9599 | 2021-11-19T03:31:20Z | 2021-11-19T03:31:26Z | OWNER | ... and while I'm doing all of this I can rewrite the templates to not use those cheating magical functions AND document the template context at the same time, refs: - #1510. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 1058072543 | |
https://github.com/simonw/datasette/issues/1518#issuecomment-974285803 | https://api.github.com/repos/simonw/datasette/issues/1518 | 974285803 | IC_kwDOBm6k_c46Emvr | 9599 | 2021-11-19T17:56:48Z | 2021-11-19T18:14:30Z | OWNER | Very confused by this piece of code here: https://github.com/simonw/datasette/blob/1c13e1af0664a4dfb1e69714c56523279cae09e4/datasette/views/table.py#L37-L63 I added it in https://github.com/simonw/datasette/commit/754836eef043676e84626c4fd3cb993eed0d2976 - in the new world that should probably be replaced by pure JSON. Aha - this comment explains it: https://github.com/simonw/datasette/issues/521#issuecomment-505279560 > I think the trick is to redefine what a "cell_row" is. Each row is currently a list of cells: > > https://github.com/simonw/datasette/blob/6341f8cbc7833022012804dea120b838ec1f6558/datasette/views/table.py#L159-L163 > > I can redefine the row (the `cells` variable in the above example) as a thing-that-iterates-cells (hence behaving like a list) but that also supports `__getitem__` access for looking up cell values if you know the name of the column. The goal was to support neater custom templates like this: ```html+jinja {% for row in display_rows %} <h2 class="scientist">{{ row["First_Name"] }} {{ row["Last_Name"] }}</h2> ... ``` This may be an argument for continuing to allow non-JSON-objects through to the HTML templates. Need to think about that a bit more. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 1058072543 | |
https://github.com/simonw/datasette/issues/1518#issuecomment-974287570 | https://api.github.com/repos/simonw/datasette/issues/1518 | 974287570 | IC_kwDOBm6k_c46EnLS | 9599 | 2021-11-19T17:59:33Z | 2021-11-19T17:59:33Z | OWNER | I'm going to try leaning into the `asyncinject` mechanism a bit here. One method can execute and return the raw rows. Another can turn that into the default minimal JSON representation. Then a third can take that (or take both) and use it to inflate out the JSON that the HTML template needs, with those extras and with the rendered cells from plugins. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 1058072543 | |
https://github.com/simonw/datasette/issues/1518#issuecomment-974300823 | https://api.github.com/repos/simonw/datasette/issues/1518 | 974300823 | IC_kwDOBm6k_c46EqaX | 9599 | 2021-11-19T18:18:32Z | 2021-11-19T18:18:32Z | OWNER | > This may be an argument for continuing to allow non-JSON-objects through to the HTML templates. Need to think about that a bit more. I can definitely support this using pure-JSON - I could make two versions of the row available, one that's an array of cell objects and the other that's an object mapping column names to column raw values. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 1058072543 |