From 2448d71edd8ce4c236c42b1716baa05769b829f2 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 17 Aug 2017 20:28:54 -0500 Subject: [PATCH] Convert customer groups view to master3 --- tailbone/views/customergroups.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tailbone/views/customergroups.py b/tailbone/views/customergroups.py index f65e0c6b..faadb856 100644 --- a/tailbone/views/customergroups.py +++ b/tailbone/views/customergroups.py @@ -29,7 +29,7 @@ from __future__ import unicode_literals, absolute_import from rattail.db import model from tailbone.db import Session -from tailbone.views import MasterView2 as MasterView +from tailbone.views import MasterView3 as MasterView class CustomerGroupsView(MasterView): @@ -38,23 +38,28 @@ class CustomerGroupsView(MasterView): """ model_class = model.CustomerGroup model_title = "Customer Group" + + labels = { + 'id': "ID", + } + grid_columns = [ 'id', 'name', ] + form_fields = [ + 'id', + 'name', + ] + def configure_grid(self, g): + super(CustomerGroupsView, self).configure_grid(g) g.filters['name'].default_active = True g.filters['name'].default_verb = 'contains' g.default_sortkey = 'name' - g.set_label('id', "ID") - - def configure_fieldset(self, fs): - fs.configure( - include=[ - fs.id.label("ID"), - fs.name, - ]) + g.set_link('id') + g.set_link('name') def before_delete(self, group): # First remove customer associations.