mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Async support for prepare_jinja2_environment, closes #1809
This commit is contained in:
parent
2ebcffe222
commit
ddc999ad12
10 changed files with 76 additions and 9 deletions
|
|
@ -126,6 +126,12 @@ def permission_allowed(datasette, actor, action):
|
|||
return inner
|
||||
|
||||
|
||||
@hookimpl
|
||||
def prepare_jinja2_environment(env, datasette):
|
||||
env.filters["format_numeric"] = lambda s: f"{float(s):,.0f}"
|
||||
env.filters["to_hello"] = lambda s: datasette._HELLO
|
||||
|
||||
|
||||
@hookimpl
|
||||
def startup(datasette):
|
||||
async def inner():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue