home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 733303548 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 2

  • simonw 5
  • codecov[bot] 1

author_association 2

  • OWNER 5
  • NONE 1

issue 1

  • load_template() plugin hook · 6 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
719657478 https://github.com/simonw/datasette/pull/1069#issuecomment-719657478 https://api.github.com/repos/simonw/datasette/issues/1069 MDEyOklzc3VlQ29tbWVudDcxOTY1NzQ3OA== codecov[bot] 22429695 2020-10-30T16:31:21Z 2020-10-30T17:46:36Z NONE

Codecov Report

Merging #1069 into main will increase coverage by 0.01%. The diff coverage is 95.83%.

```diff @@ Coverage Diff @@

main #1069 +/-

========================================== + Coverage 91.30% 91.32% +0.01%
========================================== Files 29 29
Lines 3736 3756 +20
========================================== + Hits 3411 3430 +19
- Misses 325 326 +1
```

| Impacted Files | Coverage Δ | | |---|---|---| | datasette/views/base.py | 93.94% <ø> (-0.04%) | :arrow_down: | | datasette/app.py | 96.38% <95.45%> (-0.05%) | :arrow_down: | | datasette/hookspecs.py | 100.00% <100.00%> (ø) | |


Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 222f79b...92f3840. Read the comment docs.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
load_template() plugin hook 733303548  
719672967 https://github.com/simonw/datasette/pull/1069#issuecomment-719672967 https://api.github.com/repos/simonw/datasette/issues/1069 MDEyOklzc3VlQ29tbWVudDcxOTY3Mjk2Nw== simonw 9599 2020-10-30T16:58:01Z 2020-10-30T16:58:01Z OWNER

OK, new hook specification is: python @hookspec(firstresult=True) def load_template(template, request, datasette): "Load the specified template, returning the template code as a string"

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
load_template() plugin hook 733303548  
719670714 https://github.com/simonw/datasette/pull/1069#issuecomment-719670714 https://api.github.com/repos/simonw/datasette/issues/1069 MDEyOklzc3VlQ29tbWVudDcxOTY3MDcxNA== simonw 9599 2020-10-30T16:53:56Z 2020-10-30T16:53:56Z OWNER

I'm having second thoughts about the design of the plugin hook.

Consider the following: python plugin_template_source = pm.hook.load_template( template=template_name, database=context.get("database"), table=context.get("table"), columns=context.get("columns"), view_name=self.name, request=request, datasette=self.ds, ) It's a bit gross that database, table and columns are pulled out of the context like that. This doesn't make sense for pages that are rendered by plugins, for example.

So maybe for the first release of this plugin hook I should cut it down to just seeing template, request and datasette. I can add the table/view/etc stuff back in later if it turns out to be necessary.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
load_template() plugin hook 733303548  
719666912 https://github.com/simonw/datasette/pull/1069#issuecomment-719666912 https://api.github.com/repos/simonw/datasette/issues/1069 MDEyOklzc3VlQ29tbWVudDcxOTY2NjkxMg== simonw 9599 2020-10-30T16:47:44Z 2020-10-30T16:47:44Z OWNER

Bringing over a comment from #1042:

I'd like to do this all in the datasette.render_template() method to ensure it's available to plugins as well, not just core code that uses the BaseView class.

This code is the problem:

https://github.com/simonw/datasette/blob/d3e9b0aecb6f8e9b2befd9c654ccb7ce852db3e7/datasette/views/base.py#L114-L133

I think I'll fix this by moving the select_templates mechanism into datasette.render_templates().

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
load_template() plugin hook 733303548  
719664530 https://github.com/simonw/datasette/pull/1069#issuecomment-719664530 https://api.github.com/repos/simonw/datasette/issues/1069 MDEyOklzc3VlQ29tbWVudDcxOTY2NDUzMA== simonw 9599 2020-10-30T16:43:40Z 2020-10-30T16:43:40Z OWNER

I should include an example in the documentation that shows loading templates from a database table.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
load_template() plugin hook 733303548  
719640430 https://github.com/simonw/datasette/pull/1069#issuecomment-719640430 https://api.github.com/repos/simonw/datasette/issues/1069 MDEyOklzc3VlQ29tbWVudDcxOTY0MDQzMA== simonw 9599 2020-10-30T16:01:13Z 2020-10-30T16:01:13Z OWNER

Next steps: build a demonstration plugin against this.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
load_template() plugin hook 733303548  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

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]);
Powered by Datasette · Queries took 18.776ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows