categorys slider view
This commit is contained in:
@@ -14,6 +14,7 @@ from order.serializers import OrderItemSerailzier
|
||||
from order.models import OrderModel
|
||||
from django.db.models import Min, Max
|
||||
from home.models import ShowCaseSlider
|
||||
from home.serializers import ShowCaseSliderSerialzier
|
||||
# class APIView(APIView):
|
||||
# def __init__(self, *args, **kwargs):
|
||||
# super().__init__(*args, **kwargs)
|
||||
@@ -206,6 +207,16 @@ class AllProductsView(APIView):
|
||||
return Response({"detail": "Category not found."}, status=status.HTTP_404_NOT_FOUND)
|
||||
|
||||
|
||||
class ShowCaseCategoryListView(APIView):
|
||||
serializer_class = ShowCaseSliderSerialzier
|
||||
permission_classes = [AllowAny]
|
||||
def get(self, request):
|
||||
categoryes = ShowCaseSlider.objects.all()
|
||||
categoryes_ser = self.serializer_class(instance=categoryes, many=True, context={'request': request})
|
||||
return Response(categoryes_ser.data, status=status.HTTP_200_OK)
|
||||
|
||||
|
||||
|
||||
|
||||
class ShowCaseProductsView(APIView):
|
||||
serializer_class = DynamicProductSerializer
|
||||
|
||||
Reference in New Issue
Block a user