1 from rest_framework.generics import ListAPIView, RetrieveAPIView
2 from . import serializers
3 from catalogue.models import Book, Collection
6 class CollectionList(ListAPIView):
7 queryset = Collection.objects.all()
8 serializer_class = serializers.CollectionListSerializer
11 class CollectionDetail(RetrieveAPIView):
12 queryset = Collection.objects.all()
14 serializer_class = serializers.CollectionSerializer
17 class BookDetail(RetrieveAPIView):
18 queryset = Book.objects.all()
20 serializer_class = serializers.BookDetailSerializer