Browse Source

Renomeia módulo e função de migração

pull/1728/head
Marcio Mazza 7 years ago
parent
commit
5394ac32c1
  1. 5
      sapl/legacy/management/commands/migracao_25_31.py
  2. 6
      sapl/legacy/migracao.py
  3. 2
      sapl/legacy/migracao_documentos.py
  4. 2
      sapl/legacy/scripts/scrap_original_forms.py
  5. 2
      sapl/legacy/scripts/study.py
  6. 2
      sapl/legacy/scripts/utils.py
  7. 2
      sapl/legacy/test_migration.py
  8. 2
      sapl/legacy/test_renames.py

5
sapl/legacy/management/commands/migracao_25_31.py

@ -1,6 +1,7 @@
from django.core import management
from django.core.management.base import BaseCommand
from sapl.legacy import migration
from sapl.legacy.migracao import migrar
class Command(BaseCommand):
@ -18,4 +19,4 @@ class Command(BaseCommand):
def handle(self, *args, **options):
management.call_command('migrate')
migration.migrate(interativo=not options['force'])
migrar(interativo=not options['force'])

6
sapl/legacy/migration.py → sapl/legacy/migracao.py

@ -647,7 +647,7 @@ class DataMigrator:
setattr(new, field.name, value)
def migrate(self, obj=appconfs, interativo=True):
def migrar(self, obj=appconfs, interativo=True):
# warning: model/app migration order is of utmost importance
uniformiza_banco()
@ -774,9 +774,9 @@ class DataMigrator:
exec_legado(sql_delete_legado)
def migrate(obj=appconfs, interativo=True):
def migrar(obj=appconfs, interativo=True):
dm = DataMigrator()
dm.migrate(obj, interativo)
dm.migrar(obj, interativo)
# MIGRATION_ADJUSTMENTS #####################################################

2
sapl/legacy/migracao_documentos.py

@ -6,7 +6,7 @@ from glob import glob
import yaml
from sapl.base.models import CasaLegislativa
from sapl.legacy.migration import exec_legado, warn
from sapl.legacy.migracao import exec_legado, warn
from sapl.materia.models import (DocumentoAcessorio, MateriaLegislativa,
Proposicao)
from sapl.norma.models import NormaJuridica

2
sapl/legacy/scripts/scrap_original_forms.py

@ -10,7 +10,7 @@ from bs4.element import NavigableString, Tag
from django.apps.config import AppConfig
from sapl.crispy_layout_mixin import heads_and_tails
from sapl.legacy.migration import appconfs, get_renames
from sapl.legacy.migracao import appconfs, get_renames
from sapl.legacy.scripts.utils import getsourcelines
from sapl.utils import listify

2
sapl/legacy/scripts/study.py

@ -1,5 +1,5 @@
from django.apps import apps
from sapl.legacy.migration import legacy_app
from sapl.legacy.migracao import legacy_app
for model in apps.get_app_config('legacy').get_models():
if 'ind_excluido' in [f.name for f in model._meta.fields]:

2
sapl/legacy/scripts/utils.py

@ -1,7 +1,7 @@
import inspect
from sapl.base.models import Autor
from sapl.legacy.migration import appconfs
from sapl.legacy.migracao import appconfs
def getsourcelines(model):

2
sapl/legacy/test_migration.py

@ -1,6 +1,6 @@
from random import shuffle
from .migration import (_formatar_lista_para_sql, get_autorias_sem_repeticoes,
from .migracao import (_formatar_lista_para_sql, get_autorias_sem_repeticoes,
get_reapontamento_de_autores_repetidos)

2
sapl/legacy/test_renames.py

@ -3,7 +3,7 @@ import sapl.materia
import sapl.norma
import sapl.sessao
from .migration import appconfs, get_renames, legacy_app
from .migracao import appconfs, get_renames, legacy_app
RENAMING_IGNORED_MODELS = [
sapl.comissoes.models.Composicao,

Loading…
Cancel
Save