Say I have this:
{% if files %}
Update
{% else %}
Continue
{% endif %}
In PHP, say, I can write a shorthand conditional, like:
<?php echo $foo ? 'yes' : 'no'; ?>
Is there then a way I can translate this to work in a jinja2 template:
'yes' if foo else 'no'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…