jinja

Jinja2 returns "None" string for Google App Engine models

Google App Engine models, likeso: from google.appengine.ext.db import Model class M(Model): name = db.StringProperty() Then in a Jinja2 template called from a Django view with an in instance of M passed in as m: The name of this M is {{ m.name }}. When m is initialized without name being set, the following is printed: The ...

How can I make a simple counter with Jinja2 templates?

I have two for loops, both alike in dignity. I'd like to have a counter incremented during each inner iteration. For example, consider this template: from jinja2 import Template print Template(""" {% set count = 0 -%} {% for i in 'a', 'b', 'c' -%} {% for j in 'x', 'y', 'z' -%} i={{i}}, j={{j}}, count={{count}} {% set count =...

Using django-paging extension with Django and Jinja2/Coffin

Recently I switched my templating engine from default to Jinja2/Coffin. Everything works just fine but I'm having troubles trying to use Django/Jinja2 django-paging (http://linux.softpedia.com/get/Internet/HTTP-WWW-/django-paging-58496.shtml) extension in my project. There is an example how to use this extension with Jinja: {% with pag...

Set variable in jinja

Hello all, I would like to know how can I set a variable with another variable in jinja. I will explain, I have got a submenu and I would like show which link is active. I tried this: {% set active_link = {{recordtype}} -%} where recordtype is a variable given for my template Thanks, ...