>If the templates allowed more complex logic, template designers might
>be tempted to write a template that reads "if
>last_payment.before(today - 1 year) and not admin". However, this
>encodes a business logic decision in the template. Since the template
>language does not allow complex queries, the designer cannot do this,
>so they must establish their high level design requirements, and ask
>the view developer to provide the appropriate context values - thereby
>keeping business logic in the view, where it belongs.

This is especially true if the templates are managed by the Web
designer. Designers are not necessarily programmers - for them a "{% if
subscribe %} ... {% else %} ... {% endif %}" is much easier to
understand than a more complex if expression that combines different
conditions with AND and OR (not to speak about the problem of operator
precedence, where you would have to define what operator has precedence
over the other and possibly have to provide bracket-grouping of
expressions - which all will make the parser for the if template tag
more complex).

For programmers, who need more complex templating, there allways is the
possibility to use Cheetah or something like that.

bye, Georg

Reply via email to