Kless wrote:
> I'm building a dinamic list of links, and I want that been separated
> by '|' character.
>
> Note that 'foo' is a list
> ---------------
> {% for i in foo %}
> <a href="{% url test_foo i %}">{{ i }}</a>|
> {% endfor %}
> ---------------
> The problem is that I wantn't that last separator (because there isn't
> another field).
> How could be solved?
You might be able to use something like
{% for i in foo %}
< a href="{% url test_foo i %}">{{ i }}</a>
{% if forloop.revcounter0 %}|{% endif %}
{% endfor %}
or
{% for i in foo %}
< a href="{% url test_foo i %}">{{ i }}</a>
{% if forloop.last %}{% else %}|{% endif %}
{% endfor %}
-tim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---