From c224bc1eb31e4d71d0cbce7b5044892ee95045e8 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Thu, 25 Aug 2016 18:18:50 -0300 Subject: [PATCH 1/2] =?UTF-8?q?Arruma=20problemas=20na=20migra=C3=A7=C3=A3?= =?UTF-8?q?o=20de=20materia,=20comissoes=20e=20protocoloadm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luciano Almeida --- sapl/comissoes/legacy.yaml | 1 + .../migrations/0006_auto_20160825_1335.py | 20 +++++++++++++++++ sapl/comissoes/models.py | 1 + sapl/materia/forms.py | 5 +++++ sapl/materia/legacy.yaml | 1 + .../migrations/0046_auto_20160825_1504.py | 22 +++++++++++++++++++ sapl/materia/migrations/0047_merge.py | 16 ++++++++++++++ sapl/materia/models.py | 4 +--- sapl/protocoloadm/legacy.yaml | 1 - 9 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 sapl/comissoes/migrations/0006_auto_20160825_1335.py create mode 100644 sapl/materia/migrations/0046_auto_20160825_1504.py create mode 100644 sapl/materia/migrations/0047_merge.py diff --git a/sapl/comissoes/legacy.yaml b/sapl/comissoes/legacy.yaml index 66ed8b060..a1093c4d2 100644 --- a/sapl/comissoes/legacy.yaml +++ b/sapl/comissoes/legacy.yaml @@ -25,6 +25,7 @@ Comissao: telefone_secretaria: num_tel_secretaria tipo: tip_comissao unidade_deliberativa: ind_unid_deliberativa + ativa: Periodo (PeriodoCompComissao): data_fim: dat_fim_periodo diff --git a/sapl/comissoes/migrations/0006_auto_20160825_1335.py b/sapl/comissoes/migrations/0006_auto_20160825_1335.py new file mode 100644 index 000000000..f165a94ea --- /dev/null +++ b/sapl/comissoes/migrations/0006_auto_20160825_1335.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-08-25 16:35 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('comissoes', '0005_comissao_ativa'), + ] + + operations = [ + migrations.AlterField( + model_name='comissao', + name='ativa', + field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Comissão Ativa?'), + ), + ] diff --git a/sapl/comissoes/models.py b/sapl/comissoes/models.py index 304456c8f..05587d24f 100644 --- a/sapl/comissoes/models.py +++ b/sapl/comissoes/models.py @@ -74,6 +74,7 @@ class Comissao(models.Model): choices=YES_NO_CHOICES, verbose_name=_('Unidade Deliberativa')) ativa = models.BooleanField( + default=False, choices=YES_NO_CHOICES, verbose_name=_('Comissão Ativa?')) diff --git a/sapl/materia/forms.py b/sapl/materia/forms.py index a91567a7f..db78675a9 100644 --- a/sapl/materia/forms.py +++ b/sapl/materia/forms.py @@ -597,6 +597,11 @@ class AutorForm(ModelForm): required=True, label=_('Confirmar Email')) + username = forms.CharField( + required=True, + max_length=50 + ) + class Meta: model = Autor fields = ['username', diff --git a/sapl/materia/legacy.yaml b/sapl/materia/legacy.yaml index afcd1b70b..899d1b72a 100644 --- a/sapl/materia/legacy.yaml +++ b/sapl/materia/legacy.yaml @@ -63,6 +63,7 @@ Autor: partido: cod_partido tipo: tip_autor username: col_username + user: Autoria: autor: cod_autor diff --git a/sapl/materia/migrations/0046_auto_20160825_1504.py b/sapl/materia/migrations/0046_auto_20160825_1504.py new file mode 100644 index 000000000..26e078d05 --- /dev/null +++ b/sapl/materia/migrations/0046_auto_20160825_1504.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-08-25 18:04 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('materia', '0045_auto_20160823_1658'), + ] + + operations = [ + migrations.AlterField( + model_name='autor', + name='user', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/sapl/materia/migrations/0047_merge.py b/sapl/materia/migrations/0047_merge.py new file mode 100644 index 000000000..dd4fbdfa2 --- /dev/null +++ b/sapl/materia/migrations/0047_merge.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-08-29 16:45 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('materia', '0046_auto_20160825_1833'), + ('materia', '0046_auto_20160825_1504'), + ] + + operations = [ + ] diff --git a/sapl/materia/models.py b/sapl/materia/models.py index 26380163c..ac179f714 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -208,9 +208,7 @@ class TipoAutor(models.Model): class Autor(models.Model): - user = models.ForeignKey(User, - blank=True, - null=True) + user = models.ForeignKey(User, blank=True, null=True) partido = models.ForeignKey(Partido, blank=True, null=True) comissao = models.ForeignKey(Comissao, blank=True, null=True) parlamentar = models.ForeignKey(Parlamentar, blank=True, null=True) diff --git a/sapl/protocoloadm/legacy.yaml b/sapl/protocoloadm/legacy.yaml index 3497770d2..3772d2f6d 100644 --- a/sapl/protocoloadm/legacy.yaml +++ b/sapl/protocoloadm/legacy.yaml @@ -59,6 +59,5 @@ TramitacaoAdministrativo: documento: cod_documento status: cod_status texto: txt_tramitacao - ultima: ind_ult_tramitacao unidade_tramitacao_destino: cod_unid_tram_dest unidade_tramitacao_local: cod_unid_tram_local From c0db40b6afaba1f2fbe9470165e47457ec715cf6 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Tue, 30 Aug 2016 17:10:37 -0300 Subject: [PATCH 2/2] Corrige caminho dos arquivos .txt do script anonimizador Signed-off-by: Luciano Almeida --- scripts/anonimizador/anon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/anonimizador/anon.py b/scripts/anonimizador/anon.py index 2711f0114..98618cee7 100644 --- a/scripts/anonimizador/anon.py +++ b/scripts/anonimizador/anon.py @@ -23,9 +23,9 @@ models = [m for m in models m not in excluidos and m._meta.app_label not in ['compilacao', 'base']] -nomes = [n.strip() for n in open('nomes.txt').readlines()] +nomes = [n.strip() for n in open('scripts/anonimizador/nomes.txt').readlines()] -conteudo = open('paragrafos.txt').read() +conteudo = open('scripts/anonimizador/paragrafos.txt').read() pars_list = [p.replace('"', '') for p in re.split('\n\n+', conteudo.strip())] pars = defaultdict(list) for p in pars_list: