Jinja2 shorthand conditional Jinja2 shorthand conditional python python

Jinja2 shorthand conditional


Yes, it's possible to use inline if-expressions:

{{ 'Update' if files else 'Continue' }}


Alternative way (but it's not python style. It's JS style)

{{ files and 'Update' or 'Continue' }}