From ec92e0b0892cfbcacd43183606ecebca81a626f5 Mon Sep 17 00:00:00 2001 From: jhyns Date: Thu, 18 May 2023 12:22:01 +0900 Subject: [PATCH] Remove product method in BrandViewset --- market/viewsets.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/market/viewsets.py b/market/viewsets.py index aceb09d..740465c 100644 --- a/market/viewsets.py +++ b/market/viewsets.py @@ -16,18 +16,9 @@ from market.serializers import ( class BrandViewset(ActionBasedMixin, ModelViewSet): queryset = Brand.objects.all() serializer_class = BrandSerializer - serializer_class_map = { - "products": ProductSerializer, - } permission_classes = [IsAdminUserOrReadOnly] pagination_class = None - @action(detail=True, methods=["GET"]) - def product(self, request, pk): - queryset = self.get_object().products.all() - serializer = self.get_serializer(queryset, many=True) - return Response(serializer.data) - class ProductViewset(ActionBasedMixin, ModelViewSet): queryset = (