Commit 3ea89c331618aaac8c52aa021728512818ac06c9
- Diff rendering mode:
- inline
- side by side
query.py
(5 / 2)
  | |||
70 | 70 | slots['{0}-{1}'.format(date1.strftime('%H'), date2.strftime('%H'))] = result.filter(self.t.lt.calldate.between(date1, date2)).count() | |
71 | 71 | ||
72 | 72 | maxLoad = max(slots, key = lambda x: slots.get(x) ) | |
73 | minLoad = min(slots, key = lambda x: slots.get(x) ) | ||
74 | 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)} |