Just after I sent the last reply, I went to change to filtering in the view. Then I realized why I didn't want to.
This loop is actually nested inside another (let's say it's an outer loop over blog posts, then an inner loop over tags for each post). To filter the tags, I have to loop over the posts in the view, and annotate each with a filtered list of tags. I'm already looping in the template, and don't need to loop in the view at all except to perform this filtering. To me, this is kind of ugly. Do-able, but unfortunate. --Ned. Todd O'Bryan wrote: > On Dec 28, 2007 2:46 PM, Ned Batchelder <[EMAIL PROTECTED]> wrote: > >> I'm making a list of objects, and only including some of them in the output: >> >> {% for thing in mylist %} >> {% if thing.test %} >> {{thing}} >> {% endif %} >> {% endfor %} >> >> > > Is there a compelling reason not to do the filtering in the view > before you even hit the template? > > Todd > > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---