Beispiel #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
Beispiel #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
Beispiel #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)
Beispiel #4
0
 def get_status_bohne(self):
     boehnlis = Boehnli.objects.filter(job_id=self.id)
     return helpers.get_status_bean(boehnlis.count() * 100 / self.slots)