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

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -