If you have this in your view...

genre_list = Genre.objects.all()

Then you can do this in your template. Basically for each genre, you
are outputting the name, then looping through the list of credits
where genre = the current genre.

{% for genre in genre_list %}
    <h5>{{ genre.genre_type }}</h5>
    <ul>
    {% for credit in genre.credit_set.all %}
        <li>{{ credit.title }}</li>
    {% endfor %}
    </ul>
{% endfor %}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to