Re: dynamic variable in templates

2010-02-15 Thread Bill Freeman
Or a method on the project model, maybe called chain, that looks the project instance's name up in chains. The you could say "for item in project.chain", for example. On Sat, Feb 13, 2010 at 3:31 PM, Daniel Roseman wrote: > On Feb 13, 7:20 pm, Madis wrote: >> http://push.cx/2007/django-template

Re: dynamic variable in templates

2010-02-13 Thread Daniel Roseman
On Feb 13, 7:20 pm, Madis wrote: > http://push.cx/2007/django-template-tag-for-dictionary-access > > This is basically what I'm looking for but I'm not sure that this is > the best way to do this. Yes, this is the right way to do it. -- DR. -- You received this message because you are subscribe

Re: dynamic variable in templates

2010-02-13 Thread Madis
http://push.cx/2007/django-template-tag-for-dictionary-access This is basically what I'm looking for but I'm not sure that this is the best way to do this. On Feb 13, 8:55 pm, Madis wrote: > Sorry for not explaining it more: > > chain is a dictionary of lists chains {'project1': ['item1', 'item2

Re: dynamic variable in templates

2010-02-13 Thread Madis
Sorry for not explaining it more: chain is a dictionary of lists chains {'project1': ['item1', 'item2'], 'project2': ['item3']} So the key to the dictionary is basically a project name which I get when looping over the projects in the first loop. Now the second loop should be over the list of chai

Re: dynamic variable in templates

2010-02-13 Thread Karen Tracey
On Sat, Feb 13, 2010 at 1:30 PM, Madis wrote: > I'm trying to write the following but there seems to be no solution on > the web for this. > > In a template: > {% for project in projects %} > {% for chain in chains.project.name %} <--- project.name should be > dynamic > {% endfor %} > {% endfor

dynamic variable in templates

2010-02-13 Thread Madis
I'm trying to write the following but there seems to be no solution on the web for this. In a template: {% for project in projects %} {% for chain in chains.project.name %} <--- project.name should be dynamic {% endfor %} {% endfor %} -- You received this message because you are subscribed t