Skip to content

Instantly share code, notes, and snippets.

@artschwagerb
Created June 11, 2014 15:06
Show Gist options
  • Save artschwagerb/a310a23e215a11ce7ad1 to your computer and use it in GitHub Desktop.
Save artschwagerb/a310a23e215a11ce7ad1 to your computer and use it in GitHub Desktop.
Django - for loop range
{% for i in '123'|make_list %}
{% if object.property == i|add:"0" %}
<li>(Selected) Property {{ i }}</li>
{% else %}
<li>Property {{ i }}<li>
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment