I need to get list of all authors and their publishes
{% for author in authors %}
{{ author.name }}
{% for publish in publishes %}
{{ publish.title }}
{% endfor %}
{% endfor %}
views.py:
def authors_list(request):
authors = Author.objects.all()
publishes = Group.objects.filter(author=author)
return render(request, 'app/authors_list.html', {'authors': authors,'publishes': publishes})
This way 'publishes' is not Defined.