From caec5dbed878905e08e8da38216594eeae60bf2b Mon Sep 17 00:00:00 2001 From: Edward Date: Fri, 9 Nov 2018 16:11:24 -0200 Subject: [PATCH] Fixes #2362 (#2365) --- sapl/norma/forms.py | 8 +++++--- .../migrations/0015_auto_20181109_1422.py | 20 +++++++++++++++++++ sapl/norma/models.py | 2 +- sapl/templates/norma/layouts.yaml | 4 ++-- 4 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 sapl/norma/migrations/0015_auto_20181109_1422.py diff --git a/sapl/norma/forms.py b/sapl/norma/forms.py index d4f0046a6..674e1b9a8 100644 --- a/sapl/norma/forms.py +++ b/sapl/norma/forms.py @@ -64,7 +64,7 @@ class NormaFilterSet(django_filters.FilterSet): class Meta: model = NormaJuridica - fields = ['tipo', 'numero', 'ano', 'data', + fields = ['tipo', 'numero', 'ano', 'data', 'data_vigencia', 'data_publicacao', 'ementa', 'assuntos'] def __init__(self, *args, **kwargs): @@ -73,13 +73,14 @@ class NormaFilterSet(django_filters.FilterSet): row1 = to_row([('tipo', 4), ('numero', 4), ('ano', 4)]) row2 = to_row([('data', 6), ('data_publicacao', 6)]) row3 = to_row([('ementa', 6), ('assuntos', 6)]) - row4 = to_row([('o',6), ('indexacao', 6)]) + row4 = to_row([('data_vigencia', 12)]) + row5 = to_row([('o',6), ('indexacao', 6)]) self.form.helper = FormHelper() self.form.helper.form_method = 'GET' self.form.helper.layout = Layout( Fieldset(_('Pesquisa de Norma'), - row1, row2, row3, row4, + row1, row2, row3, row4, row5, form_actions(label='Pesquisar')) ) @@ -120,6 +121,7 @@ class NormaJuridicaForm(ModelForm): 'numero_materia', 'ano_materia', 'data_publicacao', + 'data_vigencia', 'veiculo_publicacao', 'pagina_inicio_publicacao', 'pagina_fim_publicacao', diff --git a/sapl/norma/migrations/0015_auto_20181109_1422.py b/sapl/norma/migrations/0015_auto_20181109_1422.py new file mode 100644 index 000000000..e6550dcb8 --- /dev/null +++ b/sapl/norma/migrations/0015_auto_20181109_1422.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.8 on 2018-11-09 16:22 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('norma', '0014_auto_20181008_1655'), + ] + + operations = [ + migrations.AlterField( + model_name='normajuridica', + name='data_vigencia', + field=models.DateField(blank=True, null=True, verbose_name='Data Fim VigĂȘncia'), + ), + ] diff --git a/sapl/norma/models.py b/sapl/norma/models.py index 46f34a0ef..fd06b553e 100644 --- a/sapl/norma/models.py +++ b/sapl/norma/models.py @@ -119,7 +119,7 @@ class NormaJuridica(models.Model): assuntos = models.ManyToManyField( AssuntoNorma, blank=True, verbose_name=_('Assuntos')) - data_vigencia = models.DateField(blank=True, null=True) + data_vigencia = models.DateField(blank=True, null=True, verbose_name=_('Data Fim VigĂȘncia')) timestamp = models.DateTimeField(null=True) texto_articulado = GenericRelation( diff --git a/sapl/templates/norma/layouts.yaml b/sapl/templates/norma/layouts.yaml index d881ae186..295ef62d5 100644 --- a/sapl/templates/norma/layouts.yaml +++ b/sapl/templates/norma/layouts.yaml @@ -17,7 +17,7 @@ NormaJuridica: - tipo numero ano - data esfera_federacao complemento - materia - - data_publicacao veiculo_publicacao pagina_inicio_publicacao pagina_fim_publicacao + - data_publicacao veiculo_publicacao data_vigencia pagina_inicio_publicacao pagina_fim_publicacao - texto_integral - ementa - indexacao @@ -35,7 +35,7 @@ NormaJuridicaCreate: - tipo ano numero - data esfera_federacao complemento - tipo_materia numero_materia ano_materia - - data_publicacao veiculo_publicacao pagina_inicio_publicacao pagina_fim_publicacao + - data_publicacao veiculo_publicacao data_vigencia pagina_inicio_publicacao pagina_fim_publicacao - texto_integral - ementa - indexacao