Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 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)
Ejemplo n.º 5
0
    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)
Ejemplo n.º 6
0
    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)