Add render_person()
convenience method for MasterView
This commit is contained in:
parent
25c8edd81c
commit
cb67a23d0a
|
@ -850,6 +850,14 @@ class MasterView(View):
|
||||||
url = self.request.route_url('reportcodes.view', uuid=report.uuid)
|
url = self.request.route_url('reportcodes.view', uuid=report.uuid)
|
||||||
return tags.link_to(text, url)
|
return tags.link_to(text, url)
|
||||||
|
|
||||||
|
def render_person(self, obj, field):
|
||||||
|
person = getattr(obj, field)
|
||||||
|
if not person:
|
||||||
|
return ""
|
||||||
|
text = six.text_type(person)
|
||||||
|
url = self.request.route_url('people.view', uuid=person.uuid)
|
||||||
|
return tags.link_to(text, url)
|
||||||
|
|
||||||
def before_create_flush(self, obj, form):
|
def before_create_flush(self, obj, form):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue