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 <kmtra...@gmail.com> wrote: > On Mon, Jan 11, 2010 at 2:39 AM, Dave Merwin <dave.mer...@gmail.com> wrote: > > I have the following: > > > {% for group in user.groups.all %} > > {{ group.name }} > > {% ifequal group.name "subscribed" %} > > <h1>I'm subscribed</h1> > > {% else %} > > {{ group.name }} > > {% endifequal %} > > {% endfor %} > > > The else part of the statement is not rendering. What am I missing? > > Any help welcome. > > This template code, when cut-and-pasted into a template used by a view that > uses RequestContext and when logged in as a user who belongs to two groups > (name subscribed and other), produces this output: > > subscribed I'm subscribed other other > > This is with Django 1.1.1. So the code posted appears to work fine. You > say the else part of the statement is not rendering, but you do not say what > output, exactly, you get, nor what output you are expecting for whatever > user you happen to have. What are you getting and how does it differ from > what you expect? > > Karen
-- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.