4 ms·
You could do this multiple times in the same top-level template if you're a masochist. Just use jinja2's set command to setup local variables in the template. Y
by emidln 8y ago
You could do this multiple times in the same top-level template if you're a masochist. Just use jinja2's set command to setup local variables in the template. You can do awfully complicated logic in jinja2, it's just that almost nobody will pass that garbage in code review. It gets kicked up to the python layer where, being a full data structure and regular code, it is easier to organize, comment, and test.