mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 21:27:49 +02:00
19 lines
503 B
Python
19 lines
503 B
Python
from rest_framework.generics import ListAPIView, RetrieveAPIView
|
|
from rest_framework.schemas.openapi import AutoSchema
|
|
|
|
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")
|