Add sort/filter for department name, for Categories grid
This commit is contained in:
parent
7f567dec3a
commit
c869238678
|
@ -58,6 +58,11 @@ class CategoriesView(MasterView):
|
||||||
super(CategoriesView, self).configure_grid(g)
|
super(CategoriesView, self).configure_grid(g)
|
||||||
g.filters['name'].default_active = True
|
g.filters['name'].default_active = True
|
||||||
g.filters['name'].default_verb = 'contains'
|
g.filters['name'].default_verb = 'contains'
|
||||||
|
|
||||||
|
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_sort_defaults('code')
|
g.set_sort_defaults('code')
|
||||||
g.set_link('code')
|
g.set_link('code')
|
||||||
g.set_link('number')
|
g.set_link('number')
|
||||||
|
|
Loading…
Reference in a new issue