Tweak some customer view/field rendering, to allow more customization

This commit is contained in:
Lance Edgar 2017-05-11 13:54:23 -05:00
parent 56695d0c20
commit eb272bf7f9
2 changed files with 11 additions and 5 deletions

View file

@ -47,8 +47,7 @@ class CustomersView(MasterView):
model_class = model.Customer
supports_mobile = True
def configure_grid(self, g):
def _preconfigure_grid(self, g):
g.joiners['email'] = lambda q: q.outerjoin(model.CustomerEmailAddress, sa.and_(
model.CustomerEmailAddress.parent_uuid == model.Customer.uuid,
model.CustomerEmailAddress.preference == 1))
@ -73,9 +72,11 @@ class CustomersView(MasterView):
g.default_sortkey = 'name'
def configure_grid(self, g):
g.configure(
include=[
g.id.label("ID"),
g.number,
g.name,
g.phone.label("Phone Number"),
g.email.label("Email Address"),