Remove product method in BrandViewset
This commit is contained in:
parent
ffbb40e7d9
commit
ec92e0b089
@ -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 = (
|
||||
|
Loading…
Reference in New Issue
Block a user