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

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -