Figured it out. Probably not the best approach but works.
Revised views.py
Revised views.py
class HomeView(ListView): model = Board context_object_name = 'categories' template_name = 'boards/forum.html' queryset = Board.objects.all() def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['subjects']=[] for titles in self.queryset: context['subjects'].append(Topic.objects.filter(board_id=titles.id)) return contextIn the html
{% for category in categories %} {{category}} {% for titles in subjects %} {% for title in titles %} {% if title.board_id == category.id %} <a href="#">{{title.subject}}</a><br> {% endif %} {% endfor %} {% endfor %} {% endfor %}
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags