Add render_customer()
method for MasterView
surely will be commonly useful?
This commit is contained in:
parent
bb0e2fb9e9
commit
8c610e2142
|
@ -890,6 +890,14 @@ class MasterView(View):
|
|||
url = self.request.route_url('users.view', uuid=user.uuid)
|
||||
return tags.link_to(text, url)
|
||||
|
||||
def render_customer(self, obj, field):
|
||||
customer = getattr(obj, field)
|
||||
if not customer:
|
||||
return ""
|
||||
text = six.text_type(customer)
|
||||
url = self.request.route_url('customers.view', uuid=customer.uuid)
|
||||
return tags.link_to(text, url)
|
||||
|
||||
def before_create_flush(self, obj, form):
|
||||
pass
|
||||
|
||||
|
|
Loading…
Reference in a new issue