import --> tag distribution child list
This commit is contained in:
@@ -613,6 +613,26 @@ class TagDistributionBatchViewSet(
|
|||||||
serializer = self.serializer_class(distribution_batch)
|
serializer = self.serializer_class(distribution_batch)
|
||||||
return Response(serializer.data, status=status.HTTP_200_OK)
|
return Response(serializer.data, status=status.HTTP_200_OK)
|
||||||
|
|
||||||
|
@action(
|
||||||
|
methods=['get'],
|
||||||
|
detail=True,
|
||||||
|
url_path='child_list',
|
||||||
|
url_name='child_list',
|
||||||
|
name='child_list'
|
||||||
|
)
|
||||||
|
def child_list(self, request, pk=None):
|
||||||
|
"""
|
||||||
|
list of all child from a tag distribution batch
|
||||||
|
"""
|
||||||
|
dist_batch = self.get_object()
|
||||||
|
queryset = dist_batch.children.all()
|
||||||
|
|
||||||
|
page = self.paginate_queryset(queryset)
|
||||||
|
if page is not None: # noqa
|
||||||
|
serializer = self.get_serializer(page, many=True)
|
||||||
|
return self.get_paginated_response(serializer.data)
|
||||||
|
return Response(self.serializer_class(queryset).data)
|
||||||
|
|
||||||
@action(
|
@action(
|
||||||
methods=['post'],
|
methods=['post'],
|
||||||
detail=True,
|
detail=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user