Monday, October 26, 2009

Re: Django templates, break a for after an if

NMarcu kirjoitti:
> Hello all,
>
> I want to do something like this:
>
> {% for u in users %}
> {% for su in superu %}
> {% ifequal u su %}
> //do something end exit
> from this for
> {% endifequal %}
> {% endfor %}
> {% endfor %}
>
> How can I do this?

You can't and shouldn't. It's template language, not progamming
language. It's function to define _how_ to show data.

You need to make that decision in a view which is meant for extracting
and preparing _what_ to show.

--
Jani Tiainen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate