blob: 3cfeb2d870e7f927c3163b1d0089f5042085caca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
from collections import defaultdict
def per_manager(timesheets):
per_manager = defaultdict(list)
# filter timesheets per manager
for timesheet in [t for t in timesheets if not t.is_done()]:
manager_id = timesheet.approver
per_manager[manager_id].append(timesheet)
return per_manager
def employees(timesheets):
return dict([(t.employee.id, t.employee) for t in timesheets])
|