Re: proposal: forloop previous and next

2009-01-27 Thread Santiago Perez
> I can't really imagine that this situation is all that common. I'm not > saying it's never used, but the barrier is a bit higher than just "more > than one person uses this". Maybe it's just me, but in all 3 projects I have faced with django so far I have had to work around this, the most usual

Re: proposal: forloop previous and next

2009-01-27 Thread Ludvig Ericson
On Mon, 2009-01-26 at 16:16 -0200, Santiago Perez wrote: > Hi, I found myself needing to reference the previous or next element > of a list within a for loop of a template. > I think it would be pretty easy to implement the following extra > members to the forloop context variable: [snip] Though

Re: proposal: forloop previous and next

2009-01-26 Thread Malcolm Tredinnick
On Mon, 2009-01-26 at 16:16 -0200, Santiago Perez wrote: > Hi, I found myself needing to reference the previous or next element > of a list within a for loop of a template. > I think it would be pretty easy to implement the following extra > members to the forloop context variable: > > + forloop

Re: proposal: forloop previous and next

2009-01-26 Thread Rodrigo Guzman
I have also needed this in the past and just hacked the forloop code to provide the variables. I can make a patch available with a couple of tests if there is interest in including this. On Mon, Jan 26, 2009 at 2:55 PM, Tim Chase wrote: > > Santiago Perez wrote: >> Hi, I found myself needing to

Re: proposal: forloop previous and next

2009-01-26 Thread Tim Chase
Santiago Perez wrote: > Hi, I found myself needing to reference the previous or next > element of a list within a for loop of a template. I think it > would be pretty easy to implement the following extra members > to the forloop context variable: > > + forloop.next_element > + forloop.next_coun

proposal: forloop previous and next

2009-01-26 Thread Santiago Perez
Hi, I found myself needing to reference the previous or next element of a list within a for loop of a template. I think it would be pretty easy to implement the following extra members to the forloop context variable: + forloop.next_element + forloop.next_counter + forloop.next_counter0 + for