summaryrefslogtreecommitdiff
path: root/app/books/views.py
blob: bf099965ad579bc468979244c43fb9b8fe5bfb49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from django.views.generic.detail import DetailView
from utils.views import PaginatedListView, LuxDetailView

from .models import Book


class BookListView(PaginatedListView):
    model = Book

    def get_queryset(self):
        return Book.objects.filter(is_public=True).order_by('-read_date').select_related()


class BookDetailView(LuxDetailView):
    model = Book
    slug_field = "slug"