|
|
@ -1,12 +1,12 @@ |
|
|
|
from math import ceil |
|
|
|
|
|
|
|
import rtyaml |
|
|
|
from crispy_forms.bootstrap import FormActions |
|
|
|
from crispy_forms.helper import FormHelper |
|
|
|
from crispy_forms.layout import HTML, Div, Fieldset, Layout, Submit |
|
|
|
from django import template |
|
|
|
from django.utils import formats |
|
|
|
from django.utils.translation import ugettext as _ |
|
|
|
import rtyaml |
|
|
|
|
|
|
|
|
|
|
|
def heads_and_tails(list_of_lists): |
|
|
@ -62,9 +62,11 @@ def get_field_display(obj, fieldname): |
|
|
|
else: |
|
|
|
value = getattr(obj, fieldname) |
|
|
|
|
|
|
|
str_type = str(type(value)) |
|
|
|
|
|
|
|
if value is None: |
|
|
|
display = '' |
|
|
|
elif 'date' in str(type(value)): |
|
|
|
elif 'date' in str_type: |
|
|
|
display = formats.date_format(value, "SHORT_DATE_FORMAT") |
|
|
|
elif 'bool' in str(type(value)): |
|
|
|
display = _('Sim') if value else _('Não') |
|
|
|