Tweak some customer view/field rendering, to allow more customization
This commit is contained in:
parent
56695d0c20
commit
eb272bf7f9
2 changed files with 11 additions and 5 deletions
|
@ -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"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue