def images(self, request, pk=None): collection = get_collection(pk,request,mode='api') queryset = Image.objects.filter(collection=collection) paginator = StandardResultPagination() page = paginator.paginate_queryset(queryset, request) serializer = ImageSerializer(page, context={'request': request}, many=True) return paginator.get_paginated_response(serializer.data)
def _get_paginated_results(self, obj_class, pk, request, serializer): collection = get_collection(pk, request, mode='api') queryset = obj_class.objects.filter(collection=collection) paginator = StandardResultPagination() page = paginator.paginate_queryset(queryset, request) serializer = serializer(page, context={'request': request}, many=True) return paginator.get_paginated_response(serializer.data)
def _get_paginated_results(self, obj_class, pk, request, serializer): collection = get_collection(pk, request, mode='api') queryset = obj_class.objects.filter(collection=collection) paginator = StandardResultPagination() page = paginator.paginate_queryset(queryset, request) serializer = serializer( page, context={'request': request}, many=True) return paginator.get_paginated_response(serializer.data)
def images(self, request, pk=None): collection = get_collection(pk, request, mode='api') queryset = Image.objects.filter(collection=collection) paginator = StandardResultPagination() page = paginator.paginate_queryset(queryset, request) serializer = ImageSerializer(page, context={'request': request}, many=True) return paginator.get_paginated_response(serializer.data)
def images(self, request, pk=None): if request.method == 'POST': return self.add_item(request, pk, EditableStatisticMapSerializer) collection = get_collection(pk, request, mode='api') queryset = Image.objects.filter(collection=collection) paginator = StandardResultPagination() page = paginator.paginate_queryset(queryset, request) serializer = ImageSerializer( page, context={'request': request}, many=True) return paginator.get_paginated_response(serializer.data)
def images(self, request, pk=None): if request.method == 'POST': return self.add_item(request, pk, EditableStatisticMapSerializer) collection = get_collection(pk, request, mode='api') queryset = Image.objects.filter(collection=collection) paginator = StandardResultPagination() page = paginator.paginate_queryset(queryset, request) serializer = ImageSerializer(page, context={'request': request}, many=True) return paginator.get_paginated_response(serializer.data)