Hello,
Common task in template is doing for loop end inserting into html some
elements.
for example
1: {% for seller in sellers %}
2: {% for customer in customers %}
3: {% ifequal seller.customer_id customer.id %}
4: <p>{{ seller.name }} {{ customer.name }} </p>
5: {% endifequal %}
6: {% endfor %}
7: {% endfor %}
Thats clear.
Now I would like to know when the loop is over and system didnt't find
customer for seller (line 3). And in this case insert <p>no customers</
p>.
If it shouldnt be done in template how can I inject logic from python
file ?
thanks for help
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---