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
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
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
[EMAIL PROTECTED] wrote:
> Hi,
>
> Using the models below, I want a single page to show:
>
> bookcategory1
> book1
> book2
> bookcategory2
> book1
> book2
> ...
> bookcategory3
> ...
> ...
> ...
>
> ##
>
> # Models
>
>
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
5 matches
Mail list logo