Commit 3ea89c331618aaac8c52aa021728512818ac06c9
Contenders for least active hours are now added to the report.
| | | | 70 | slots['{0}-{1}'.format(date1.strftime('%H'), date2.strftime('%H'))] = result.filter(self.t.lt.calldate.between(date1, date2)).count() | 70 | slots['{0}-{1}'.format(date1.strftime('%H'), date2.strftime('%H'))] = result.filter(self.t.lt.calldate.between(date1, date2)).count() |
---|
71 | | 71 | |
---|
72 | maxLoad = max(slots, key = lambda x: slots.get(x) ) | 72 | maxLoad = max(slots, key = lambda x: slots.get(x) ) |
---|
73 | minLoad = min(slots, key = lambda x: slots.get(x) ) | | minLoad = min(slots, key = lambda x: slots.get(x) ) |
---|
74 | return {"maxLoad": maxLoad, "maxCalls": slots[maxLoad], "minLoad": minLoad} | | return {"maxLoad": maxLoad, "maxCalls": slots[maxLoad], "minLoad": minLoad} |
---|
| | 73 | minLoad = [] | | | 74 | for slot in slots: |
---|
| | 75 | if min(slots, slots[slot]) == 0: |
---|
| | 76 | minLoad.append(slot) |
---|
| | 77 | return {"maxLoad": maxLoad, "maxCalls": slots[maxLoad], "minLoad": repr(minLoad)} |
---|