-
-
Notifications
You must be signed in to change notification settings - Fork 772
Closed
Labels
Description
That plugin hook's current signature is:
datasette/datasette/hookspecs.py
Lines 28 to 30 in 6104254
@hookspec | |
def prepare_jinja2_environment(env): | |
"""Modify Jinja2 template environment e.g. register custom template tags""" |
As a result in the first alpha release of datasette-edit-templates
I had to include this horrific hack: https://github.com/simonw/datasette-edit-templates/blob/087f6a6cabc20020f2b0524f11aa3a7836320848/datasette_edit_templates/__init__.py#L72-L75
@hookimpl
def prepare_jinja2_environment(env):
# TODO: This should ideally take datasette, but that's not an argument yet
datasette = inspect.currentframe().f_back.f_back.f_back.f_back.f_locals["self"]