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/1202#issuecomment-766464136 | https://api.github.com/repos/simonw/datasette/issues/1202 | 766464136 | MDEyOklzc3VlQ29tbWVudDc2NjQ2NDEzNg== | 9599 | 2021-01-25T00:01:02Z | 2021-01-25T00:01:02Z | OWNER | I'm going to use the existing `.. warning::` pattern for this. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
792931244 | |
https://github.com/simonw/datasette/issues/1154#issuecomment-766465719 | https://api.github.com/repos/simonw/datasette/issues/1154 | 766465719 | MDEyOklzc3VlQ29tbWVudDc2NjQ2NTcxOQ== | 9599 | 2021-01-25T00:09:22Z | 2021-01-25T00:09:22Z | OWNER | https://docs.datasette.io/en/latest/internals.html#the-internal-database <img width="738" alt="Internals_for_plugins_—_Datasette_documentation" src="https://user-images.githubusercontent.com/9599/105648087-76eb4900-5e5e-11eb-9c73-c00ba37b7b10.png"> | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
771208009 | |
https://github.com/simonw/datasette/issues/1191#issuecomment-766466030 | https://api.github.com/repos/simonw/datasette/issues/1191 | 766466030 | MDEyOklzc3VlQ29tbWVudDc2NjQ2NjAzMA== | 9599 | 2021-01-25T00:11:04Z | 2021-01-25T00:11:04Z | OWNER | I can combine this with #987 - each of these areas of the page can be wrapped in a `<div>` with a class that matches the name of the plugin hook, that way JavaScript plugins can append their content in the same place as Python plugins. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
787098345 | |
https://github.com/simonw/datasette/issues/1179#issuecomment-766484257 | https://api.github.com/repos/simonw/datasette/issues/1179 | 766484257 | MDEyOklzc3VlQ29tbWVudDc2NjQ4NDI1Nw== | 9599 | 2021-01-25T01:30:57Z | 2021-01-25T01:30:57Z | OWNER | The challenge here is figuring out what the original path, without the `.format`, actually was - while taking into account that Datasette has a special case for tables that themselves end in a `.something`. The `path_with_format()` function nearly does what we need here: https://github.com/simonw/datasette/blob/b6a7b58fa01af0cd5a5e94bd17d686d283a46819/datasette/utils/__init__.py#L710-L729 It can be called with `replace_format="csv"` to REMOVE the `.csv` format and replace it with something else. Problem is, we want to use it to get rid of the format entirely. We could update `path_with_format()` to accept `format=''` to mean "remove the format entirely", but it's a bit messy. It may be better to reconsider the design of `path_with_format()` and related utility functions entirely. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
780278550 | |
https://github.com/simonw/datasette/issues/1179#issuecomment-766484435 | https://api.github.com/repos/simonw/datasette/issues/1179 | 766484435 | MDEyOklzc3VlQ29tbWVudDc2NjQ4NDQzNQ== | 9599 | 2021-01-25T01:31:36Z | 2021-01-25T01:31:36Z | OWNER | Relevant existing tests: https://github.com/simonw/datasette/blob/461670a0b87efa953141b449a9a261919864ceb3/tests/test_utils.py#L365-L398 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
780278550 | |
https://github.com/simonw/datasette/issues/983#issuecomment-766484915 | https://api.github.com/repos/simonw/datasette/issues/983 | 766484915 | MDEyOklzc3VlQ29tbWVudDc2NjQ4NDkxNQ== | 9599 | 2021-01-25T01:33:29Z | 2021-01-25T01:33:29Z | OWNER | I'm going to ship a version of this in Datasette 0.54 with a warning that the interface should be considered unstable (see #1202) so that we can start trying this out. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
712260429 | |
https://github.com/simonw/datasette/issues/1167#issuecomment-766487520 | https://api.github.com/repos/simonw/datasette/issues/1167 | 766487520 | MDEyOklzc3VlQ29tbWVudDc2NjQ4NzUyMA== | 9599 | 2021-01-25T01:44:43Z | 2021-01-25T01:44:43Z | OWNER | Thanks @benpickles, I just merged that in. I'll use it in the documentation. # To check code is conformant npm run prettier -- --check # To fix it if it isn't npm run fix | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
777145954 | |
https://github.com/simonw/datasette/issues/1167#issuecomment-766491566 | https://api.github.com/repos/simonw/datasette/issues/1167 | 766491566 | MDEyOklzc3VlQ29tbWVudDc2NjQ5MTU2Ng== | 9599 | 2021-01-25T02:01:19Z | 2021-01-25T02:01:19Z | OWNER | New documentation section here (I documented Black as well): https://docs.datasette.io/en/latest/contributing.html#code-formatting | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
777145954 | |
https://github.com/simonw/datasette/issues/1194#issuecomment-766491911 | https://api.github.com/repos/simonw/datasette/issues/1194 | 766491911 | MDEyOklzc3VlQ29tbWVudDc2NjQ5MTkxMQ== | 9599 | 2021-01-25T02:02:15Z | 2021-01-25T02:02:15Z | OWNER | I'm going to copy across anything starting with an underscore. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
788447787 | |
https://github.com/simonw/datasette/issues/1191#issuecomment-766523866 | https://api.github.com/repos/simonw/datasette/issues/1191 | 766523866 | MDEyOklzc3VlQ29tbWVudDc2NjUyMzg2Ng== | 9599 | 2021-01-25T03:58:34Z | 2021-01-25T03:58:34Z | OWNER | I've got a good prototype working now, but I'm dropping this from the Datasette 0.54 milestone because it requires a bunch of additional work to make sure it is really well tested and documented. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
787098345 | |
https://github.com/simonw/datasette/issues/1191#issuecomment-766524016 | https://api.github.com/repos/simonw/datasette/issues/1191 | 766524016 | MDEyOklzc3VlQ29tbWVudDc2NjUyNDAxNg== | 9599 | 2021-01-25T03:59:17Z | 2021-01-25T03:59:17Z | OWNER | More work can happen in the PR: #1204 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
787098345 | |
https://github.com/simonw/datasette/issues/987#issuecomment-766524141 | https://api.github.com/repos/simonw/datasette/issues/987 | 766524141 | MDEyOklzc3VlQ29tbWVudDc2NjUyNDE0MQ== | 9599 | 2021-01-25T03:59:55Z | 2021-01-25T03:59:55Z | OWNER | This is joined with #1191 now, which I've bumped from 0.54. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
712984738 | |
https://github.com/simonw/datasette/pull/1204#issuecomment-766525337 | https://api.github.com/repos/simonw/datasette/issues/1204 | 766525337 | MDEyOklzc3VlQ29tbWVudDc2NjUyNTMzNw== | 9599 | 2021-01-25T04:04:28Z | 2021-01-25T04:04:28Z | OWNER | Writing the tests will be a bit tricky since we need to confirm that the `include_table_top(datasette, database, actor, table)` arguments were all passed correctly but the only thing we get back from the plugin is a list of templates. Maybe encode those values into the template names somehow? | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
793002853 | |
https://github.com/simonw/datasette/issues/1195#issuecomment-766534634 | https://api.github.com/repos/simonw/datasette/issues/1195 | 766534634 | MDEyOklzc3VlQ29tbWVudDc2NjUzNDYzNA== | 9599 | 2021-01-25T04:38:30Z | 2021-01-25T04:38:30Z | OWNER | This has proved surprisingly difficult to implement, due to the weird way the QueryView is actually called. The class itself isn't used like other view classes - instead, the `.data()` methods of both `DatabaseView` and `TableView` dispatch out to `QueryView.data()` when they need to: https://github.com/simonw/datasette/blob/07e163561592c743e4117f72102fcd350a600909/datasette/views/table.py#L259-L270 https://github.com/simonw/datasette/blob/07e163561592c743e4117f72102fcd350a600909/datasette/views/table.py#L290-L294 https://github.com/simonw/datasette/blob/07e163561592c743e4117f72102fcd350a600909/datasette/views/database.py#L39-L44 It turns out this is a bad pattern because it makes changes like this one WAY harder than they should be. I think I should clean this up as part of #878. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
789336592 | |
https://github.com/simonw/datasette/issues/1195#issuecomment-766534748 | https://api.github.com/repos/simonw/datasette/issues/1195 | 766534748 | MDEyOklzc3VlQ29tbWVudDc2NjUzNDc0OA== | 9599 | 2021-01-25T04:38:56Z | 2021-01-25T04:38:56Z | OWNER | Here's a diff showing how far I got before I abandoned this particular effort: ```diff diff --git a/datasette/views/base.py b/datasette/views/base.py index a21b929..04e4aa9 100644 --- a/datasette/views/base.py +++ b/datasette/views/base.py @@ -120,7 +120,7 @@ class BaseView: handler = getattr(self, request.method.lower(), None) return await handler(request, *args, **kwargs) - async def render(self, templates, request, context=None): + async def render(self, templates, request, context=None, view_name=None): context = context or {} template = self.ds.jinja_env.select_template(templates) template_context = { @@ -135,7 +135,7 @@ class BaseView: } return Response.html( await self.ds.render_template( - template, template_context, request=request, view_name=self.name + template, template_context, request=request, view_name=view_name ) ) @@ -155,7 +155,7 @@ class BaseView: class DataView(BaseView): - name = "" + view_name = "no-view-name" re_named_parameter = re.compile(":([a-zA-Z0-9_]+)") async def options(self, request, *args, **kwargs): @@ -414,6 +414,10 @@ class DataView(BaseView): args["table"] = urllib.parse.unquote_plus(args["table"]) return _format, args + async def get_view_name(self, request, database, hash, **kwargs): + # Defaults to self.view_name, but can be over-ridden by subclasses + return self.view_name + async def view_get(self, request, database, hash, correct_hash_provided, **kwargs): _format, kwargs = await self.get_format(request, database, kwargs) @@ -424,6 +428,8 @@ class DataView(BaseView): # HTML views default to expanding all foreign key labels kwargs["default_labels"] = True + view_name = await self.get_view_name(request, database, hash, **kwargs) + extra_template_data = {} … | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
789336592 | |
https://github.com/simonw/datasette/issues/1195#issuecomment-766535046 | https://api.github.com/repos/simonw/datasette/issues/1195 | 766535046 | MDEyOklzc3VlQ29tbWVudDc2NjUzNTA0Ng== | 9599 | 2021-01-25T04:40:08Z | 2021-01-25T04:40:08Z | OWNER | Also: should the view name really be the same for both of these pages? - https://latest.datasette.io/fixtures?sql=select+*+from+facetable - https://latest.datasette.io/fixtures/neighborhood_search Where one of them is a canned query and the other is an arbitrary query? | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
789336592 | |
https://github.com/simonw/datasette/issues/983#issuecomment-766536076 | https://api.github.com/repos/simonw/datasette/issues/983 | 766536076 | MDEyOklzc3VlQ29tbWVudDc2NjUzNjA3Ng== | 9599 | 2021-01-25T04:43:53Z | 2021-01-25T04:43:53Z | OWNER | ... actually not going to include this in 0.54, I need to write a couple of plugins myself using it before I even make it available in preview. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
712260429 | |
https://github.com/simonw/datasette/issues/1201#issuecomment-766543387 | https://api.github.com/repos/simonw/datasette/issues/1201 | 766543387 | MDEyOklzc3VlQ29tbWVudDc2NjU0MzM4Nw== | 9599 | 2021-01-25T05:07:40Z | 2021-01-25T05:13:29Z | OWNER | Changes: https://github.com/simonw/datasette/compare/0.53...a5ede3cdd455e2bb1a1fb2f4e1b5a9855caf5179 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
792904595 | |
https://github.com/simonw/datasette/issues/1201#issuecomment-766545442 | https://api.github.com/repos/simonw/datasette/issues/1201 | 766545442 | MDEyOklzc3VlQ29tbWVudDc2NjU0NTQ0Mg== | 9599 | 2021-01-25T05:13:59Z | 2021-01-25T05:13:59Z | OWNER | The big stuff: - Database(memory_name=) for shared in-memory databases, closes #1151 - The `_internal` database - #1150 - script type=module support, closes #1186 , #1187 - Improved design for the `.add_database()` method 8919f99c2f7f245aca7f94bd53d5ac9d04aa42b5 - which means databases with the same stem can now be opened, #509 - Adopted Prettier #1166 Smaller: - force_https_urls on for publish cloudrun, refs #1178 - Fixed bug in example nginx config, refs #1091 - Shrunk ecosystem docs in favour of datasette.io, closes #1182 - request.full_path property, closes #1184 - Better PRAGMA error message, closes #1185 - publish heroku now uses python-3.8.7 - Plugin testing documentation on using pytest-httpx Closes #1198 - Contributing docs for Black and Prettier, closes #1167 - All ?_ parameters now copied to hidden form fields, closes #1194 - Fixed bug loading database called 'test-database (1).sqlite' - Closes #1181. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
792904595 | |
https://github.com/simonw/datasette/issues/1201#issuecomment-766545604 | https://api.github.com/repos/simonw/datasette/issues/1201 | 766545604 | MDEyOklzc3VlQ29tbWVudDc2NjU0NTYwNA== | 9599 | 2021-01-25T05:14:31Z | 2021-01-25T05:14:31Z | OWNER | The two big ticket items are `<script type="module">` support and the new `_internal` mechanism. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
792904595 | |
https://github.com/simonw/datasette/issues/1201#issuecomment-766586151 | https://api.github.com/repos/simonw/datasette/issues/1201 | 766586151 | MDEyOklzc3VlQ29tbWVudDc2NjU4NjE1MQ== | 9599 | 2021-01-25T06:44:43Z | 2021-01-25T06:44:43Z | OWNER | OK, release notes are ready to merge from that branch. I'll ship the release in the morning, to give me time to write the accompanying annotated release notes. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
792904595 | |
https://github.com/simonw/datasette/pull/1206#issuecomment-766588020 | https://api.github.com/repos/simonw/datasette/issues/1206 | 766588020 | MDEyOklzc3VlQ29tbWVudDc2NjU4ODAyMA== | 9599 | 2021-01-25T06:48:20Z | 2021-01-25T06:48:20Z | OWNER | Issues to reference in the commit message: #509, #1091, #1150, #1151, #1166, #1167, #1178, #1181, #1182, #1184, #1185, #1186, #1187, #1194, #1198 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
793086333 | |
https://github.com/simonw/datasette/pull/1206#issuecomment-766588371 | https://api.github.com/repos/simonw/datasette/issues/1206 | 766588371 | MDEyOklzc3VlQ29tbWVudDc2NjU4ODM3MQ== | 9599 | 2021-01-25T06:49:06Z | 2021-01-25T06:49:06Z | OWNER | Last thing to do: write up the annotated version of these release notes, assign it a URL on my blog and link to it from the release notes here so I can publish them simultaneously. | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
793086333 | |
https://github.com/simonw/datasette/pull/1206#issuecomment-766589070 | https://api.github.com/repos/simonw/datasette/issues/1206 | 766589070 | MDEyOklzc3VlQ29tbWVudDc2NjU4OTA3MA== | 22429695 | 2021-01-25T06:50:30Z | 2021-01-25T17:31:11Z | NONE | # [Codecov](https://codecov.io/gh/simonw/datasette/pull/1206?src=pr&el=h1) Report > Merging [#1206](https://codecov.io/gh/simonw/datasette/pull/1206?src=pr&el=desc) (06480e1) into [main](https://codecov.io/gh/simonw/datasette/commit/a5ede3cdd455e2bb1a1fb2f4e1b5a9855caf5179?el=desc) (a5ede3c) will **not change** coverage. > The diff coverage is `100.00%`. [![Impacted file tree graph](https://codecov.io/gh/simonw/datasette/pull/1206/graphs/tree.svg?width=650&height=150&src=pr&token=eSahVY7kw1)](https://codecov.io/gh/simonw/datasette/pull/1206?src=pr&el=tree) ```diff @@ Coverage Diff @@ ## main #1206 +/- ## ======================================= Coverage 91.53% 91.53% ======================================= Files 32 32 Lines 3947 3947 ======================================= Hits 3613 3613 Misses 334 334 ``` | [Impacted Files](https://codecov.io/gh/simonw/datasette/pull/1206?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [datasette/version.py](https://codecov.io/gh/simonw/datasette/pull/1206/diff?src=pr&el=tree#diff-ZGF0YXNldHRlL3ZlcnNpb24ucHk=) | `100.00% <100.00%> (ø)` | | ------ [Continue to review full report at Codecov](https://codecov.io/gh/simonw/datasette/pull/1206?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/simonw/datasette/pull/1206?src=pr&el=footer). Last update [a5ede3c...571476d](https://codecov.io/gh/simonw/datasette/pull/1206?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments). | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
793086333 | |
https://github.com/simonw/datasette/issues/1201#issuecomment-766991680 | https://api.github.com/repos/simonw/datasette/issues/1201 | 766991680 | MDEyOklzc3VlQ29tbWVudDc2Njk5MTY4MA== | 9599 | 2021-01-25T17:42:21Z | 2021-01-25T17:42:21Z | OWNER | https://docs.datasette.io/en/stable/changelog.html#v0-54 | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
792904595 |