Add some generic render methods to MasterView
This commit is contained in:
parent
59167278d4
commit
523ea6e0df
|
@ -905,6 +905,19 @@ class MasterView(View):
|
||||||
"""
|
"""
|
||||||
return obj.id_str
|
return obj.id_str
|
||||||
|
|
||||||
|
def render_as_is(self, obj, field):
|
||||||
|
return getattr(obj, field)
|
||||||
|
|
||||||
|
def render_url(self, obj, field):
|
||||||
|
url = getattr(obj, field)
|
||||||
|
if url:
|
||||||
|
return tags.link_to(url, url, target='_blank')
|
||||||
|
|
||||||
|
def render_html(self, obj, field):
|
||||||
|
html = getattr(obj, field)
|
||||||
|
if html:
|
||||||
|
return HTML.literal(html)
|
||||||
|
|
||||||
def render_default_phone(self, obj, field):
|
def render_default_phone(self, obj, field):
|
||||||
"""
|
"""
|
||||||
Render the "default" (first) phone number for the given contact.
|
Render the "default" (first) phone number for the given contact.
|
||||||
|
|
Loading…
Reference in a new issue