Generic Jinja2 template macros (notably for CRUD-like apps)