from django.views.generic.detail import DetailView from utils.views import PaginatedListView from .models import Book class BookListView(PaginatedListView): template_name = 'archives/books.html' def get_queryset(self): return Book.objects.all().order_by('-read_date').select_related() class BookDetailView(DetailView): model = Book template_name = "details/book.html" slug_field = "slug"