Browse Source

Add TipoComissaoForm from scraped fieldsets

pull/6/head
Marcio Mazza 10 years ago
parent
commit
6da6aeb92d
  1. 28
      comissoes/forms.py

28
comissoes/forms.py

@ -2,10 +2,33 @@ from crispy_forms.helper import FormHelper
from django import forms from django import forms
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from comissoes.models import Comissao from comissoes.models import Comissao, TipoComissao
from sapl.layout import SaplFormLayout from sapl.layout import SaplFormLayout
class TipoComissaoForm(forms.ModelForm):
class Meta:
model = TipoComissao
exclude = []
def __init__(self, *args, **kwargs):
super(ComissaoForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.layout = SaplFormLayout(
[_('Tipo Comissão'),
[('nome', 3),
('nome', 3),
('sigla', 2),
('dispositivo_regimental', 2),
('natureza', 2)],
[('nome', 6), ('sigla', 6)],
[('dispositivo_regimental', 6), ('natureza', 6)]],
)
class ComissaoForm(forms.ModelForm): class ComissaoForm(forms.ModelForm):
class Meta: class Meta:
@ -16,6 +39,7 @@ class ComissaoForm(forms.ModelForm):
super(ComissaoForm, self).__init__(*args, **kwargs) super(ComissaoForm, self).__init__(*args, **kwargs)
self.helper = FormHelper() self.helper = FormHelper()
self.helper.layout = SaplFormLayout( self.helper.layout = SaplFormLayout(
[_('Dados Básicos'), [_('Dados Básicos'),
[('nome', 9), ('sigla', 3)], [('nome', 9), ('sigla', 3)],
[('tipo', 3), [('tipo', 3),
@ -38,4 +62,4 @@ class ComissaoForm(forms.ModelForm):
[('data_final_prevista_temp', 4), [('data_final_prevista_temp', 4),
('data_prorrogada_temp', 4), ('data_prorrogada_temp', 4),
('data_fim_comissao', 4)]], ('data_fim_comissao', 4)]],
) )

Loading…
Cancel
Save