Skip to content

A whole bunch more changes for jinja views / dashboards

20after4 requested to merge jinja-dashboards into main

The most important change included here is the view system in ddd_datasette.py there is a request url router that delegates to python modules in www/templates/views/*.py and then passes the variables from the model to a template with a matching filename (except the extension is html)

So the url /-/ddd/$page loads the python module from

www/templates/views/$page.py

which returns some variables for the view.

Then the variables are passed to a jinja template named

www/templates/views/$page.html

Also, canned queries are now loaded from sql files in www/sql/db_name/query_name

Finally, the function sql() can be called from templates and it can reference canned queries (See extra_template_vars in ddd_datasette.py)

Merge request reports