From 6c71c3fcb66acc1a5c9b3f429cb2ce9830894073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Thu, 16 Mar 2017 13:07:18 -0300 Subject: [PATCH] =?UTF-8?q?Define=20se=20o=20Parlamentar=20=C3=A9=20titula?= =?UTF-8?q?r=20ou=20suplente=20para=20o=20mandato=20(#944)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/parlamentares/forms.py | 2 +- sapl/parlamentares/models.py | 6 ++++++ sapl/parlamentares/views.py | 3 ++- sapl/templates/parlamentares/layouts.yaml | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sapl/parlamentares/forms.py b/sapl/parlamentares/forms.py index 860e53191..618e0445e 100644 --- a/sapl/parlamentares/forms.py +++ b/sapl/parlamentares/forms.py @@ -54,7 +54,7 @@ class MandatoForm(ModelForm): class Meta: model = Mandato fields = ['legislatura', 'coligacao', 'votos_recebidos', - 'data_fim_mandato', 'data_expedicao_diploma', + 'data_fim_mandato', 'data_expedicao_diploma', 'titular', 'tipo_afastamento', 'observacao', 'parlamentar'] widgets = {'parlamentar': forms.HiddenInput()} diff --git a/sapl/parlamentares/models.py b/sapl/parlamentares/models.py index aece985c8..e134cad8a 100644 --- a/sapl/parlamentares/models.py +++ b/sapl/parlamentares/models.py @@ -440,6 +440,12 @@ class Mandato(models.Model): blank=True, null=True, verbose_name=_('Votos Recebidos')) data_expedicao_diploma = models.DateField( verbose_name=_('Expedição do Diploma')) + titular = models.BooleanField( + db_index=True, + default=True, + choices=YES_NO_CHOICES, + verbose_name=_('Vereador Titular')) + observacao = models.TextField( blank=True, verbose_name=_('Observação')) diff --git a/sapl/parlamentares/views.py b/sapl/parlamentares/views.py index cc45ef7ce..17eb81272 100644 --- a/sapl/parlamentares/views.py +++ b/sapl/parlamentares/views.py @@ -191,7 +191,8 @@ class MandatoCrud(MasterDetailCrud): list_field_names = ['legislatura', 'votos_recebidos', 'coligacao', - 'coligacao__numero_votos'] + 'coligacao__numero_votos', + 'titular'] class ListView(MasterDetailCrud.ListView): ordering = ('-legislatura__numero') diff --git a/sapl/templates/parlamentares/layouts.yaml b/sapl/templates/parlamentares/layouts.yaml index 7105ce9d3..c839c1b53 100644 --- a/sapl/templates/parlamentares/layouts.yaml +++ b/sapl/templates/parlamentares/layouts.yaml @@ -71,7 +71,7 @@ Filiacao: Mandato: {% trans 'Mandato' %}: - legislatura coligacao votos_recebidos - - data_fim_mandato data_expedicao_diploma + - data_fim_mandato data_expedicao_diploma titular - tipo_afastamento - observacao