As of coloring the bikeshed, I prefer {% empty %} over {% default %} and
{% else %}.
>>> for i in []:--Ned.
... print "boo"
... else:
... print "foo"
...
foo
>>>
-- Ned Batchelder, http://nedbatchelder.com
I'm wondering who that's going to confuse. It's very clear that the template language
isn't Python, so I'd think it'd make the most sense to use a keyword that makes sense
within the context of the template language. I'd think that either 'else' or 'ifnone' are the
most memorable/readable. 'default' connotes "unless we override ...", which isn't what's
going on here.
+1 for else
regards
Steve
{% for %} ... {% default %} .. {% endfor %}
... seems best.
Jacob
{% for %} ... {% empty %} ... {% endfor %}
I feel this says more than "default", which requires you to think about
when the default value is required.
regards
Steve
+1 to the otherwise tag :)
--
Antoni Aloy López
Blog: http://trespams.com
Site: http://apsl.net
Yay, I decide! Err, decided.. :) There is a patch attached to ticket
#6398 that implements "default".
Cheers,
Jannis