Hey,
I'm trying to make a template that only reveals the first four items
of a list, and then handles the rest of the list in a different
respect, ie:
for item in list
if forloop.counter < 3 {
do something
} else {
do something else
}
but I can't come up with an eloquent way to do this in the django
template language. My ideas so far are as follows:
1. sending two lists from the view file (a bad idea because this has
to be repeated for five different lists)
2. doing an
{% ifequal __ %}
{% endifequal %}
{% ifequal __something else %}
{% endifequal %}
and so on, also not a terrific idea because it would mean having
like... 20 decision structures, and whatnot.
Any ideas are greatly appreciated!
Thanks
-Robert
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---