From 362f3836bbe70107599e1271d812228d0d9758a5 Mon Sep 17 00:00:00 2001 From: ZivLi Date: Fri, 23 Jun 2017 14:48:03 +0800 Subject: [PATCH] another 2 used. --- blogpost/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blogpost/api.py b/blogpost/api.py index e03c7f5..5f5c7f8 100644 --- a/blogpost/api.py +++ b/blogpost/api.py @@ -28,7 +28,7 @@ class Meta: class BlogpostSet(viewsets.ModelViewSet): permission_classes = (permissions.IsAuthenticatedOrReadOnly,) - serializer_class = BlogpsotSerializer + serializer_class = BlogpostSerializer search_fields = 'title' def get_queryset(self): @@ -41,7 +41,7 @@ def list(self, request): if search_param is not None: queryset = Blogpost.objects.filter(title__contains=search_param) - serializer = BlogpsotSerializer(queryset, many=True) + serializer = BlogpostSerializer(queryset, many=True) return Response(serializer.data)