issue_comments
4 rows where issue = 789336592
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
id ▼ | html_url | issue_url | node_id | user | created_at | updated_at | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
763108730 | https://github.com/simonw/datasette/issues/1195#issuecomment-763108730 | https://api.github.com/repos/simonw/datasette/issues/1195 | MDEyOklzc3VlQ29tbWVudDc2MzEwODczMA== | simonw 9599 | 2021-01-19T20:22:37Z | 2021-01-19T20:22:37Z | OWNER | I can use this test: https://github.com/simonw/datasette/blob/c38c42948cbfddd587729413fd6082ba352eaece/tests/test_plugins.py#L238-L294 | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | view_name = "query" for the query page 789336592 | |
766534634 | https://github.com/simonw/datasette/issues/1195#issuecomment-766534634 | https://api.github.com/repos/simonw/datasette/issues/1195 | MDEyOklzc3VlQ29tbWVudDc2NjUzNDYzNA== | simonw 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} | view_name = "query" for the query page 789336592 | |
766534748 | https://github.com/simonw/datasette/issues/1195#issuecomment-766534748 | https://api.github.com/repos/simonw/datasette/issues/1195 | MDEyOklzc3VlQ29tbWVudDc2NjUzNDc0OA== | simonw 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} | view_name = "query" for the query page 789336592 | |
766535046 | https://github.com/simonw/datasette/issues/1195#issuecomment-766535046 | https://api.github.com/repos/simonw/datasette/issues/1195 | MDEyOklzc3VlQ29tbWVudDc2NjUzNTA0Ng== | simonw 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} | view_name = "query" for the query page 789336592 |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [issue_comments] ( [html_url] TEXT, [issue_url] TEXT, [id] INTEGER PRIMARY KEY, [node_id] TEXT, [user] INTEGER REFERENCES [users]([id]), [created_at] TEXT, [updated_at] TEXT, [author_association] TEXT, [body] TEXT, [reactions] TEXT, [issue] INTEGER REFERENCES [issues]([id]) , [performed_via_github_app] TEXT); CREATE INDEX [idx_issue_comments_issue] ON [issue_comments] ([issue]); CREATE INDEX [idx_issue_comments_user] ON [issue_comments] ([user]);