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
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
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:
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
4 matches
Mail list logo