-2
class PublisherDetail(DetailView):

    model = Publisher

    def get_context_data(self, **kwargs):
        # Call the base implementation first to get a context
        context = super().get_context_data(**kwargs)
        # Add in a QuerySet of all the books
        context['book_list'] = Book.objects.all()
        return context
AKX
  • 152,115
  • 15
  • 115
  • 172
swatty
  • 1

1 Answers1

0

According to the basic Python inheritance rules, super().get_context_data(...) would be DetailView.get_context_data(), but since it's not defined, it's inherited down from SingleObjectMixin.

AKX
  • 152,115
  • 15
  • 115
  • 172