def batches_for_annotation(request, slug_project, database_object_project, use_sandbox, format=None): queryset = Manager_Batches.get_all( database_object_project=database_object_project, use_sandbox=use_sandbox, request=request) serializer = Serializer_Batch(queryset, context={ 'usecase': 'annotation', }, many=True) return Response(serializer.data)
def get(self, request, format=None): try: use_sandbox = False if request.query_params[ 'use_sandbox'] == 'false' else True except KeyError: use_sandbox = True queryset = Manager_Batches.get_all(request=request, use_sandbox=use_sandbox) queryset_paginated, count_items = paginate_queryset(queryset, request) serializer = Serializer_Batch(queryset_paginated, many=True, context={ 'usecase': 'list_batches', }) return Response({ 'items_total': count_items, 'data': serializer.data, })
def get(self, request, slug_project, database_object_project, use_sandbox, format=None): queryset = Manager_Batches.get_all( database_object_project=database_object_project, use_sandbox=use_sandbox, request=request) queryset_paginated, count_items = paginate_queryset(queryset, request) serializer = Serializer_Batch(queryset_paginated, many=True, context={ 'usecase': 'list_batches', }) return Response({ 'items_total': count_items, 'data': serializer.data, })