Actually, after a nice strong cup of coffee, I figured I was doing this completely the wrong way. I added a get_pages method to the category which returns a queryset, then I supply the categories to the template and let the template ask the category for the pages.
Mike On 3/5/2007, "Mike H" <[EMAIL PROTECTED]> wrote: > > >Hi all, > >I have a list of wiki pages, each one has a category. > >I want to output them in a list, grouped by category. > >So far I am looping through each page and putting them into a dict, so >the end result looks like this : > >{'category_name': [page1,page2,page3],} > >Now I want to loop round that in my template and product a list that >looks like this : > ><h1>category_name</h1> ><ul> ><li>page1</li> ><li>page2</li> ><li>page3</li> ></ul> > >I'm at a loss as to how I can do that with django's templating. I can >look round the dict and output each category name, but how can I access >the list that contains the pages for that category? > >Thanks for any help! > >Mike > >> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---