|
@ -55,6 +55,7 @@ def get_field_display(obj, fieldname): |
|
|
value = getattr(obj, 'get_%s_display' % fieldname)() |
|
|
value = getattr(obj, 'get_%s_display' % fieldname)() |
|
|
else: |
|
|
else: |
|
|
value = getattr(obj, fieldname) |
|
|
value = getattr(obj, fieldname) |
|
|
|
|
|
|
|
|
if value is None: |
|
|
if value is None: |
|
|
display = '' |
|
|
display = '' |
|
|
elif 'date' in str(type(value)): |
|
|
elif 'date' in str(type(value)): |
|
@ -62,7 +63,10 @@ def get_field_display(obj, fieldname): |
|
|
elif 'bool' in str(type(value)): |
|
|
elif 'bool' in str(type(value)): |
|
|
display = _('Sim') if value else _('Não') |
|
|
display = _('Sim') if value else _('Não') |
|
|
elif 'ImageFieldFile' in str(type(value)): |
|
|
elif 'ImageFieldFile' in str(type(value)): |
|
|
display = '<img src="{}" />'.format(value.url) |
|
|
if value: |
|
|
|
|
|
display = '<img src="{}" />'.format(value.url) |
|
|
|
|
|
else: |
|
|
|
|
|
display = '' |
|
|
elif 'FieldFile' in str(type(value)): |
|
|
elif 'FieldFile' in str(type(value)): |
|
|
if value: |
|
|
if value: |
|
|
display = '<a href="{}">{}</a>'.format( |
|
|
display = '<a href="{}">{}</a>'.format( |
|
|