celery & attributes list by product-2

This commit is contained in:
2025-07-19 11:10:05 +03:30
parent dc1e79c684
commit f87fd609e3

View File

@@ -135,8 +135,11 @@ class AttributeViewSet(viewsets.ModelViewSet):
attributes = self.queryset.filter(Q(is_global=True) | Q(product__id=pk))
serializer = self.serializer_class(attributes, many=True)
return Response(serializer.data)
# paginate data
page = self.paginate_queryset(attributes)
if page is not None:
serializer = self.get_serializer(page, many=True)
return self.get_paginated_response(serializer.data)
@action(
methods=['put'],