예제 #1
0
    def get_status_bohne(self):
        result = 0
        try:
            boehnlis = Boehnli.objects.filter(job_id=self.id)
            result = helpers.get_status_bean(boehnlis.count() * 100 / self.slots)
        except ZeroDivisionError:
            print "ZeroDivisionError in get_status_bean", sys.exc_info()[0]

        return result
예제 #2
0
    def get_status_bohne(self):
        result = 0
        try:
            boehnlis = Boehnli.objects.filter(job_id=self.id)
            result = helpers.get_status_bean(boehnlis.count() * 100 /
                                             self.slots)
        except ZeroDivisionError:
            print "ZeroDivisionError in get_status_bean", sys.exc_info()[0]

        return result
예제 #3
0
 def get_status_bohne(self):
     boehnlis = Boehnli.objects.filter(job_id=self.id)
     if self.slots < 1:
         return helpers.get_status_bean(100)
     return helpers.get_status_bean(boehnlis.count() * 100 / self.slots)
예제 #4
0
파일: models.py 프로젝트: MAG-Admin/MAG-Web
 def get_status_bohne(self):
     boehnlis = Boehnli.objects.filter(job_id=self.id)
     return helpers.get_status_bean(boehnlis.count() * 100 / self.slots)