From 2ad0223e9ac805202cc62c4557e0e092dc689841 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 2 Dec 2020 14:03:19 -0600 Subject: [PATCH] Add the "Employee Status" filter to People grid --- tailbone/views/people.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tailbone/views/people.py b/tailbone/views/people.py index 969693d7..183c63a5 100644 --- a/tailbone/views/people.py +++ b/tailbone/views/people.py @@ -121,6 +121,10 @@ class PeopleView(MasterView): g.filters['last_name'].default_active = True g.filters['last_name'].default_verb = 'contains' + g.set_joiner('employee_status', lambda q: q.outerjoin(model.Employee)) + g.set_filter('employee_status', model.Employee.status, + value_enum=self.enum.EMPLOYEE_STATUS) + g.sorters['email'] = lambda q, d: q.order_by(getattr(model.PersonEmailAddress.address, d)()) g.sorters['phone'] = lambda q, d: q.order_by(getattr(model.PersonPhoneNumber.number, d)())