I thought this was built into jinja, did you check?