From 70ac9b75bf5ec809c7e2fafe5edbd7a74df3b706 Mon Sep 17 00:00:00 2001 From: ricardocanela Date: Tue, 19 Nov 2019 11:36:14 -0300 Subject: [PATCH] remove campo parlamentares de frente --- sapl/parlamentares/forms.py | 5 +- .../0041_remove_frente_parlamentares.py | 19 ++++ sapl/parlamentares/models.py | 3 - sapl/parlamentares/views.py | 2 +- sapl/templates/parlamentares/frente_form.html | 93 ------------------- sapl/templates/parlamentares/layouts.yaml | 1 - 6 files changed, 21 insertions(+), 102 deletions(-) create mode 100644 sapl/parlamentares/migrations/0041_remove_frente_parlamentares.py diff --git a/sapl/parlamentares/forms.py b/sapl/parlamentares/forms.py index 79c347f2b..c1b3fbb7c 100755 --- a/sapl/parlamentares/forms.py +++ b/sapl/parlamentares/forms.py @@ -448,10 +448,7 @@ class FrenteForm(ModelForm): def __init__(self, *args, **kwargs): super(FrenteForm, self).__init__(*args, **kwargs) - self.fields['parlamentares'].queryset = Parlamentar.objects.filter( - ativo=True).order_by('nome_completo') - self.fields['parlamentares'].label = _('Parlamentares \ - (Mantenha CTRL pressionado para selecionar vários)') + class Meta: model = Frente diff --git a/sapl/parlamentares/migrations/0041_remove_frente_parlamentares.py b/sapl/parlamentares/migrations/0041_remove_frente_parlamentares.py new file mode 100644 index 000000000..b85001471 --- /dev/null +++ b/sapl/parlamentares/migrations/0041_remove_frente_parlamentares.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2019-11-19 14:18 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('parlamentares', '0040_transfere_parlamentar_frente'), + ] + + operations = [ + migrations.RemoveField( + model_name='frente', + name='parlamentares', + ), + ] diff --git a/sapl/parlamentares/models.py b/sapl/parlamentares/models.py index 6862293f5..965c2972a 100644 --- a/sapl/parlamentares/models.py +++ b/sapl/parlamentares/models.py @@ -576,9 +576,6 @@ class Frente(models.Model): nome = models.CharField( max_length=80, verbose_name=_('Nome da Frente')) - parlamentares = models.ManyToManyField(Parlamentar, - blank=True, - verbose_name=_('Parlamentares')) data_criacao = models.DateField(verbose_name=_('Data Criação')) data_extincao = models.DateField( blank=True, null=True, verbose_name=_('Data Dissolução')) diff --git a/sapl/parlamentares/views.py b/sapl/parlamentares/views.py index e82ec0dc7..7117b3a3e 100644 --- a/sapl/parlamentares/views.py +++ b/sapl/parlamentares/views.py @@ -396,7 +396,7 @@ class FrenteCrud(Crud): help_topic = 'tipo_situa_militar' public = [RP_DETAIL, RP_LIST] list_field_names = ['nome', 'data_criacao', - 'data_extincao', 'parlamentares'] + 'data_extincao'] class BaseMixin(Crud.BaseMixin): def get_context_data(self, **kwargs): diff --git a/sapl/templates/parlamentares/frente_form.html b/sapl/templates/parlamentares/frente_form.html index 2e6bdca3e..c8705f0d3 100644 --- a/sapl/templates/parlamentares/frente_form.html +++ b/sapl/templates/parlamentares/frente_form.html @@ -22,24 +22,6 @@ -
-
-
-
-
-
-
- -
-
- {{ form.parlamentares|as_crispy_field }} -
-
-
-
{{ form.descricao|as_crispy_field }} @@ -51,78 +33,3 @@ {% endblock base_content %} - -{% block extra_js %} - -{% endblock %} diff --git a/sapl/templates/parlamentares/layouts.yaml b/sapl/templates/parlamentares/layouts.yaml index eba40f5a9..6a385b257 100644 --- a/sapl/templates/parlamentares/layouts.yaml +++ b/sapl/templates/parlamentares/layouts.yaml @@ -131,7 +131,6 @@ Frente: {% trans 'Frente' %}: - nome - data_criacao data_extincao - - parlamentares - descricao Votante: