From a65922666d59f1427ddbf76618bd1afb44ecc1c7 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 30 Nov 2015 15:18:30 -0200 Subject: [PATCH] Fix boolean display for autogen CRUD --- sapl/crud.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sapl/crud.py b/sapl/crud.py index dec5888d4..90058f48a 100644 --- a/sapl/crud.py +++ b/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