Re: range-like template tag?

2008-12-08 Thread Berco Beute
Ah! Of course, why didn't I think of that! Works like a charm. Thx! 2B On Dec 8, 7:23 pm, Adi Sieker <[EMAIL PROTECTED]> wrote: > Couldn't you add a method get_range() (or whatever name makes sense in   > your context) > to the class the object is an instqnce of. > The method would look somethin

Re: range-like template tag?

2008-12-08 Thread Adi Sieker
Hi, On 08.12.2008, at 17:30, Berco Beute wrote: > > The 'someInt' is an attribute of an object I pass to the template. It > varies with each object. I could of course make a dictionary with the > object and a list of the integers but it would be handy to solve it in > the template (although you

Re: range-like template tag?

2008-12-08 Thread Berco Beute
The 'someInt' is an attribute of an object I pass to the template. It varies with each object. I could of course make a dictionary with the object and a list of the integers but it would be handy to solve it in the template (although you may argue that such functionality should stay out of the vie

Re: range-like template tag?

2008-12-07 Thread Jeff FW
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 PROTECTE

range-like template tag?

2008-12-07 Thread Berco Beute
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: == {% for i in someInt.range %} {{i}} {% endfor %} == Passing the sequence