On Tue, Aug 7, 2012 at 12:26 AM, Andreas <[email protected]> wrote:
> The template designer documentation (thanks for the link) seems to hold a
> lot of possibilities. But I can't help feel that in some ways it creates a
> new language? A bit off topic I know - and maybe not a suitable question,
> but what is the advantage of this, over e.g. the web2py approach were there
> is no template language, just pure python and a `pass`variable? I could
> imagine jinja2 lighter?
>

Yes, jinja2 is a new language, it's not exactly the same syntax as
python. Using "|" and filters is one of the big differences. Jinja is
inspired by django's template system, which was very restrictive and
meant to be friendly for designers (who don't know python) to use.
Jinja gives a little more freedom than django's template system, but
still does not allow the full python language (e.g. defining classes,
using list comprehensions, etc.) to be used in templates. There is a
little more explanation here:

http://jinja.pocoo.org/docs/faq/#isn-t-it-a-terrible-idea-to-put-logic-into-templates

If you think that's a good tradeoff, then use jinja. If you would
rather use the full python language, try something like mako
(http://www.makotemplates.org/).

-- 
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pocoo-libs?hl=en.

Reply via email to