示例#1
0
 def text_log_steps(self, request, project, jm, pk=None):
     """
     Gets a list of steps associated with this job
     """
     job = jm.get_job(pk)
     if not job:
         return Response("No job with id: {0}".format(pk),
                         status=HTTP_404_NOT_FOUND)
     textlog_steps = TextLogStep.objects.filter(
         job__guid=job[0]['job_guid']).order_by(
             'started_line_number').prefetch_related('errors')
     return Response(serializers.TextLogStepSerializer(textlog_steps,
                                                       many=True,
                                                       read_only=True).data)
示例#2
0
    def text_log_steps(self, request, project, pk=None):
        """
        Gets a list of steps associated with this job
        """
        try:
            job = Job.objects.get(repository__name=project,
                                  id=pk)
        except ObjectDoesNotExist:
            return Response("No job with id: {0}".format(pk), status=HTTP_404_NOT_FOUND)

        textlog_steps = TextLogStep.objects.filter(job=job).order_by(
            'started_line_number').prefetch_related('errors')
        return Response(serializers.TextLogStepSerializer(textlog_steps,
                                                          many=True,
                                                          read_only=True).data)