Sunday, October 30, 2011

Re: variables in a dict in a template

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 %}
> {{ hole.score }} {% endfor %} {% endfor%}
>
>
> Hopefully that helps a little :)

that was my original structure - but there was too much code required,
and after several years of using it, I still found difficulty in
understanding and upgrading it. The present structure is simple and
flexible - the only downside is that I have write some extra html.
Anyway it is just one template and I suppose I have to live with it.
--
regards
Kenneth Gonsalves

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment