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)
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