Browse Source

Merge pull request #534 from interlegis/533-consertar-migracao

fix #533 - Ajustes no script de migração
pull/588/merge
Edward 8 years ago
committed by GitHub
parent
commit
b950060d2a
  1. 1
      sapl/comissoes/legacy.yaml
  2. 20
      sapl/comissoes/migrations/0006_auto_20160825_1335.py
  3. 1
      sapl/comissoes/models.py
  4. 5
      sapl/materia/forms.py
  5. 1
      sapl/materia/legacy.yaml
  6. 22
      sapl/materia/migrations/0046_auto_20160825_1504.py
  7. 16
      sapl/materia/migrations/0047_merge.py
  8. 4
      sapl/materia/models.py
  9. 1
      sapl/protocoloadm/legacy.yaml
  10. 4
      scripts/anonimizador/anon.py

1
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

20
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?'),
),
]

1
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,
default=True,
verbose_name=_('Comissão Ativa?'))

5
sapl/materia/forms.py

@ -666,6 +666,11 @@ class AutorForm(ModelForm):
required=True,
label=_('Confirmar Email'))
username = forms.CharField(
required=True,
max_length=50
)
class Meta:
model = Autor
fields = ['username',

1
sapl/materia/legacy.yaml

@ -63,6 +63,7 @@ Autor:
partido: cod_partido
tipo: tip_autor
username: col_username
user:
Autoria:
autor: cod_autor

22
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),
),
]

16
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 = [
]

4
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)

1
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

4
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:

Loading…
Cancel
Save