Added jwt, swagger...
This commit is contained in:
@@ -3,7 +3,17 @@ from django.shortcuts import render
|
||||
from apps.shelves.models import Shelf
|
||||
from apps.shelves.serializers import ShelfSerializer
|
||||
from rest_framework import viewsets
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework_simplejwt.authentication import JWTAuthentication
|
||||
|
||||
class ShelvesViewSet(viewsets.ModelViewSet):
|
||||
queryset = Shelf.objects.select_related("user")
|
||||
serializer_class = ShelfSerializer
|
||||
serializer_class = ShelfSerializer
|
||||
|
||||
authentication_classes = [JWTAuthentication]
|
||||
permission_classes = [IsAuthenticated]
|
||||
|
||||
def get_queryset(self):
|
||||
return Shelf.objects.filter(user_id=self.request.user.pk)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user