Re: danymic attributes in template

2010-06-04 Thread Tom Evans
On Fri, Jun 4, 2010 at 10:15 AM, ChuanRen wrote: > for example: > keys=[item1,item2] > obj={item1:1,item2:2} > > the template: > {%for key in keys%} >    {{obj.key}} > {%endfor%} > > In this example, the key in template will resolved to item1 and item2, > I thought: > {{obj.{{key > will work,

danymic attributes in template

2010-06-04 Thread ChuanRen
for example: keys=[item1,item2] obj={item1:1,item2:2} the template: {%for key in keys%} {{obj.key}} {%endfor%} In this example, the key in template will resolved to item1 and item2, I thought: {{obj.{{key will work, but it output a error. Any approach can solve this problem? -- You rec