Re: List all categories, list all objects within these categories

2006-08-05 Thread [EMAIL PROTECTED]
Oww... Todd, thank you too! At least both of you came up with an identical solution :) Cello --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: List all categories, list all objects within these categories

2006-08-05 Thread Todd O'Bryan
In your view code, include { 'categories':BookCategory.objects.all () } in your context. Then, in the template {% for cat in categories %} {{ cat }} {% for book in cat.book_set.all %} {{ book }} {% endfor %} {% endfor %} This assumes you have the

Re: List all categories, list all objects within these categories

2006-08-05 Thread [EMAIL PROTECTED]
Hello Jonathan, Thank you for your quick reply. Works fine! Bye, Cello --~--~-~--~~~---~--~~ 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

Re: List all categories, list all objects within these categories

2006-08-05 Thread Jonathan Buchanan
[EMAIL PROTECTED] wrote: > Hi, > > Using the models below, I want a single page to show: > > bookcategory1 > book1 > book2 > bookcategory2 > book1 > book2 > ... > bookcategory3 > ... > ... > ... > > ## > > # Models > >

List all categories, list all objects within these categories

2006-08-05 Thread [EMAIL PROTECTED]
Hi, Using the models below, I want a single page to show: bookcategory1 book1 book2 bookcategory2 book1 book2 ... bookcategory3 ... ... ... ## # Models class BookCategory(models.Model): ... class