Extend the bookshelf implementation

This commit is contained in:
2023-10-02 22:19:04 +02:00
parent 968ebeb0b6
commit 3f905877e7
9 changed files with 172 additions and 59 deletions

View File

@@ -1,3 +1,18 @@
from django.shortcuts import render
from rest_framework.generics import ListAPIView, RetrieveAPIView
from rest_framework.schemas.openapi import AutoSchema
# Create your views here.
from bookshelf.models import Book
from bookshelf.serializers import BookSerializer
class BookList(ListAPIView):
queryset = Book.objects.all()
serializer_class = BookSerializer
class BookGet(RetrieveAPIView):
queryset = Book.objects.all()
serializer_class = BookSerializer
lookup_field = "uuid"
schema = AutoSchema(operation_id_base="retrieveBookByUUID")