From b4993e13b1a653bd4fbed592d3aa0ecd249b5a6e Mon Sep 17 00:00:00 2001 From: Victor Fabre Date: Tue, 27 Nov 2018 10:03:03 -0200 Subject: [PATCH] =?UTF-8?q?Muda=20pre=20popula=C3=A7=C3=A3o=20de=20tipo=20?= =?UTF-8?q?de=20v=C3=ADnculo=20para=20ocorrer=20no=20final?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pre_popula_tipo_vinculo_norma.json | 28 +++++++++---------- ...normajuridica_popula_tipo_vinculo_norma.py | 4 +-- .../migrations/0009_auto_20171113_1339.py | 2 +- .../migrations/0017_auto_20181127_0955.py | 20 +++++++++++++ sapl/norma/models.py | 2 +- sapl/norma/views.py | 4 +-- sapl/templates/norma/layouts.yaml | 4 +-- 7 files changed, 42 insertions(+), 22 deletions(-) create mode 100644 sapl/norma/migrations/0017_auto_20181127_0955.py diff --git a/sapl/norma/fixtures/pre_popula_tipo_vinculo_norma.json b/sapl/norma/fixtures/pre_popula_tipo_vinculo_norma.json index c533ca495..afae65bfe 100644 --- a/sapl/norma/fixtures/pre_popula_tipo_vinculo_norma.json +++ b/sapl/norma/fixtures/pre_popula_tipo_vinculo_norma.json @@ -1,7 +1,7 @@ [ { "fields": { - "revoga_integramente": "False", + "revoga_integralmente": "False", "descricao_ativa": "Altera o(a)", "descricao_passiva": "Alterado(a) pelo(a)", "sigla": "A" @@ -11,7 +11,7 @@ }, { "fields": { - "revoga_integramente": "True", + "revoga_integralmente": "True", "descricao_ativa": "Revoga integralmente o(a)", "descricao_passiva": "Revogado(a) integralmente pelo(a)", "sigla": "R" @@ -21,7 +21,7 @@ }, { "fields": { - "revoga_integramente": "False", + "revoga_integralmente": "False", "descricao_ativa": "Revoga parcialmente o(a)", "descricao_passiva": "Revogado(a) parcialmente pelo(a)", "sigla": "P" @@ -31,7 +31,7 @@ }, { "fields": { - "revoga_integramente": "True", + "revoga_integralmente": "True", "descricao_ativa": "Revoga integralmente por consolida\u00e7\u00e3o", "descricao_passiva": "Revogado(a) integralmente por consolida\u00e7\u00e3o", "sigla": "T" @@ -41,7 +41,7 @@ }, { "fields": { - "revoga_integramente": "False", + "revoga_integralmente": "False", "descricao_ativa": "Norma correlata", "descricao_passiva": "Norma correlata", "sigla": "C" @@ -51,7 +51,7 @@ }, { "fields": { - "revoga_integramente": "False", + "revoga_integralmente": "False", "descricao_ativa": "Ressalva o(a)", "descricao_passiva": "Ressalvada pelo(a)", "sigla": "S" @@ -61,7 +61,7 @@ }, { "fields": { - "revoga_integramente": "False", + "revoga_integralmente": "False", "descricao_ativa": "Reedita o(a)", "descricao_passiva": "Reeditada pelo(a)", "sigla": "E" @@ -71,7 +71,7 @@ }, { "fields": { - "revoga_integramente": "False", + "revoga_integralmente": "False", "descricao_ativa": "Reedita com altera\u00e7\u00e3o o(a)", "descricao_passiva": "Reeditada com altera\u00e7\u00e3o pelo(a)", "sigla": "I" @@ -81,7 +81,7 @@ }, { "fields": { - "revoga_integramente": "False", + "revoga_integralmente": "False", "descricao_ativa": "Regulamenta o(a)", "descricao_passiva": "Regulamentada pelo(a)", "sigla": "G" @@ -91,7 +91,7 @@ }, { "fields": { - "revoga_integramente": "False", + "revoga_integralmente": "False", "descricao_ativa": "Suspende parcialmente o(a)", "descricao_passiva": "Suspenso(a) parcialmente pelo(a)", "sigla": "K" @@ -101,7 +101,7 @@ }, { "fields": { - "revoga_integramente": "False", + "revoga_integralmente": "False", "descricao_ativa": "Suspende integralmente o(a)", "descricao_passiva": "Suspenso(a) integralmente pelo(a)", "sigla": "L" @@ -111,7 +111,7 @@ }, { "fields": { - "revoga_integramente": "False", + "revoga_integralmente": "False", "descricao_ativa": "Julga integralmente inconstitucional", "descricao_passiva": "Julgada integralmente inconstitucional", "sigla": "N" @@ -121,7 +121,7 @@ }, { "fields": { - "revoga_integramente": "False", + "revoga_integralmente": "False", "descricao_ativa": "Julga parcialmente inconstitucional", "descricao_passiva": "Julgada parcialmente inconstitucional", "sigla": "O" @@ -129,4 +129,4 @@ "model": "norma.TipoVinculoNormaJuridica", "pk": "13" } -] \ No newline at end of file +] diff --git a/sapl/norma/migrations/0008_normajuridica_popula_tipo_vinculo_norma.py b/sapl/norma/migrations/0008_normajuridica_popula_tipo_vinculo_norma.py index 3bfb90132..460122073 100644 --- a/sapl/norma/migrations/0008_normajuridica_popula_tipo_vinculo_norma.py +++ b/sapl/norma/migrations/0008_normajuridica_popula_tipo_vinculo_norma.py @@ -31,9 +31,9 @@ def gera_tipo_vinculo(apps, schema_editor): class Migration(migrations.Migration): dependencies = [ - ('norma', '0007_auto_20170904_1708'), + ('norma', '0017_auto_20181127_0955'), ] operations = [ migrations.RunPython(gera_tipo_vinculo), - ] \ No newline at end of file + ] diff --git a/sapl/norma/migrations/0009_auto_20171113_1339.py b/sapl/norma/migrations/0009_auto_20171113_1339.py index 672d87c94..36380b2a9 100644 --- a/sapl/norma/migrations/0009_auto_20171113_1339.py +++ b/sapl/norma/migrations/0009_auto_20171113_1339.py @@ -9,7 +9,7 @@ import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - ('norma', '0008_normajuridica_popula_tipo_vinculo_norma'), + ('norma', '0007_auto_20170904_1708'), ] operations = [ diff --git a/sapl/norma/migrations/0017_auto_20181127_0955.py b/sapl/norma/migrations/0017_auto_20181127_0955.py new file mode 100644 index 000000000..45fdb463b --- /dev/null +++ b/sapl/norma/migrations/0017_auto_20181127_0955.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.8 on 2018-11-27 11:55 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('norma', '0016_tipovinculonormajuridica_revoga_integramente'), + ] + + operations = [ + migrations.RenameField( + model_name='tipovinculonormajuridica', + old_name='revoga_integramente', + new_name='revoga_integralmente', + ), + ] diff --git a/sapl/norma/models.py b/sapl/norma/models.py index 423a6bb69..6565304ee 100644 --- a/sapl/norma/models.py +++ b/sapl/norma/models.py @@ -258,7 +258,7 @@ class TipoVinculoNormaJuridica(models.Model): max_length=50, blank=True, verbose_name=_('Descrição Ativa')) descricao_passiva = models.CharField( max_length=50, blank=True, verbose_name=_('Descrição Passiva')) - revoga_integramente = models.BooleanField(verbose_name=_('Revoga Integralmente?'), + revoga_integralmente = models.BooleanField(verbose_name=_('Revoga Integralmente?'), choices=YES_NO_CHOICES, default=False) diff --git a/sapl/norma/views.py b/sapl/norma/views.py index a9c6866cc..779cfcd11 100644 --- a/sapl/norma/views.py +++ b/sapl/norma/views.py @@ -37,7 +37,7 @@ TipoNormaCrud = CrudAux.build( list_field_names=['sigla', 'descricao', 'equivalente_lexml']) TipoVinculoNormaJuridicaCrud = CrudAux.build( TipoVinculoNormaJuridica, '', - list_field_names=['sigla', 'descricao_ativa', 'descricao_passiva', 'revoga_integramente']) + list_field_names=['sigla', 'descricao_ativa', 'descricao_passiva', 'revoga_integralmente']) class NormaRelacionadaCrud(MasterDetailCrud): @@ -208,7 +208,7 @@ class NormaCrud(Crud): def get_initial(self): username = self.request.user.username - + try: self.logger.debug('user=' + username + '. Tentando obter objeto de modelo da esfera da federação.') esfera = sapl.base.models.AppConfig.objects.last( diff --git a/sapl/templates/norma/layouts.yaml b/sapl/templates/norma/layouts.yaml index 5a129d7cc..90be4172e 100644 --- a/sapl/templates/norma/layouts.yaml +++ b/sapl/templates/norma/layouts.yaml @@ -58,7 +58,7 @@ LegislacaoCitadaDetail: TipoVinculoNormaJuridica: {% trans 'Tipo de Vínculo entre Normas Jurídicas' %}: - - sigla:2 descricao_ativa descricao_passiva revoga_integramente + - sigla:2 descricao_ativa descricao_passiva revoga_integralmente NormaRelacionada: {% trans 'Norma Relacionada' %}: @@ -73,4 +73,4 @@ NormaRelacionadaDetail: AutoriaNorma: {% trans 'Autoria' %}: - - autor primeiro_autor \ No newline at end of file + - autor primeiro_autor