{"html_url": "https://github.com/simonw/datasette/issues/227#issuecomment-603534725", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/227", "id": 603534725, "node_id": "MDEyOklzc3VlQ29tbWVudDYwMzUzNDcyNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-03-24T22:19:54Z", "updated_at": "2020-03-24T22:19:54Z", "author_association": "OWNER", "body": "I think the [extra_template_vars()](https://datasette.readthedocs.io/en/stable/plugins.html#extra-template-vars-template-database-table-view-name-request-datasette) hook covers this.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 315960272, "label": "prepare_context() plugin hook"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/227#issuecomment-439194286", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/227", "id": 439194286, "node_id": "MDEyOklzc3VlQ29tbWVudDQzOTE5NDI4Ng==", "user": {"value": 222245, "label": "carlmjohnson"}, "created_at": "2018-11-15T21:20:37Z", "updated_at": "2018-11-15T21:20:37Z", "author_association": "NONE", "body": "I'm diving back into https://salaries.news.baltimoresun.com and what I really want is the ability to inject the request into my context.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 315960272, "label": "prepare_context() plugin hook"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/227#issuecomment-382967238", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/227", "id": 382967238, "node_id": "MDEyOklzc3VlQ29tbWVudDM4Mjk2NzIzOA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-20T03:58:09Z", "updated_at": "2018-04-20T03:58:09Z", "author_association": "OWNER", "body": "Maybe prepare_table_data() vs prepare_table_context()", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 315960272, "label": "prepare_context() plugin hook"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/227#issuecomment-382966604", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/227", "id": 382966604, "node_id": "MDEyOklzc3VlQ29tbWVudDM4Mjk2NjYwNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-20T03:54:56Z", "updated_at": "2018-04-20T03:54:56Z", "author_association": "OWNER", "body": "Should this differentiate between preparing the data to be sent back as JSON and preparing the context for the template?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 315960272, "label": "prepare_context() plugin hook"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/227#issuecomment-382964794", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/227", "id": 382964794, "node_id": "MDEyOklzc3VlQ29tbWVudDM4Mjk2NDc5NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-20T03:45:18Z", "updated_at": "2018-04-20T03:45:18Z", "author_association": "OWNER", "body": "What if the context needs to make await calls?\r\n\r\nOne possible option: plugins can either manipulate the context in place OR they can return an awaitable. If they do that, the caller will await it.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 315960272, "label": "prepare_context() plugin hook"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/227#issuecomment-382959857", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/227", "id": 382959857, "node_id": "MDEyOklzc3VlQ29tbWVudDM4Mjk1OTg1Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-20T03:21:43Z", "updated_at": "2018-04-20T03:21:43Z", "author_association": "OWNER", "body": "Plus a generic prepare_context() hook called in the common render method.\r\n\r\nprepare_context_table(), prepare_context_row() etc\r\n\r\nArguments are context, request, self (hence can access self.ds)\r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 315960272, "label": "prepare_context() plugin hook"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/227#issuecomment-382958693", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/227", "id": 382958693, "node_id": "MDEyOklzc3VlQ29tbWVudDM4Mjk1ODY5Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-20T03:15:52Z", "updated_at": "2018-04-20T03:15:52Z", "author_association": "OWNER", "body": "A better way to do this would be with many different plugin hooks, one for each view.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 315960272, "label": "prepare_context() plugin hook"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/227#issuecomment-382808266", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/227", "id": 382808266, "node_id": "MDEyOklzc3VlQ29tbWVudDM4MjgwODI2Ng==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-04-19T16:59:23Z", "updated_at": "2018-04-19T16:59:23Z", "author_association": "OWNER", "body": "Maybe this should have a second argument indicating which codepath was being handled. That way plugins could say \"only inject this extra context variable on the row page\".", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 315960272, "label": "prepare_context() plugin hook"}, "performed_via_github_app": null}