Fix: Import only needed api view classes
This commit is contained in:
parent
643b7491d6
commit
43f7ac566f
1 changed files with 3 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
from rest_framework import generics
|
||||
from rest_framework.generics import ListAPIView, RetrieveAPIView
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
|
||||
|
@ -7,7 +7,7 @@ from apps.archive.models import PostModel
|
|||
from .serializers import PostPreviewSerializer, PostSerializer
|
||||
|
||||
|
||||
class PostListView(generics.ListAPIView):
|
||||
class PostListView(ListAPIView):
|
||||
permission_classes = [IsAuthenticated]
|
||||
serializer_class = (
|
||||
PostPreviewSerializer # Each post will be serialized using this serializer
|
||||
|
@ -23,7 +23,7 @@ class PostListView(generics.ListAPIView):
|
|||
|
||||
|
||||
|
||||
class PostDetailView(generics.RetrieveAPIView):
|
||||
class PostDetailView(RetrieveAPIView):
|
||||
permission_classes = [IsAuthenticated]
|
||||
serializer_class = PostSerializer
|
||||
lookup_field = (
|
||||
|
|
Loading…
Add table
Reference in a new issue