у меня есть вот такой класс
class HomeView(TemplateView):
template_name ='testapp/home1.html'
#template_name ='testapp/home2.html'
#template_name ='testapp/home3.html'
def get_context_data(self, **kwargs):
context = super(HomeView, self).get_context_data(**kwargs)
context['author_name'] = get_author()
context['books'] = get_books()
context['list'] = get_list()
return context
файл action.py
from testapp.models import Author, Book
def get_author():
return [author.first_name for author in Author.objects.all()]
def get_books():
return [book.name for book in Book.objects.all()]
def get_list():
authors = [
(author.first_name, [book.name for book in author.book_set.all()])
for author in Author.objects.all()
]
return authors
и для каждого context у меня свой страница, расширяемая от base.html
подскажите как мне сделать навигаию между этими тремя страницами, класс то один, url тоже один!
я надеюсь что понятно объяснила проблему(