I am learning wheezy.template from docs and after reading http://wheezytemplate.readthedocs.io/en/latest/userguide.html#filters I wrote the following code:
@require(user, items) <header>Welcome ji, @user.age!s old @user.name</header> @if items: <ul> @for count, i in enumerate(items): <li>@i.name: $ @i.price!s >> entry number @count!s</li> <li>@i.name: $ @i.price!s >> entry number @str(count+0.5)</li> <!-- <li>@i.name: $ @i.price!s - entry number @str(@count)</li> this mistake is intentional because comments should be ignored, right?--> @end </ul> @else: No items found. @end
supply some dummy data and see that line number 10 of the template code, which contains intentional mistake but is also commented out, raises scary errors.
This is bad, commenting is important and if this happens no one will be able to write good code.
P.S. My python generated data looks like:
from collections import namedtuple a_user = namedtuple("a_user", ["name", "age"]) item = namedtuple("item", ["name", "price"]) user = a_user("roger", 19) items = \ [ item("doll", 11.6) , item("cars", 99.4) , item("desk", 0.01) ]