Re: Can I use a calculated value for a key to a dictionary?

2014-09-19 Thread Tom Evans
On Fri, Sep 19, 2014 at 11:13 AM, James Schneider wrote: > Scratch that, I misread what you were trying to do, but became clear when I > looked at your context a bit closer. You want to concatenate two strings and > use that as the variable lookup. > > You can probably do

Re: Can I use a calculated value for a key to a dictionary?

2014-09-19 Thread James Schneider
Scratch that, I misread what you were trying to do, but became clear when I looked at your context a bit closer. You want to concatenate two strings and use that as the variable lookup. You can probably do that using a combination of the {% with %} tag and the 'add' filter (which works on strings

Re: Can I use a calculated value for a key to a dictionary?

2014-09-19 Thread James Schneider
Instead of "for team in {{l}}{{d}}" you should be able to do "for team in l.d" IIRC. TBH I haven't tried it and I'm on my phone so I can't run a quick check. This SO post also has some hints on running nested loops:

Can I use a calculated value for a key to a dictionary?

2014-09-18 Thread Joel Goldstick
I have some embed loops which iterate over league and division. I want to print the teams in each. I obviously can't do what i tried in line 19. Is there a way to calculate a key to a dictionary I want to iterate over? 14{% for l in leagues %} 15 {{l}} 16 {% for d in divisions %} 17 {{d}} 18