Great idea.
Don't know why I didn't think of that ...

Thanks man,

d



On Jul 15, 12:48 am, Shawn Milochik <shawn.m...@gmail.com> wrote:
> On Jul 14, 2009, at 10:27 AM, The Danny Bos wrote:
>
>
>
> > Is there a way to create a simple list using Django to go from 1 to
> > 50.
> > Eg:
>
> > 1, 2, 3, 4, 5 ... 49, 50
>
> > I figured it'd be easy, but I can't get it.
> > I tried ...
>
> >    {% for i = 1 in 10 %}
> >      {{ i }},
> >    {% endfor %}
>
> > No go.
>
> There may be a better way, but why not just pass a range in the context?
>
> context = {'numbers': range(1,51)}
>
> Then you can do:
>
> {% for num in numbers %}
> ...
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to