Re: If Statements inside For Loops

2010-01-11 Thread Karen Tracey
On Mon, Jan 11, 2010 at 1:02 PM, Dave Merwin wrote: > First of all, thanks to everyone for the help!!! > > I'm not getting any output after the else. Nothing displays in the > template. > > That is what is confusing. > > "Nothing displays in the template" sounds like either there is no user varia

Re: If Statements inside For Loops

2010-01-11 Thread Dave Merwin
First of all, thanks to everyone for the help!!! I'm not getting any output after the else. Nothing displays in the template. That is what is confusing. Dave On Jan 11, 8:58 am, Karen Tracey wrote: > On Mon, Jan 11, 2010 at 2:39 AM, Dave Merwin wrote: > > I have the following: > > > {% for gr

Re: If Statements inside For Loops

2010-01-11 Thread Karen Tracey
On Mon, Jan 11, 2010 at 2:39 AM, Dave Merwin wrote: > I have the following: > > {% for group in user.groups.all %} >{{ group.name }} >{% ifequal group.name "subscribed" %} >I'm subscribed >{% else %} >{{ group.name }} >{% endifequal %} > {% endfor %} > > The else p

Re: If Statements inside For Loops

2010-01-11 Thread G B Smith
If the docs are to be believed, {% ifequal %} does provide an option for an {% else %} clause. See http://docs.djangoproject.com/en/dev/ref/templates/builtins/#ifequal That said, I can't tell from the code above why it would not work. But if you are using Django dev version (post 1.1) then go for

Re: If Statements inside For Loops

2010-01-11 Thread andreas schmid
i think ifequal does not accept an else in the statement. Dave Merwin wrote: > I have the following: > > {% for group in user.groups.all %} > {{ group.name }} > {% ifequal group.name "subscribed" %} > I'm subscribed > {% else %} > {{ group.name }} > {% endifequal %}

If Statements inside For Loops

2010-01-10 Thread Dave Merwin
I have the following: {% for group in user.groups.all %} {{ group.name }} {% ifequal group.name "subscribed" %} I'm subscribed {% else %} {{ group.name }} {% endifequal %} {% endfor %} The else part of the statement is not rendering. What am I missing? Any help wel