Re: template tag arithmetic

2011-01-18 Thread niall-oc
http://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#add There is loop.counter and loop.counter0. loop.counter starts from 1, and loop.counter0 starts from 0. The 3rd time through a for loop loop.counter is 3 and loop.counter0 is 2. If you want to add things try something li

Re: template tag arithmetic

2011-01-18 Thread Łukasz Rekucki
On 18 January 2011 15:46, Konrad Delong wrote: > On 18 January 2011 15:02, Thomas wrote: >> >> Am 18.01.2011 um 14:53 schrieb GD: >> >>> >>> Hi everyone, >>>     Is there a way to do simple loop counter manipulation within the >>> template? I.e something along the lines of: >>> >>> {% for x in a

Re: template tag arithmetic

2011-01-18 Thread Konrad Delong
On 18 January 2011 15:02, Thomas wrote: > > Am 18.01.2011 um 14:53 schrieb GD: > >> >> Hi everyone, >>     Is there a way to do simple loop counter manipulation within the >> template? I.e something along the lines of: >> >> {% for x in a %} >>      loop number = {{forloop.counter +1}} >> {% endfo

Re: template tag arithmetic

2011-01-18 Thread Thomas
Am 18.01.2011 um 14:53 schrieb GD: > > Hi everyone, > Is there a way to do simple loop counter manipulation within the > template? I.e something along the lines of: > > {% for x in a %} > loop number = {{forloop.counter +1}} > {% endfor %} > > with the intention of > > 2 > 3 > 4 > ..

template tag arithmetic

2011-01-18 Thread GD
Hi everyone, Is there a way to do simple loop counter manipulation within the template? I.e something along the lines of: {% for x in a %} loop number = {{forloop.counter +1}} {% endfor %} with the intention of 2 3 4 as output. I realise the above doesn't work, but is there any