Skipping an item in a loop

2009-06-24 Thread Daniele Procida
I have a template in which I would like to do the following: {% for item in loop %} {% if [previous item].condition %} item.name {% endif %} {% endfor %} In other words, I want to do something with an item in the loop based on whether the *previous* item has some condition set.

Re: Skipping an item in a loop

2009-06-24 Thread James Gregory
On Jun 24, 11:15 am, "Daniele Procida" wrote: > I have a template in which I would like to do the following: > > {% for item in loop %} >     {% if [previous item].condition %} >         item.name >     {% endif %} > {% endfor %} > > In other words, I want to do something with an item in the lo

Re: Skipping an item in a loop

2009-06-24 Thread James Gregory
On Jun 24, 11:41 am, James Gregory wrote: > On Jun 24, 11:15 am, "Daniele Procida" > wrote: > > > > > I have a template in which I would like to do the following: > > > {% for item in loop %} > >     {% if [previous item].condition %} > >         item.name > >     {% endif %} > > {% endfor %}

Re: Skipping an item in a loop

2009-06-24 Thread Masklinn
On 24 Jun 2009, at 12:47 , James Gregory wrote: > On Jun 24, 11:41 am, James Gregory wrote: >> On Jun 24, 11:15 am, "Daniele Procida" >> wrote: >> >> >> >>> I have a template in which I would like to do the following: >> >>> {% for item in loop %} >>> {% if [previous item].condition %} >>>

Re: Skipping an item in a loop

2009-06-24 Thread James Gregory
On Jun 24, 12:11 pm, Masklinn wrote: > On 24 Jun 2009, at 12:47 , James Gregory wrote: > > > > > On Jun 24, 11:41 am, James Gregory wrote: > >> On Jun 24, 11:15 am, "Daniele Procida" > >> wrote: > > >>> I have a template in which I would like to do the following: > > >>> {% for item in loop %}

Re: Skipping an item in a loop

2009-06-24 Thread Daniele Procida
On Wed, Jun 24, 2009, James Gregory wrote: >> >>> I have a template in which I would like to do the following: >> >> >>> {% for item in loop %} >> >>>     {% if [previous item].condition %} >> >>>         item.name >> >>>     {% endif %} >> >>> {% endfor %} >> >> >>> In other words, I want to do