George Sakkis writes:
> [...]
>
> To be honest, I never *had to* do it (in the strict sense) either
> but apparently others did ([1-4]). As for the "just put it in the
> view" argument, remember that until last month this was the
> response for people wanting "if" to be a bit smarter :)
People will want to do *everything* in the template. The lowest
rated snippet on djangosnippets currently is an {% exec %} tag. :-)
Therefore, it's important to enforce some discipline, so that the
templates don't become sort of PHP. I use "break" and "continue" a
lot, but I've never thought about it in templates. You can easily
prepare the list in the Python land.
Tsch�,
Torsten.
--
Torsten Bronger, aquisgrana, europa vetus
Jabber ID: torsten...@jabber.rwth-aachen.de
or http://bronger-jmp.appspot.com
George Sakkis writes:
> On Jul 5, 2:25�pm, Torsten Bronger <bron...@physik.rwth-aachen.de>
> wrote:
>
>> [...]
>>
>> People will want to do *everything* in the template. �The lowest
>> rated snippet on djangosnippets currently is an {% exec %}
>> tag. �:-)
>
> But then again there is a {% switch %} tag [1] that has 8/8
> positive votes, let alone the "smart" {% if %} tag that is at last
> part of Django now.
The question is whether non-programmers can handle it. In this
context, a smart if was a good thing to do because it just made a
necessary control structure more intuitive. But the other things
are simply bringing full-blown programming into templates. Besides,
it is *very* easy to migrate them into the Python code.