home / github / issue_comments

Menu
  • GraphQL API

issue_comments: 634865620

This data as json

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/581#issuecomment-634865620 https://api.github.com/repos/simonw/datasette/issues/581 634865620 MDEyOklzc3VlQ29tbWVudDYzNDg2NTYyMA== 9599 2020-05-27T18:44:06Z 2020-05-27T18:44:06Z OWNER The existing render callback takes the following arguments: > `args` - dictionary > The GET parameters of the request > > `data` - dictionary > The data to be rendered > > `view_name` - string > The name of the view where the renderer is being called. (`index`, `database`, `table`, and `row` are the most important ones.) The `data` argument is a bit of a problem, because it tightly couples plugins to a currently undocumented datastructure within Datasette. Here's how `datasette-atom` picks that apart for example: https://github.com/simonw/datasette-atom/blob/095941c23c81b70c4787cdeef873c556b573b5fa/datasette_atom/__init__.py#L15-L66 - it does things like access `data["query"]["sql"]` to figure out the SQL query that was used. I'm going to change the design of part of this ticket. I won't break the old `data` value just yet, but I'll mark it to be deprecated by Datasette 1.0. I think the only plugins using it right now are my `datasette-atom` and `datasette-ics` and @russss's [datasette-geo](https://github.com/russss/datasette-geo/blob/0d24c9fd782eeae8d136ee791143ee8cbf49ebdf/datasette_plugin_geo/__init__.py#L94-L101) so hopefully changing this won't cause any wider damage. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} 502993509  
Powered by Datasette · Queries took 0.905ms