我将视图中的变量i传递给模板。 当我打印{{subject.i.id}}时,它不起作用。 plz帮助尽快。 谢谢。模板中的django变量
# the view
return render_to_response(
'feedback/feedback.html',
{'subjects': subject_list, 'n': n, 'list': sub_list, 'i': 0},
context_instance=RequestContext(request))
# the template
{% for s in list %}
<div id="{{ subjects.i.id }}">
{% for subject in s %}
<div> {{ subject }} </div>
{% endfor %}
</div>
{% endfor %}
你的代码.. 。? – 2010-11-15 13:54:22