mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 21:27:49 +02:00
Extend the bookshelf implementation
This commit is contained in:
@@ -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")
|
||||
|
Reference in New Issue
Block a user