Esempio n. 1
0
    def get(self,
            request,
            slug_project,
            database_object_project,
            use_sandbox,
            format=None):

        queryset, list_fields = Manager_Settings_Batch.get_all(
            database_object_project=database_object_project,
            request=request,
        )

        queryset_paginated, count_items = paginate_queryset(queryset, request)

        serializer = Serializer_Settings_Batch(queryset_paginated,
                                               many=True,
                                               context={
                                                   'usecase':
                                                   'list_settings_batch',
                                                   'fields': list_fields,
                                               })

        return Response({
            'items_total': count_items,
            'data': serializer.data,
        })
Esempio n. 2
0
def settings_batch_all(request,
                       slug_project,
                       database_object_project,
                       use_sandbox,
                       format=None):
    queryset, list_fields = Manager_Settings_Batch.get_all(
        database_object_project=database_object_project,
        request=request,
    )

    serializer = Serializer_Settings_Batch(queryset,
                                           many=True,
                                           context={
                                               'usecase': 'settings_batch_all',
                                               'fields': list_fields,
                                           })

    return Response(serializer.data)
Esempio n. 3
0
def settings_batch_all(request, slug_project, database_object_project, use_sandbox, format=None):
    list_fields = request.query_params.getlist('fields[]')
    if len(list_fields) == 0:
        list_fields = None

    queryset = Manager_Settings_Batch.get_all(
        database_object_project=database_object_project,
        request=request,
        fields=list_fields,
    )

    serializer = Serializer_Settings_Batch(
        queryset,
        many=True,
        context={
            'usecase': 'settings_batch_all',
            'fields': list_fields,
        }
    )

    return Response(serializer.data)