Add the "Employee Status" filter to People grid

This commit is contained in:
Lance Edgar 2020-12-02 14:03:19 -06:00
parent 04ba14fcd7
commit 2ad0223e9a

View file

@ -121,6 +121,10 @@ class PeopleView(MasterView):
g.filters['last_name'].default_active = True g.filters['last_name'].default_active = True
g.filters['last_name'].default_verb = 'contains' 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['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)()) g.sorters['phone'] = lambda q, d: q.order_by(getattr(model.PersonPhoneNumber.number, d)())