t=[]
t.append(("a",1))
t.append(("b",2))
t.append(("c",3))
return render_to_response(t.html, context_instance=RequestContext(request, {'t':t}))
How can I access a value of t
in Django templates without using a for
loop? I have tried the following and it doesn't seem to work:
alert('{{t[a]}}');
alert('{{t[c]}}');