We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It turns out I need this for simonw/datasette-auth-github#5
It can be modelled on the extra_body_script hook: https://datasette.readthedocs.io/en/stable/plugins.html#extra-body-script-template-database-table-view-name-datasette
extra_body_script
The text was updated successfully, but these errors were encountered:
Example usage:
@hookimpl def extra_template_vars(request): return { "auth": request.scope.get("auth"), }
Sorry, something went wrong.
It should allow for awaitables too, to allow for execution of SQL. For example:
@hookimpl def extra_template_vars(datasette): async def inner(): first_db = list(datasette.databases.keys())[0] return { "sqlite_version": ( await datasette.execute(first_db, "select sqlite_version()") ).rows[0][0] } return inner
extra_template_vars plugin hook
e06e083
Refs #541
fcfcae2
extra_template_vars plugin hook (#542)
16d2035
* extra_template_vars plugin hook Closes #541 * Workaround for cwd bug Based on pytest-dev/pytest#1235 (comment)
42d6877
No branches or pull requests
It turns out I need this for simonw/datasette-auth-github#5
It can be modelled on the
extra_body_script
hook: https://datasette.readthedocs.io/en/stable/plugins.html#extra-body-script-template-database-table-view-name-datasetteThe text was updated successfully, but these errors were encountered: