From df3fe900c584baddc107880385a224b17aa5cd30 Mon Sep 17 00:00:00 2001 From: Felipe Vieira Date: Mon, 5 Dec 2011 20:36:23 +0000 Subject: [PATCH] adicionando textarea em alguns campos --- sigi/apps/diagnosticos/forms.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sigi/apps/diagnosticos/forms.py b/sigi/apps/diagnosticos/forms.py index 03c8954..fa5cdb3 100644 --- a/sigi/apps/diagnosticos/forms.py +++ b/sigi/apps/diagnosticos/forms.py @@ -5,7 +5,7 @@ from django import forms from django.forms.forms import BoundField from django.forms import (BooleanField, CharField, CheckboxSelectMultiple, DateField, FloatField, ModelChoiceField, - ModelMultipleChoiceField, RadioSelect) + ModelMultipleChoiceField, RadioSelect, Textarea) from django.contrib.contenttypes.generic import generic_inlineformset_factory from sigi.apps.casas.models import CasaLegislativa, Funcionario from sigi.apps.contatos.models import Telefone @@ -43,6 +43,15 @@ class DiagnosticoMobileForm(BaseDynamicEntityForm): 'many': {'widget': CheckboxSelectMultiple}, } + FIELD_WIDGET = { + 'consideracoes_gerais' : {'widget': Textarea}, + 'descreva_5_cursos_prioritarios_para_treinamento_de_parlamentares_da_camara_municipal' : {'widget': Textarea}, + 'descreva_5_cursos_prioritarios_para_treinamento_de_servidores_da_camara_municipal' : {'widget': Textarea}, + 'sugestoes_para_a_area_de_capacitacao' : {'widget': Textarea}, + 'sugestoes_para_a_area_de_comunicacao' : {'widget': Textarea}, + 'sugestoes_para_a_area_de_informacao' : {'widget': Textarea}, + 'sugestoes_para_a_area_de_ti' : {'widget': Textarea}, + } class Meta: model = Diagnostico @@ -95,6 +104,7 @@ class DiagnosticoMobileForm(BaseDynamicEntityForm): 'empty_label': None if schema.required else u"---------"}) extra = self.FIELD_EXTRA.get(datatype, {}) + extra.update(self.FIELD_WIDGET.get(schema.name, {})) if hasattr(extra, '__call__'): extra = extra(schema) defaults.update(extra)