python - Clean up template code -
is there better way following? perhaps if/elif/else
?
{% if avail.allows_free_streaming %}free stream{% endif %} {% if avail.requires_paid_subscription %}subscription{% endif %} {% if not avail.requires_paid_subscription , not avail.allow_free_streaming %}n/a{% endif %}
yes, can use following approach:
{% if avail.allows_free_streaming %} free stream {% elif avail.requires_paid_subscription %} subscription {% else %} n/a {% endif %}
Comments
Post a Comment