Browse Source

adicionando textarea em alguns campos

diagnosticos
Felipe Vieira 13 years ago
parent
commit
df3fe900c5
  1. 12
      sigi/apps/diagnosticos/forms.py

12
sigi/apps/diagnosticos/forms.py

@ -5,7 +5,7 @@ from django import forms
from django.forms.forms import BoundField from django.forms.forms import BoundField
from django.forms import (BooleanField, CharField, CheckboxSelectMultiple, from django.forms import (BooleanField, CharField, CheckboxSelectMultiple,
DateField, FloatField, ModelChoiceField, DateField, FloatField, ModelChoiceField,
ModelMultipleChoiceField, RadioSelect) ModelMultipleChoiceField, RadioSelect, Textarea)
from django.contrib.contenttypes.generic import generic_inlineformset_factory from django.contrib.contenttypes.generic import generic_inlineformset_factory
from sigi.apps.casas.models import CasaLegislativa, Funcionario from sigi.apps.casas.models import CasaLegislativa, Funcionario
from sigi.apps.contatos.models import Telefone from sigi.apps.contatos.models import Telefone
@ -43,6 +43,15 @@ class DiagnosticoMobileForm(BaseDynamicEntityForm):
'many': {'widget': CheckboxSelectMultiple}, '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: class Meta:
model = Diagnostico model = Diagnostico
@ -95,6 +104,7 @@ class DiagnosticoMobileForm(BaseDynamicEntityForm):
'empty_label': None if schema.required else u"---------"}) 'empty_label': None if schema.required else u"---------"})
extra = self.FIELD_EXTRA.get(datatype, {}) extra = self.FIELD_EXTRA.get(datatype, {})
extra.update(self.FIELD_WIDGET.get(schema.name, {}))
if hasattr(extra, '__call__'): if hasattr(extra, '__call__'):
extra = extra(schema) extra = extra(schema)
defaults.update(extra) defaults.update(extra)

Loading…
Cancel
Save