Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion jinja - in lieu of enumerate and list comprehension
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Steven Kryskalla  
View profile  
 More options Aug 7 2012, 12:26 pm
From: Steven Kryskalla <skryska...@gmail.com>
Date: Tue, 7 Aug 2012 09:26:37 -0700
Local: Tues, Aug 7 2012 12:26 pm
Subject: Re: jinja - in lieu of enumerate and list comprehension

On Tue, Aug 7, 2012 at 12:26 AM, Andreas <achristoffer...@gmail.com> 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-logi...

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.