Added celery and rabbitmq
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
from rest_framework import viewsets
|
||||
# from rest_framework import viewsets
|
||||
|
||||
from apps.authors.models import Author
|
||||
from apps.authors.serializers import AuthorSerializer
|
||||
from rest_framework import viewsets
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework_simplejwt.authentication import JWTAuthentication
|
||||
# from apps.authors.models import Author
|
||||
# from apps.authors.serializers import AuthorSerializer
|
||||
# from rest_framework import viewsets
|
||||
# from rest_framework.permissions import IsAuthenticated
|
||||
# from rest_framework_simplejwt.authentication import JWTAuthentication
|
||||
|
||||
class AuthorsViewSet(viewsets.ModelViewSet):
|
||||
queryset = Author.objects.select_related("shelf")
|
||||
serializer_class = AuthorSerializer
|
||||
# class AuthorsViewSet(viewsets.ModelViewSet):
|
||||
# queryset = Author.objects.select_related("shelf")
|
||||
# serializer_class = AuthorSerializer
|
||||
|
||||
authentication_classes = [JWTAuthentication]
|
||||
permission_classes = [IsAuthenticated]
|
||||
# authentication_classes = [JWTAuthentication]
|
||||
# permission_classes = [IsAuthenticated]
|
||||
|
||||
def get_queryset(self):
|
||||
return self.queryset.filter(
|
||||
shelf__user_id=self.request.user.pk
|
||||
)
|
||||
# def get_queryset(self):
|
||||
# return self.queryset.filter(
|
||||
# shelf__user_id=self.request.user.pk
|
||||
# )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user