Exemplo n.º 1
0
    def retrieve(self, request, *args, **kwargs):
        """
        Overridden in order to get data from the Redis queue as well as the DB.

        Impure
            Pulls information from the DB and the Redis queue.

        :arg HttpRequest request: the incoming request.

        :rtype: Response
        :returns: JSON or HTML of the information about the job.
        """
        instance = self.get_object()
        instance = add_redis_data_to_job_data([instance])[0]
        serializer = self.get_serializer(instance)
        return Response(serializer.data)
Exemplo n.º 2
0
    def retrieve(self, request, *args, **kwargs):
        """
        Overridden in order to get data from the Redis queue as well as the DB.

        Impure
            Pulls information from the DB and the Redis queue.

        :arg HttpRequest request: the incoming request.

        :rtype: Response
        :returns: JSON or HTML of the information about the job.
        """
        instance = self.get_object()
        instance = add_redis_data_to_job_data([instance])[0]
        serializer = self.get_serializer(instance)
        return Response(serializer.data)
Exemplo n.º 3
0
    def filter_queryset(self, request, *args, **kwargs):
        """
        Overridden in order to get data from the Redis queue as well as the DB.

        Impure
            Pulls information from the DB and the Redis queue.

        :arg HttpRequest request: the incoming request.

        :rtype: list[PipelineJob]
        :returns: List of PipelineJob objects.
        """
        queryset = super(JobViewList, self).filter_queryset(request, *args,
                                                            **kwargs)
        queryset = add_redis_data_to_job_data(queryset)
        return queryset
Exemplo n.º 4
0
    def filter_queryset(self, request, *args, **kwargs):
        """
        Overridden in order to get data from the Redis queue as well as the DB.

        Impure
            Pulls information from the DB and the Redis queue.

        :arg HttpRequest request: the incoming request.

        :rtype: list[PipelineJob]
        :returns: List of PipelineJob objects.
        """
        queryset = super(JobViewList, self).filter_queryset(request, *args,
                                                            **kwargs)
        queryset = add_redis_data_to_job_data(queryset)
        return queryset