Re: variables in a dict in a template

2011-10-31 Thread Bill Freeman
On Mon, Oct 31, 2011 at 2:36 AM, kenneth gonsalves wrote: > On Sun, 2011-10-30 at 12:00 -0400, Kurtis Mullins wrote: >> One way to go about it is to create multiple, nested objects. For >> example: >> >> Score - Rounds Holes >> >> Then in your template, you'd do something along the lines of:

Re: variables in a dict in a template

2011-10-30 Thread kenneth gonsalves
On Sun, 2011-10-30 at 12:00 -0400, Kurtis Mullins wrote: > One way to go about it is to create multiple, nested objects. For > example: > > Score - Rounds Holes > > Then in your template, you'd do something along the lines of: > > {% for round in game.rounds %} {% for hole in round.holes

Re: variables in a dict in a template

2011-10-30 Thread Kurtis Mullins
One way to go about it is to create multiple, nested objects. For example: Score - Rounds Holes Then in your template, you'd do something along the lines of: {% for round in game.rounds %} {% for hole in round.holes %} {{ hole.score }} {% endfor %} {% endfor%} Hopefully that helps a little

variables in a dict in a template

2011-10-30 Thread kenneth gonsalves
hi, I have a dict which I use to store golf scores to display. Template syntax is: {{pl.1.1.scores.1.sc}} for the first hole of the first round {{pl.1.2.scores.1.sc}} for the first hole of the second round {{pl.1.1.scores.2.sc}} for the second hole of the first round etc I want to do: {{pl.1.rou