Browse Source

Fix boolean display for autogen CRUD

pull/11/merge
Edward Ribeiro 9 years ago
parent
commit
a65922666d
  1. 5
      sapl/crud.py

5
sapl/crud.py

@ -52,11 +52,14 @@ def get_field_display(obj, fieldname):
value = getattr(obj, 'get_%s_display' % fieldname)()
else:
value = getattr(obj, fieldname)
if value is None:
display = ''
elif 'date' in str(type(value)):
display = value.strftime("%d/%m/%Y")
else:
elif 'bool' in str(type(value)):
display = 'Sim' if value else 'Não'
else:
display = str(value)
return verbose_name, display

Loading…
Cancel
Save