30π
β
{% for a in array|slice:"1:" %}{{ a }}{% endfor %}
See https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#slice for more information.
π€Jeremy Lewis
9π
{% for a in array %}
{% if not forloop.first %}
{{ a }}
{% endif %}
{% endfor %}
There is of course forloop.last
for the last iteration as well.
They are all listed in the Django reference.
- Email integration
- Django admin β group permissions to edit or view models
- Is there a Django ModelField that allows for multiple choices, aside from ManyToMany?
- Drawing graphs in Django
2π
{% for a in array %}
{% if forloop.counter != 1 %}
{{ a }}
{% endif %}
{% endfor %}
π€Timmy O'Mahony
Source:stackexchange.com