newbie doubt: template value and rendering problem

0 views
Skip to first unread message

Vijayakumar Subburaj

unread,
Aug 24, 2008, 5:43:04 AM8/24/08
to Google App Engine
When a list of tuples passed from python as template_values to
template.render, I couldn't read it from template page. thanks in
advance.

code example snippet follows,

python,

my_list = []

for game in games:
my_list.append((game.a, game.b, game.c))

template_values = {
'my_list' : my_list
}

template,

{% for item in my_list %}
<div id="{% cycle row1,row2 %}">
<input name="cb_ip1" type="checkbox" value="{{item[1]}}"
onclick="take()" {{item[0]}}/>&nbsp;
<input name="cb_ip2" type="checkbox" value="{{item[1]}}"
onclick="drop()" />&nbsp;
{{item[2]}}
</div>
{% endfor %}

error is,

TemplateSyntaxError: Could not parse the remainder: [1]
Reply all
Reply to author
Forward
Message has been deleted
0 new messages