Call a constructed variable name in Jinja2 template?
问题 Is there a way in Jinja2 to construct a variable name and then call it? I want to do something like this: {% for type in ('Students', 'Faculty', 'Groups') %} {% set import_name = 'latest_' + type|lower + '_import' %} {{ type }}: {{ import_name.created_at }} {% endfor %} I would expect the output to be something like this: Students: 5/26/2016 Faculty: 5/25/2016 Groups: 5/25/2016 I have the variables latest_students_import, latest_faculty_import, and latest_groups_import set in the template