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))
|
||||
|
||||
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'],
|
||||
|
||||
Reference in New Issue
Block a user