diff --git a/tailbone/views/subdepartments.py b/tailbone/views/subdepartments.py index 4550999f..584cd7f7 100644 --- a/tailbone/views/subdepartments.py +++ b/tailbone/views/subdepartments.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2018 Lance Edgar +# Copyright © 2010-2020 Lance Edgar # # This file is part of Rattail. # @@ -58,9 +58,17 @@ class SubdepartmentsView(MasterView): def configure_grid(self, g): super(SubdepartmentsView, self).configure_grid(g) + + # name g.filters['name'].default_active = True g.filters['name'].default_verb = 'contains' g.set_sort_defaults('name') + + # department (name) + g.set_joiner('department', lambda q: q.outerjoin(model.Department)) + g.set_sorter('department', model.Department.name) + g.set_filter('department', model.Department.name) + g.set_link('number') g.set_link('name')