You could write a very simple filter to do this.  Something like
(untested):

def range(top):
    return xrange(0, top)

then use {% for i in someInt|range %}

I think it would still be better to pass it in the context--why can't
you do that?

-Jeff

On Dec 7, 5:12 pm, Berco Beute <[EMAIL PROTECTED]> wrote:
> Is there a template tag to turn an int into a sequence (like 'range')?
> What I want to do is populate a select widget with the numbers up to
> the int, like:
>
> ==========================
> <select>
>     {% for i in someInt.range %}
>         <option>{{i}}</option>
>     {% endfor %}
> </select>
> ==========================
>
> Passing the sequence through the context is not an option in my
> particular case.
>
> 2B
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to