Hello
I have a problem I cant get my head around.
I want to list through a bunch of people and see which one im friends
with and which ones i can add as a friend. sort of twitter style.
If it throw in an else it will hit on every step of the 2nd
(supporters) loop, I obviously want either supporter OR an add me
link.
{% for d in dreamers %}
<p>
<a href="/user/{{ dreamer.user }}">{{ d.user }}</a>
{% for s in supporters %}
{% ifequal d.id s.id %}
supporter
{% endifequal %}
{% endfor %}
</p>
{% endfor %
result:
johan
sven supporter
glen supporter
ben
ken
{% for d in dreamers %}
<p>
<a href="/user/{{ dreamer.user }}">{{ d.user }}</a>
{% for s in supporters %}
{% ifequal d.id s.id %}
supporter
{% else % }
add me!
{% endifequal %}
{% endfor %}
</p>
{% endfor %
result:
sven supporter add me!
glen add me! supporter
ben add me! add me!
ken add me! add me!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---