celery & attributes list by product-2
This commit is contained in:
@@ -135,8 +135,11 @@ class AttributeViewSet(viewsets.ModelViewSet):
|
|||||||
|
|
||||||
attributes = self.queryset.filter(Q(is_global=True) | Q(product__id=pk))
|
attributes = self.queryset.filter(Q(is_global=True) | Q(product__id=pk))
|
||||||
|
|
||||||
serializer = self.serializer_class(attributes, many=True)
|
# paginate data
|
||||||
return Response(serializer.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(
|
@action(
|
||||||
methods=['put'],
|
methods=['put'],
|
||||||
|
|||||||
Reference in New Issue
Block a user