From dd1351d70f752ab0231511913e80828400e061ed Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 14 Mar 2017 14:17:58 -0300 Subject: [PATCH 001/140] =?UTF-8?q?Adapta=20migra=C3=A7=C3=A3o=20para=20ro?= =?UTF-8?q?dar=20em=20paralelo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../management/commands/migracao_25_31.py | 14 ++++++- sapl/legacy/migration.py | 42 ++++++++++--------- sapl/legacy/scripts/migra_dbs.sh | 5 +++ sapl/legacy/scripts/migra_um_db.sh | 25 +++++++++++ sapl/legacy/scripts/recria_dbs_postgres.sh | 5 +++ sapl/legacy/scripts/recria_um_db_postgres.sh | 5 +++ sapl/legacy_migration_settings.py | 12 ++++-- 7 files changed, 84 insertions(+), 24 deletions(-) create mode 100755 sapl/legacy/scripts/migra_dbs.sh create mode 100755 sapl/legacy/scripts/migra_um_db.sh create mode 100755 sapl/legacy/scripts/recria_dbs_postgres.sh create mode 100755 sapl/legacy/scripts/recria_um_db_postgres.sh diff --git a/sapl/legacy/management/commands/migracao_25_31.py b/sapl/legacy/management/commands/migracao_25_31.py index f01b8117a..5334ac7c0 100644 --- a/sapl/legacy/management/commands/migracao_25_31.py +++ b/sapl/legacy/management/commands/migracao_25_31.py @@ -4,7 +4,17 @@ from sapl.legacy import migration class Command(BaseCommand): - help = u'Faz a migração de dados do SAPL 2.5 para o SAPL 3.1' + + help = u'Migração de dados do SAPL 2.5 para o SAPL 3.1' + + def add_arguments(self, parser): + parser.add_argument( + '-f', + action='store_true', + default=False, + dest='force', + help='Não interativa: pula confirmação de exclusão dos dados', + ) def handle(self, *args, **options): - migration.migrate() + migration.migrate(interativo=not options['force']) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index f4b6f00a6..c7bad24d9 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -11,11 +11,10 @@ from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from django.db import OperationalError, ProgrammingError, connections, models -from django.db.models import CharField, Max, ProtectedError, TextField, signals +from django.db.models import CharField, Max, ProtectedError, TextField from django.db.models.base import ModelBase from model_mommy import mommy from model_mommy.mommy import foreign_key_required, make -from reversion.models import Revision, Version from sapl.base.models import Autor, ProblemaMigracao from sapl.comissoes.models import Comissao, Composicao, Participacao @@ -28,6 +27,7 @@ from sapl.norma.models import (AssuntoNorma, NormaJuridica, from sapl.parlamentares.models import Parlamentar from sapl.protocoloadm.models import Protocolo, StatusTramitacaoAdministrativo from sapl.sessao.models import ExpedienteMateria, OrdemDia, SessaoPlenaria +from sapl.settings import PROJECT_DIR from sapl.utils import normalize # BASE ###################################################################### @@ -316,9 +316,9 @@ def fill_vinculo_norma_juridica(): ('L', 'Suspende integralmente a norma'), ('N', 'Julgada integralmente inconstitucional'), ('O', 'Julgada parcialmente inconstitucional')] - lista_objs = [VinculoNormaJuridica(sigla=item[0], descricao=item[1]) + lista_objs = [TipoVinculoNormaJuridica(sigla=item[0], descricao=item[1]) for item in lista] - VinculoNormaJuridica.objects.bulk_create(lista_objs) + TipoVinculoNormaJuridica.objects.bulk_create(lista_objs) class DataMigrator: @@ -394,24 +394,28 @@ class DataMigrator: value = None setattr(new, field.name, value) - def migrate(self, obj=appconfs): + def migrate(self, obj=appconfs, interativo=True): # warning: model/app migration order is of utmost importance - exec_sql_file('sapl/legacy/scripts/fix_tables.sql', 'legacy') + exec_sql_file(PROJECT_DIR.child( + 'sapl', 'legacy', 'scripts', 'fix_tables.sql'), 'legacy') self.to_delete = [] # excluindo database antigo. - info('Todos os dados do banco serão excluidos. ' - 'Recomendamos que faça backup do banco sapl antes de continuar.') - info('Deseja continuar? [s/n]') - resposta = input() - if resposta.lower() in ['s', 'sim', 'y', 'yes']: - pass - else: - info('Migração cancelada.') - return 0 + if interativo: + info('Todos os dados do banco serão excluidos. ' + 'Recomendamos que faça backup do banco sapl ' + 'antes de continuar.') + info('Deseja continuar? [s/n]') + resposta = input() + if resposta.lower() in ['s', 'sim', 'y', 'yes']: + pass + else: + info('Migração cancelada.') + return 0 info('Excluindo entradas antigas do banco.') - call(['./manage.py', 'flush', '--settings=sapl.settings', - '--database=default', '--no-input'], stdout=PIPE) + call([PROJECT_DIR.child('manage.py'), 'flush', + '--settings=sapl.settings', '--database=default', '--no-input'], + stdout=PIPE) info('Começando migração: %s...' % obj) self._do_migrate(obj) @@ -528,9 +532,9 @@ class DataMigrator: return excluidos -def migrate(obj=appconfs): +def migrate(obj=appconfs, interativo=True): dm = DataMigrator() - dm.migrate(obj) + dm.migrate(obj, interativo) # MIGRATION_ADJUSTMENTS ##################################################### diff --git a/sapl/legacy/scripts/migra_dbs.sh b/sapl/legacy/scripts/migra_dbs.sh new file mode 100755 index 000000000..c7529e015 --- /dev/null +++ b/sapl/legacy/scripts/migra_dbs.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# rodar esse script na raiz do projeto + +parallel --verbose ./sapl/legacy/scripts/migra_um_db.sh :::: <(mysql -u root -padmin -e 'show databases;' | grep '^sapl_') diff --git a/sapl/legacy/scripts/migra_um_db.sh b/sapl/legacy/scripts/migra_um_db.sh new file mode 100755 index 000000000..26240d8d4 --- /dev/null +++ b/sapl/legacy/scripts/migra_um_db.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# rodar esse script na raiz do projeto + +DIR=~/logs_migracao +mkdir -p $DIR + +LOG="$DIR/$1.migracao.log" +rm -f $LOG + +echo "########################################" | tee -a $LOG +echo "MIGRANDO BANCO $1" | tee -a $LOG +echo "########################################" | tee -a $LOG +echo >> $LOG + + +echo "--- DJANGO MIGRATE ---" | tee -a $LOG +echo >> $LOG +DATABASE_NAME=$1 ./manage.py migrate --settings sapl.legacy_migration_settings +echo >> $LOG + +echo "--- MIGRACAO DE DADOS ---" | tee -a $LOG +echo >> $LOG +DATABASE_NAME=$1 ./manage.py migracao_25_31 -f --settings sapl.legacy_migration_settings |& tee -a $LOG +echo >> $LOG diff --git a/sapl/legacy/scripts/recria_dbs_postgres.sh b/sapl/legacy/scripts/recria_dbs_postgres.sh new file mode 100755 index 000000000..6fbf18794 --- /dev/null +++ b/sapl/legacy/scripts/recria_dbs_postgres.sh @@ -0,0 +1,5 @@ +# (Re)cria todos os bancos postgres para migração +# cria um banco postgres (de mesmo nome) para cada banco mysql cujo nome começa com "sapl_" + +mysql -u root -padmin -e 'show databases;' | grep '^sapl_' | xargs -I{} ./recria_um_db_postgres.sh {} + diff --git a/sapl/legacy/scripts/recria_um_db_postgres.sh b/sapl/legacy/scripts/recria_um_db_postgres.sh new file mode 100755 index 000000000..fd56a95ee --- /dev/null +++ b/sapl/legacy/scripts/recria_um_db_postgres.sh @@ -0,0 +1,5 @@ +# (Re)cria um db postgres +# uso: recria_um_db_postgres + +sudo -u postgres psql -c "drop DATABASE if exists $1" +sudo -u postgres psql -c "CREATE DATABASE $1 WITH OWNER = sapl ENCODING = 'UTF8' TABLESPACE = pg_default LC_COLLATE = 'pt_BR.UTF-8' LC_CTYPE = 'pt_BR.UTF-8' CONNECTION LIMIT = -1 TEMPLATE template0;" diff --git a/sapl/legacy_migration_settings.py b/sapl/legacy_migration_settings.py index d46c4b027..2b7366fc2 100644 --- a/sapl/legacy_migration_settings.py +++ b/sapl/legacy_migration_settings.py @@ -1,12 +1,11 @@ import os -from decouple import AutoConfig, Config, RepositoryEnv +from decouple import Config, RepositoryEnv from dj_database_url import parse as db_url from .settings import * # flake8: noqa -config = AutoConfig() -config.config = Config(RepositoryEnv(os.path.abspath('sapl/legacy/.env'))) +config = Config(RepositoryEnv(BASE_DIR.child('legacy', '.env'))) INSTALLED_APPS += ( @@ -15,6 +14,13 @@ INSTALLED_APPS += ( DATABASES['legacy'] = config('DATABASE_URL', cast=db_url,) +# Sobrescreve o nome dos bancos caso a variável de ambiente seja definida +# Útil para migração em lote de vários bancos +DATABASE_NAME_OVERRIDE = os.environ.get('DATABASE_NAME') +if DATABASE_NAME_OVERRIDE: + for db in DATABASES.values(): + db['NAME'] = DATABASE_NAME_OVERRIDE + DATABASE_ROUTERS = ['sapl.legacy.router.LegacyRouter', ] DEBUG = False From 3bfda6c3817704cc563c935e30ccd900b50cf319 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 14 Mar 2017 19:06:05 -0300 Subject: [PATCH 002/140] =?UTF-8?q?Adiciona=20script=20para=20rodar=20shel?= =?UTF-8?q?l=5Fplus=20de=20migra=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit o script usa um banco específico, passado como argumento --- sapl/legacy/scripts/shell_para_migracao.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 sapl/legacy/scripts/shell_para_migracao.sh diff --git a/sapl/legacy/scripts/shell_para_migracao.sh b/sapl/legacy/scripts/shell_para_migracao.sh new file mode 100755 index 000000000..fb0f3c6de --- /dev/null +++ b/sapl/legacy/scripts/shell_para_migracao.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Inicia um shell_plus com as configurações de migração usando um banco específico +# Uso: ./shell_para_migracao.sh + +# Rode esse script a partir da raiz do projeto + +DATABASE_NAME=$1 ./manage.py shell_plus --settings sapl.legacy_migration_settings From cedb6cc15979d03fd4e479401f47fa089d10f755 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 14 Mar 2017 19:41:02 -0300 Subject: [PATCH 003/140] Exclui legacy da busca por ContentType p TipoAutor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bugfix para migrações de vários bancos --- sapl/legacy/migration.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index c7bad24d9..e42fd5fe4 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -386,12 +386,13 @@ class DataMigrator: setattr(new, field.name, value) elif field.model.__name__ == 'TipoAutor' and \ field.name == 'content_type': - try: - value = field.related_model.objects.get( - model=normalize(new.descricao.lower()).replace(' ', - '')) - except ObjectDoesNotExist: - value = None + + model = normalize(new.descricao.lower()).replace(' ', '') + content_types = field.related_model.objects.filter( + model=model).exclude(app_label='legacy') + assert len(content_types) <= 1 + + value = content_types[0] if content_types else None setattr(new, field.name, value) def migrate(self, obj=appconfs, interativo=True): From 2baf3fbe7b9daf8b2d05b7ed348b9d2b66f762f3 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Wed, 22 Mar 2017 13:59:56 -0300 Subject: [PATCH 004/140] Arruma tabelas do lexml e sessao_plenaria_presenca Signed-off-by: Luciano Almeida --- sapl/legacy/migration.py | 3 ++- sapl/legacy/scripts/fix_tables.sql | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index e42fd5fe4..307eef716 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -580,7 +580,8 @@ def adjust_protocolo(new, old): if new.numero is None and not primeira_vez: p = ProtocoloLegado.objects.filter( ano_protocolo=new.ano).aggregate(Max('num_protocolo')) - new.numero = p['num_protocolo__max'] + 1 + numero_maximo = p['num_protocolo__max'] + new.numero = 1 if numero_maximo is None else numero_maximo + 1 primeira_vez.append(True) if new.numero is None and primeira_vez: p = Protocolo.objects.filter( diff --git a/sapl/legacy/scripts/fix_tables.sql b/sapl/legacy/scripts/fix_tables.sql index 997379f65..a112775b5 100644 --- a/sapl/legacy/scripts/fix_tables.sql +++ b/sapl/legacy/scripts/fix_tables.sql @@ -1,3 +1,16 @@ -DROP PROCEDURE IF EXISTS verifica_campos; -CREATE PROCEDURE verifica_campos() BEGIN IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='proposicao' AND column_name='num_proposicao') THEN ALTER TABLE proposicao add column num_proposicao int(11) NULL after txt_justif_devolucao; END IF; END; -CALL verifica_campos; +-- Apaga as restrições somente para essa sessão +SET SESSION sql_mode = ''; +-- Exclui procedures caso já existam +DROP PROCEDURE IF EXISTS verifica_campos_proposicao; +DROP PROCEDURE IF EXISTS verifica_campos_sessao_plenaria_presenca; +DROP PROCEDURE IF EXISTS cria_lexml_registro_provedor_e_publicador; +-- Procedure para criar campo num_proposicao em proposicao +CREATE PROCEDURE verifica_campos_proposicao() BEGIN IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='proposicao' AND column_name='num_proposicao') THEN ALTER TABLE proposicao ADD COLUMN num_proposicao INT(11) NULL after txt_justif_devolucao; END IF; END; +-- Procedure para criar campos cod_presenca_sessao (sendo a nova PK da tabela) e dat_sessao em sessao_plenaria_presenca +CREATE PROCEDURE verifica_campos_sessao_plenaria_presenca() BEGIN IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='sessao_plenaria_presenca' AND column_name='cod_presenca_sessao') THEN ALTER TABLE sessao_plenaria_presenca DROP PRIMARY KEY, ADD cod_presenca_sessao INT AUTO_INCREMENT PRIMARY KEY FIRST; END IF; IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='sessao_plenaria_presenca' AND column_name='dat_sessao') THEN ALTER TABLE sessao_plenaria_presenca ADD COLUMN dat_sessao DATE NULL after cod_parlamentar; END IF; END; +-- Procedure para criar tabela lexml_registro_provedor e lexml_registro_publicador +CREATE PROCEDURE cria_lexml_registro_provedor_e_publicador() BEGIN CREATE TABLE IF NOT EXISTS lexml_registro_publicador (cod_publicador INT AUTO_INCREMENT NOT NULL, id_publicador INT, nom_publicador VARCHAR(255), adm_email VARCHAR(50), sigla VARCHAR(255), nom_responsavel VARCHAR(255), tipo VARCHAR(50), id_responsavel INT, PRIMARY KEY (cod_publicador)); CREATE TABLE IF NOT EXISTS lexml_registro_provedor (cod_provedor INT AUTO_INCREMENT NOT NULL, id_provedor INT, nom_provedor VARCHAR(255), sgl_provedor VARCHAR(15), adm_email VARCHAR(50), nom_responsavel VARCHAR(255), tipo VARCHAR(50), id_responsavel INT, xml_provedor LONGTEXT, PRIMARY KEY (cod_provedor)); END; +-- Executa as procedures criadas acima +CALL verifica_campos_proposicao; +CALL verifica_campos_sessao_plenaria_presenca; +CALL cria_lexml_registro_provedor_e_publicador; From 1febb2256681e4e1b31dc035fc2d6449d79bc1b0 Mon Sep 17 00:00:00 2001 From: LeandroRoberto Date: Thu, 23 Mar 2017 09:14:16 -0300 Subject: [PATCH 005/140] Add col mandato_titular na list de Parlamentares --- sapl/crispy_layout_mixin.py | 13 +++++++------ sapl/parlamentares/views.py | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/sapl/crispy_layout_mixin.py b/sapl/crispy_layout_mixin.py index 2c9bc7c37..82bc2538a 100644 --- a/sapl/crispy_layout_mixin.py +++ b/sapl/crispy_layout_mixin.py @@ -1,12 +1,12 @@ from math import ceil -import rtyaml from crispy_forms.bootstrap import FormActions from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML, Div, Fieldset, Layout, Submit from django import template from django.utils import formats from django.utils.translation import ugettext as _ +import rtyaml def heads_and_tails(list_of_lists): @@ -60,15 +60,16 @@ def get_field_display(obj, fieldname): field = '' try: field = obj._meta.get_field(fieldname) - except: + except Exception as e: + """ nos casos que o fieldname não é um field_model, + ele pode ser um aggregate, annotate, um property, um manager, + ou mesmo uma método no model. + """ field = getattr(obj, fieldname) - if 'ManyRelatedManager' not in str(type(field))\ - and 'RelatedManager' not in str(type(field))\ - and 'GenericRelatedObjectManager' not in str(type(field)): - return '', str(field) verbose_name = str(field.verbose_name)\ if hasattr(field, 'verbose_name') else '' + if hasattr(field, 'choices') and field.choices: value = getattr(obj, 'get_%s_display' % fieldname)() else: diff --git a/sapl/parlamentares/views.py b/sapl/parlamentares/views.py index 485439d93..0f7f0ee70 100644 --- a/sapl/parlamentares/views.py +++ b/sapl/parlamentares/views.py @@ -1,6 +1,7 @@ from django.contrib import messages from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse, reverse_lazy +from django.db.models import F from django.http.response import HttpResponseRedirect from django.utils.datastructures import MultiValueDictKeyError from django.utils.translation import ugettext_lazy as _ @@ -21,6 +22,7 @@ from .models import (CargoMesa, Coligacao, ComposicaoColigacao, ComposicaoMesa, NivelInstrucao, Parlamentar, Partido, SessaoLegislativa, SituacaoMilitar, TipoAfastamento, TipoDependente, Votante) + CargoMesaCrud = CrudAux.build(CargoMesa, 'cargo_mesa') PartidoCrud = CrudAux.build(Partido, 'partidos') SessaoLegislativaCrud = CrudAux.build(SessaoLegislativa, 'sessao_legislativa') @@ -60,8 +62,8 @@ class VotanteView(MasterDetailCrud): if obj.user: obj.user.delete() return HttpResponseRedirect( - reverse('sapl.parlamentares:votante_list', - kwargs={'pk': obj.parlamentar.pk})) + reverse('sapl.parlamentares:votante_list', + kwargs={'pk': obj.parlamentar.pk})) class FrenteList(MasterDetailCrud): @@ -107,7 +109,7 @@ class ProposicaoParlamentarCrud(CrudBaseForListAndDetailExternalAppView): def get_context_data(self, **kwargs): context = CrudBaseForListAndDetailExternalAppView\ - .ListView.get_context_data(self, **kwargs) + .ListView.get_context_data(self, **kwargs) context['title'] = context['title'].replace( 'Proposições', 'Matérias') return context @@ -264,7 +266,7 @@ class ParlamentarCrud(Crud): class BaseMixin(Crud.BaseMixin): ordered_list = False list_field_names = [ - 'avatar_html', 'nome_parlamentar', 'filiacao_atual', 'ativo'] + 'avatar_html', 'nome_parlamentar', 'filiacao_atual', 'ativo', 'mandato_titular'] class DetailView(Crud.DetailView): @@ -310,7 +312,8 @@ class ParlamentarCrud(Crud): legislatura_id = self.take_legislatura_id() if legislatura_id != 0: return queryset.filter( - mandato__legislatura_id=legislatura_id) + mandato__legislatura_id=legislatura_id).annotate( + mandato_titular=F('mandato__titular')) else: try: l = Legislatura.objects.all().order_by( @@ -320,10 +323,11 @@ class ParlamentarCrud(Crud): else: if l is None: return Legislatura.objects.all() - return queryset.filter(mandato__legislatura_id=l) + return queryset.filter(mandato__legislatura_id=l).annotate( + mandato_titular=F('mandato__titular')) def get_headers(self): - return ['', _('Parlamentar'), _('Partido'), _('Ativo?')] + return ['', _('Parlamentar'), _('Partido'), _('Ativo?'), _('Titular?')] def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) @@ -404,7 +408,7 @@ class MesaDiretoraView(FormView): sessao_legislativa_id=sessao_plenaria.id, # parlamentar_id = integrante.parlamentar_id, cargo_id=cargo.id - ).exists() + ).exists() def post(self, request, *args, **kwargs): From 78e34ba2de7f89060eebbb88a79e021b94bf0ad6 Mon Sep 17 00:00:00 2001 From: LeandroRoberto Date: Thu, 23 Mar 2017 09:27:44 -0300 Subject: [PATCH 006/140] =?UTF-8?q?Corrige=20interpret=20do=20que=20=C3=A9?= =?UTF-8?q?=20field=20e=20do=20que=20=C3=A9=20value?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/crispy_layout_mixin.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sapl/crispy_layout_mixin.py b/sapl/crispy_layout_mixin.py index 82bc2538a..e9dbc3f01 100644 --- a/sapl/crispy_layout_mixin.py +++ b/sapl/crispy_layout_mixin.py @@ -65,15 +65,17 @@ def get_field_display(obj, fieldname): ele pode ser um aggregate, annotate, um property, um manager, ou mesmo uma método no model. """ - field = getattr(obj, fieldname) - - verbose_name = str(field.verbose_name)\ - if hasattr(field, 'verbose_name') else '' + value = getattr(obj, fieldname) + verbose_name = '' - if hasattr(field, 'choices') and field.choices: - value = getattr(obj, 'get_%s_display' % fieldname)() else: - value = getattr(obj, fieldname) + verbose_name = str(field.verbose_name)\ + if hasattr(field, 'verbose_name') else '' + + if hasattr(field, 'choices') and field.choices: + value = getattr(obj, 'get_%s_display' % fieldname)() + else: + value = getattr(obj, fieldname) str_type = str(type(value)) From 9c188cca6d1aea00f41017b07dabe83f54f1bd5d Mon Sep 17 00:00:00 2001 From: Edward Date: Thu, 23 Mar 2017 14:58:44 -0300 Subject: [PATCH 007/140] =?UTF-8?q?Adiciona=20a=20diretiva=20on=5Fdelete?= =?UTF-8?q?=20para=20proteger=20dele=C3=A7=C3=B5es=20em=20cascata=20em=20c?= =?UTF-8?q?omissoes,=20materia,=20norma,=20parlamentares,=20sessao=20e=20p?= =?UTF-8?q?rotocoloadm.=20(#974)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/comissoes/models.py | 20 ++++++--- sapl/materia/models.py | 87 ++++++++++++++++++++++++------------ sapl/norma/models.py | 17 ++++--- sapl/parlamentares/models.py | 48 +++++++++++++------- sapl/protocoloadm/models.py | 30 ++++++++++--- sapl/sessao/models.py | 83 +++++++++++++++++++++++----------- 6 files changed, 195 insertions(+), 90 deletions(-) diff --git a/sapl/comissoes/models.py b/sapl/comissoes/models.py index 4483dd07a..a21a20508 100644 --- a/sapl/comissoes/models.py +++ b/sapl/comissoes/models.py @@ -32,7 +32,9 @@ class TipoComissao(models.Model): @reversion.register() class Comissao(models.Model): - tipo = models.ForeignKey(TipoComissao, verbose_name=_('Tipo')) + tipo = models.ForeignKey(TipoComissao, + on_delete=models.PROTECT, + verbose_name=_('Tipo')) nome = models.CharField(max_length=60, verbose_name=_('Nome')) sigla = models.CharField(max_length=10, verbose_name=_('Sigla')) data_criacao = models.DateField(verbose_name=_('Data de Criação')) @@ -132,8 +134,12 @@ class CargoComissao(models.Model): @reversion.register() class Composicao(models.Model): # IGNORE - comissao = models.ForeignKey(Comissao, verbose_name=_('Comissão')) - periodo = models.ForeignKey(Periodo, verbose_name=_('Período')) + comissao = models.ForeignKey(Comissao, + on_delete=models.PROTECT, + verbose_name=_('Comissão')) + periodo = models.ForeignKey(Periodo, + on_delete=models.PROTECT, + verbose_name=_('Período')) class Meta: verbose_name = _('Composição de Comissão') @@ -145,9 +151,11 @@ class Composicao(models.Model): # IGNORE @reversion.register() class Participacao(models.Model): # ComposicaoComissao - composicao = models.ForeignKey(Composicao, related_name='participacao_set') - parlamentar = models.ForeignKey(Parlamentar) - cargo = models.ForeignKey(CargoComissao) + composicao = models.ForeignKey(Composicao, + related_name='participacao_set', + on_delete=models.PROTECT) + parlamentar = models.ForeignKey(Parlamentar, on_delete=models.PROTECT) + cargo = models.ForeignKey(CargoComissao, on_delete=models.PROTECT) titular = models.BooleanField( verbose_name=_('Titular'), default=False, diff --git a/sapl/materia/models.py b/sapl/materia/models.py index 488a4e555..bbffb6d45 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -38,6 +38,7 @@ class TipoProposicao(models.Model): # FIXME - para a rotina de migração - estes campos mudaram # retire o comentário quando resolver content_type = models.ForeignKey(ContentType, default=None, + on_delete=models.PROTECT, verbose_name=_('Definição de Tipo')) object_id = models.PositiveIntegerField( blank=True, null=True, default=None) @@ -123,7 +124,9 @@ TIPO_APRESENTACAO_CHOICES = Choices(('O', 'oral', _('Oral')), @reversion.register() class MateriaLegislativa(models.Model): - tipo = models.ForeignKey(TipoMateriaLegislativa, verbose_name=_('Tipo')) + tipo = models.ForeignKey(TipoMateriaLegislativa, + on_delete=models.PROTECT, + verbose_name=_('Tipo')) numero = models.PositiveIntegerField(verbose_name=_('Número')) ano = models.PositiveSmallIntegerField(verbose_name=_('Ano'), choices=RANGE_ANOS) @@ -135,7 +138,9 @@ class MateriaLegislativa(models.Model): verbose_name=_('Tipo de Apresentação'), choices=TIPO_APRESENTACAO_CHOICES) regime_tramitacao = models.ForeignKey( - RegimeTramitacao, verbose_name=_('Regime Tramitação')) + RegimeTramitacao, + on_delete=models.PROTECT, + verbose_name=_('Regime Tramitação')) data_publicacao = models.DateField( blank=True, null=True, verbose_name=_('Data Publicação')) tipo_origem_externa = models.ForeignKey( @@ -143,6 +148,7 @@ class MateriaLegislativa(models.Model): blank=True, null=True, related_name='tipo_origem_externa_set', + on_delete=models.PROTECT, verbose_name=_('Tipo')) numero_origem_externa = models.CharField( max_length=5, blank=True, verbose_name=_('Número')) @@ -151,7 +157,8 @@ class MateriaLegislativa(models.Model): data_origem_externa = models.DateField( blank=True, null=True, verbose_name=_('Data')) local_origem_externa = models.ForeignKey( - Origem, blank=True, null=True, verbose_name=_('Local Origem')) + Origem, blank=True, null=True, + on_delete=models.PROTECT, verbose_name=_('Local Origem')) apelido = models.CharField( max_length=50, blank=True, verbose_name=_('Apelido')) dias_prazo = models.PositiveIntegerField( @@ -236,9 +243,12 @@ class MateriaLegislativa(models.Model): @reversion.register() class Autoria(models.Model): - autor = models.ForeignKey(Autor, verbose_name=_('Autor')) + autor = models.ForeignKey(Autor, + verbose_name=_('Autor'), + on_delete=models.PROTECT) materia = models.ForeignKey( - MateriaLegislativa, verbose_name=_('Matéria Legislativa')) + MateriaLegislativa, on_delete=models.PROTECT, + verbose_name=_('Matéria Legislativa')) primeiro_autor = models.BooleanField(verbose_name=_('Primeiro Autor'), choices=YES_NO_CHOICES, default=False) @@ -255,7 +265,7 @@ class Autoria(models.Model): @reversion.register() class AcompanhamentoMateria(models.Model): usuario = models.CharField(max_length=50) - materia = models.ForeignKey(MateriaLegislativa) + materia = models.ForeignKey(MateriaLegislativa, on_delete=models.PROTECT) email = models.EmailField( max_length=100, verbose_name=_('E-mail')) data_cadastro = models.DateField(auto_now_add=True) @@ -275,9 +285,11 @@ class AcompanhamentoMateria(models.Model): @reversion.register() class Anexada(models.Model): materia_principal = models.ForeignKey( - MateriaLegislativa, related_name='materia_principal_set') + MateriaLegislativa, related_name='materia_principal_set', + on_delete=models.PROTECT) materia_anexada = models.ForeignKey( - MateriaLegislativa, related_name='materia_anexada_set') + MateriaLegislativa, related_name='materia_anexada_set', + on_delete=models.PROTECT) data_anexacao = models.DateField(verbose_name=_('Data Anexação')) data_desanexacao = models.DateField( blank=True, null=True, verbose_name=_('Data Desanexação')) @@ -311,8 +323,8 @@ class DespachoInicial(models.Model): # TODO M2M? # TODO Despachos não são necessáriamente comissoes, podem ser outros # órgãos, ex: procuradorias - materia = models.ForeignKey(MateriaLegislativa) - comissao = models.ForeignKey(Comissao) + materia = models.ForeignKey(MateriaLegislativa, on_delete=models.PROTECT) + comissao = models.ForeignKey(Comissao, on_delete=models.PROTECT) class Meta: verbose_name = _('Despacho Inicial') @@ -346,8 +358,10 @@ class TipoDocumento(models.Model): @reversion.register() class DocumentoAcessorio(models.Model): - materia = models.ForeignKey(MateriaLegislativa) - tipo = models.ForeignKey(TipoDocumento, verbose_name=_('Tipo')) + materia = models.ForeignKey(MateriaLegislativa, on_delete=models.PROTECT) + tipo = models.ForeignKey(TipoDocumento, + on_delete=models.PROTECT, + verbose_name=_('Tipo')) nome = models.CharField(max_length=30, verbose_name=_('Nome')) data = models.DateField(blank=True, null=True, verbose_name=_('Data')) autor = models.CharField( @@ -400,8 +414,8 @@ class DocumentoAcessorio(models.Model): @reversion.register() class MateriaAssunto(models.Model): # TODO M2M ?? - assunto = models.ForeignKey(AssuntoMateria) - materia = models.ForeignKey(MateriaLegislativa) + assunto = models.ForeignKey(AssuntoMateria, on_delete=models.PROTECT) + materia = models.ForeignKey(MateriaLegislativa, on_delete=models.PROTECT) class Meta: verbose_name = _('Relação Matéria - Assunto') @@ -414,9 +428,11 @@ class MateriaAssunto(models.Model): @reversion.register() class Numeracao(models.Model): - materia = models.ForeignKey(MateriaLegislativa) + materia = models.ForeignKey(MateriaLegislativa, on_delete=models.PROTECT) tipo_materia = models.ForeignKey( - TipoMateriaLegislativa, verbose_name=_('Tipo de Matéria')) + TipoMateriaLegislativa, + on_delete=models.PROTECT, + verbose_name=_('Tipo de Matéria')) numero_materia = models.CharField(max_length=5, verbose_name=_('Número')) ano_materia = models.PositiveSmallIntegerField(verbose_name=_('Ano'), @@ -481,15 +497,19 @@ class TipoFimRelatoria(models.Model): @reversion.register() class Relatoria(models.Model): - materia = models.ForeignKey(MateriaLegislativa) - parlamentar = models.ForeignKey(Parlamentar, verbose_name=_('Parlamentar')) + materia = models.ForeignKey(MateriaLegislativa, on_delete=models.PROTECT) + parlamentar = models.ForeignKey(Parlamentar, + on_delete=models.PROTECT, + verbose_name=_('Parlamentar')) tipo_fim_relatoria = models.ForeignKey( TipoFimRelatoria, blank=True, null=True, + on_delete=models.PROTECT, verbose_name=_('Motivo Fim Relatoria')) comissao = models.ForeignKey( - Comissao, blank=True, null=True, verbose_name=_('Comissão')) + Comissao, blank=True, null=True, + on_delete=models.PROTECT, verbose_name=_('Comissão')) data_designacao_relator = models.DateField( verbose_name=_('Data Designação')) data_destituicao_relator = models.DateField( @@ -508,8 +528,8 @@ class Relatoria(models.Model): @reversion.register() class Parecer(models.Model): - relatoria = models.ForeignKey(Relatoria) - materia = models.ForeignKey(MateriaLegislativa) + relatoria = models.ForeignKey(Relatoria, on_delete=models.PROTECT) + materia = models.ForeignKey(MateriaLegislativa, on_delete=models.PROTECT) tipo_conclusao = models.CharField(max_length=3, blank=True) tipo_apresentacao = models.CharField( max_length=1, choices=TIPO_APRESENTACAO_CHOICES) @@ -527,8 +547,12 @@ class Parecer(models.Model): @reversion.register() class Proposicao(models.Model): - autor = models.ForeignKey(Autor, null=True, blank=True, on_delete=PROTECT) - tipo = models.ForeignKey(TipoProposicao, verbose_name=_('Tipo')) + autor = models.ForeignKey(Autor, + null=True, + blank=True, + on_delete=models.PROTECT) + tipo = models.ForeignKey(TipoProposicao, on_delete=models.PROTECT, + verbose_name=_('Tipo')) # XXX data_envio was not null, but actual data said otherwise!!! data_envio = models.DateTimeField( @@ -587,6 +611,7 @@ class Proposicao(models.Model): # retire o comentário quando resolver materia_de_vinculo = models.ForeignKey( MateriaLegislativa, blank=True, null=True, + on_delete=models.PROTECT, verbose_name=_('Matéria anexadora'), related_name=_('proposicao_set')) @@ -687,11 +712,14 @@ class StatusTramitacao(models.Model): @reversion.register() class UnidadeTramitacao(models.Model): comissao = models.ForeignKey( - Comissao, blank=True, null=True, verbose_name=_('Comissão')) + Comissao, blank=True, null=True, + on_delete=models.PROTECT, verbose_name=_('Comissão')) orgao = models.ForeignKey( - Orgao, blank=True, null=True, verbose_name=_('Órgão')) + Orgao, blank=True, null=True, + on_delete=models.PROTECT, verbose_name=_('Órgão')) parlamentar = models.ForeignKey( - Parlamentar, blank=True, null=True, verbose_name=_('Parlamentar')) + Parlamentar, blank=True, null=True, + on_delete=models.PROTECT, verbose_name=_('Parlamentar')) class Meta: verbose_name = _('Unidade de Tramitação') @@ -736,18 +764,21 @@ class Tramitacao(models.Model): ('C', 'segunda_terceira_votacao', _('2ª e 3ª Votação')), ) - status = models.ForeignKey(StatusTramitacao, verbose_name=_('Status')) - materia = models.ForeignKey(MateriaLegislativa) + status = models.ForeignKey(StatusTramitacao, on_delete=models.PROTECT, + verbose_name=_('Status')) + materia = models.ForeignKey(MateriaLegislativa, on_delete=models.PROTECT) data_tramitacao = models.DateField(verbose_name=_('Data Tramitação')) unidade_tramitacao_local = models.ForeignKey( UnidadeTramitacao, related_name='tramitacoes_origem', + on_delete=models.PROTECT, verbose_name=_('Unidade Local')) data_encaminhamento = models.DateField( blank=True, null=True, verbose_name=_('Data Encaminhamento')) unidade_tramitacao_destino = models.ForeignKey( UnidadeTramitacao, related_name='tramitacoes_destino', + on_delete=models.PROTECT, verbose_name=_('Unidade Destino')) urgente = models.BooleanField(verbose_name=_('Urgente ?'), choices=YES_NO_CHOICES) diff --git a/sapl/norma/models.py b/sapl/norma/models.py index 8a412be1c..24e56dcb9 100644 --- a/sapl/norma/models.py +++ b/sapl/norma/models.py @@ -72,9 +72,12 @@ class NormaJuridica(models.Model): upload_to=texto_upload_path, verbose_name=_('Texto Integral')) tipo = models.ForeignKey( - TipoNormaJuridica, verbose_name=_('Tipo da Norma Juridica')) + TipoNormaJuridica, + on_delete=models.PROTECT, + verbose_name=_('Tipo da Norma Juridica')) materia = models.ForeignKey( - MateriaLegislativa, blank=True, null=True, verbose_name=_('Matéria')) + MateriaLegislativa, blank=True, null=True, + on_delete=models.PROTECT, verbose_name=_('Matéria')) numero = models.CharField( max_length=8, verbose_name=_('Número')) @@ -158,8 +161,8 @@ class NormaJuridica(models.Model): @reversion.register() class LegislacaoCitada(models.Model): - materia = models.ForeignKey(MateriaLegislativa) - norma = models.ForeignKey(NormaJuridica) + materia = models.ForeignKey(MateriaLegislativa, on_delete=models.PROTECT) + norma = models.ForeignKey(NormaJuridica, on_delete=models.PROTECT) disposicoes = models.CharField( max_length=15, blank=True, verbose_name=_('Disposição')) parte = models.CharField( @@ -215,13 +218,17 @@ class NormaRelacionada(models.Model): norma_principal = models.ForeignKey( NormaJuridica, related_name='norma_principal', + on_delete=models.PROTECT, verbose_name=_('Norma Principal')) norma_relacionada = models.ForeignKey( NormaJuridica, related_name='norma_relacionada', + on_delete=models.PROTECT, verbose_name=_('Norma Relacionada')) tipo_vinculo = models.ForeignKey( - TipoVinculoNormaJuridica, verbose_name=_('Tipo de Vínculo')) + TipoVinculoNormaJuridica, + on_delete=models.PROTECT, + verbose_name=_('Tipo de Vínculo')) class Meta: verbose_name = _('Norma Relacionada') diff --git a/sapl/parlamentares/models.py b/sapl/parlamentares/models.py index e134cad8a..1152b94df 100644 --- a/sapl/parlamentares/models.py +++ b/sapl/parlamentares/models.py @@ -55,6 +55,7 @@ class SessaoLegislativa(models.Model): legislatura = models.ForeignKey( Legislatura, + on_delete=models.PROTECT, verbose_name=Legislatura._meta.verbose_name) numero = models.PositiveIntegerField(verbose_name=_('Número')) tipo = models.CharField( @@ -80,7 +81,9 @@ class SessaoLegislativa(models.Model): @reversion.register() class Coligacao(models.Model): - legislatura = models.ForeignKey(Legislatura, verbose_name=_('Legislatura')) + legislatura = models.ForeignKey(Legislatura, + on_delete=models.PROTECT, + verbose_name=_('Legislatura')) nome = models.CharField(max_length=50, verbose_name=_('Nome')) numero_votos = models.PositiveIntegerField( blank=True, null=True, verbose_name=_('Nº Votos Recebidos')) @@ -130,8 +133,9 @@ class Partido(models.Model): class ComposicaoColigacao(models.Model): # TODO M2M partido = models.ForeignKey(Partido, + on_delete=models.PROTECT, verbose_name=_('Partidos da Coligação')) - coligacao = models.ForeignKey(Coligacao) + coligacao = models.ForeignKey(Coligacao, on_delete=models.PROTECT) class Meta: verbose_name = (_('Composição Coligação')) @@ -213,11 +217,13 @@ class Parlamentar(models.Model): NivelInstrucao, blank=True, null=True, + on_delete=models.PROTECT, verbose_name=_('Nível Instrução')) situacao_militar = models.ForeignKey( SituacaoMilitar, blank=True, null=True, + on_delete=models.PROTECT, verbose_name=_('Situação Militar')) nome_completo = models.CharField( max_length=50, verbose_name=_('Nome Completo')) @@ -247,7 +253,8 @@ class Parlamentar(models.Model): blank=True, verbose_name=_('Endereço Residencial')) municipio_residencia = models.ForeignKey( - Municipio, blank=True, null=True, verbose_name=_('Município')) + Municipio, blank=True, null=True, + on_delete=models.PROTECT, verbose_name=_('Município')) cep_residencia = models.CharField( max_length=9, blank=True, verbose_name=_('CEP')) telefone_residencia = models.CharField( @@ -363,8 +370,9 @@ class Dependente(models.Model): SEXO_CHOICE = ((FEMININO, _('Feminino')), (MASCULINO, _('Masculino'))) - tipo = models.ForeignKey(TipoDependente, verbose_name=_('Tipo')) - parlamentar = models.ForeignKey(Parlamentar) + tipo = models.ForeignKey(TipoDependente, on_delete=models.PROTECT, + verbose_name=_('Tipo')) + parlamentar = models.ForeignKey(Parlamentar, on_delete=models.PROTECT) nome = models.CharField(max_length=50, verbose_name=_('Nome')) sexo = models.CharField( max_length=1, verbose_name=_('Sexo'), choices=SEXO_CHOICE) @@ -390,8 +398,10 @@ class Dependente(models.Model): @reversion.register() class Filiacao(models.Model): data = models.DateField(verbose_name=_('Data Filiação')) - parlamentar = models.ForeignKey(Parlamentar) - partido = models.ForeignKey(Partido, verbose_name=_('Partido')) + parlamentar = models.ForeignKey(Parlamentar, on_delete=models.PROTECT) + partido = models.ForeignKey(Partido, + on_delete=models.PROTECT, + verbose_name=_('Partido')) data_desfiliacao = models.DateField( blank=True, null=True, verbose_name=_('Data Desfiliação')) @@ -427,12 +437,14 @@ class TipoAfastamento(models.Model): @reversion.register() class Mandato(models.Model): - parlamentar = models.ForeignKey(Parlamentar) + parlamentar = models.ForeignKey(Parlamentar, on_delete=models.PROTECT) tipo_afastamento = models.ForeignKey( - TipoAfastamento, blank=True, null=True) - legislatura = models.ForeignKey(Legislatura, verbose_name=_('Legislatura')) + TipoAfastamento, blank=True, null=True, on_delete=models.PROTECT) + legislatura = models.ForeignKey(Legislatura, on_delete=models.PROTECT, + verbose_name=_('Legislatura')) coligacao = models.ForeignKey( - Coligacao, blank=True, null=True, verbose_name=_('Coligação')) + Coligacao, blank=True, null=True, + on_delete=models.PROTECT, verbose_name=_('Coligação')) # TODO what is this field?????? tipo_causa_fim_mandato = models.PositiveIntegerField(blank=True, null=True) data_fim_mandato = models.DateField(verbose_name=_('Fim do Mandato')) @@ -445,7 +457,7 @@ class Mandato(models.Model): default=True, choices=YES_NO_CHOICES, verbose_name=_('Vereador Titular')) - + observacao = models.TextField( blank=True, verbose_name=_('Observação')) @@ -489,9 +501,10 @@ class CargoMesa(models.Model): @reversion.register() class ComposicaoMesa(models.Model): # TODO M2M ???? Ternary????? - parlamentar = models.ForeignKey(Parlamentar) - sessao_legislativa = models.ForeignKey(SessaoLegislativa) - cargo = models.ForeignKey(CargoMesa) + parlamentar = models.ForeignKey(Parlamentar, on_delete=models.PROTECT) + sessao_legislativa = models.ForeignKey(SessaoLegislativa, + on_delete=models.PROTECT) + cargo = models.ForeignKey(CargoMesa, on_delete=models.PROTECT) class Meta: verbose_name = _('Ocupação de cargo na Mesa') @@ -546,9 +559,10 @@ class Frente(models.Model): class Votante(models.Model): parlamentar = models.ForeignKey( - Parlamentar, verbose_name=_('Parlamentar'), related_name='parlamentar') + Parlamentar, verbose_name=_('Parlamentar'), + on_delete=models.PROTECT, related_name='parlamentar') user = models.ForeignKey( - get_settings_auth_user_model(), + get_settings_auth_user_model(), on_delete=models.PROTECT, verbose_name=_('User'), related_name='user') data = models.DateTimeField( verbose_name=_('Data'), auto_now_add=True, diff --git a/sapl/protocoloadm/models.py b/sapl/protocoloadm/models.py index 551fdcc19..6294399f8 100644 --- a/sapl/protocoloadm/models.py +++ b/sapl/protocoloadm/models.py @@ -64,17 +64,22 @@ class Protocolo(models.Model): tipo_processo = models.PositiveIntegerField() interessado = models.CharField( max_length=60, blank=True, verbose_name=_('Interessado')) - autor = models.ForeignKey(Autor, blank=True, null=True) + autor = models.ForeignKey(Autor, + blank=True, + null=True, + on_delete=models.PROTECT) assunto_ementa = models.TextField(blank=True) tipo_documento = models.ForeignKey( TipoDocumentoAdministrativo, blank=True, null=True, + on_delete=models.PROTECT, verbose_name=_('Tipo de documento')) tipo_materia = models.ForeignKey( TipoMateriaLegislativa, blank=True, null=True, + on_delete=models.PROTECT, verbose_name=_('Tipo Matéria')) numero_paginas = models.PositiveIntegerField( blank=True, null=True, verbose_name=_('Número de Páginas')) @@ -103,20 +108,24 @@ class Protocolo(models.Model): @reversion.register() class DocumentoAdministrativo(models.Model): tipo = models.ForeignKey( - TipoDocumentoAdministrativo, verbose_name=_('Tipo Documento')) + TipoDocumentoAdministrativo, on_delete=models.PROTECT, + verbose_name=_('Tipo Documento')) numero = models.PositiveIntegerField(verbose_name=_('Número')) ano = models.PositiveSmallIntegerField(verbose_name=_('Ano'), choices=RANGE_ANOS) protocolo = models.ForeignKey( Protocolo, blank=True, - null=True, verbose_name=_('Protocolo')) + null=True, + on_delete=models.PROTECT, + verbose_name=_('Protocolo')) data = models.DateField(verbose_name=_('Data')) numero_protocolo = models.PositiveIntegerField( blank=True, null=True, verbose_name=_('Núm. Protocolo')) interessado = models.CharField( max_length=50, blank=True, verbose_name=_('Interessado')) - autor = models.ForeignKey(Autor, blank=True, null=True) + autor = models.ForeignKey(Autor, blank=True, null=True, + on_delete=models.PROTECT) dias_prazo = models.PositiveIntegerField( blank=True, null=True, verbose_name=_('Dias Prazo')) data_fim_prazo = models.DateField( @@ -169,9 +178,12 @@ class DocumentoAdministrativo(models.Model): @reversion.register() class DocumentoAcessorioAdministrativo(models.Model): - documento = models.ForeignKey(DocumentoAdministrativo) + documento = models.ForeignKey(DocumentoAdministrativo, + on_delete=models.PROTECT) tipo = models.ForeignKey( - TipoDocumentoAdministrativo, verbose_name=_('Tipo')) + TipoDocumentoAdministrativo, + on_delete=models.PROTECT, + verbose_name=_('Tipo')) nome = models.CharField(max_length=30, verbose_name=_('Nome')) arquivo = models.FileField( blank=True, @@ -244,19 +256,23 @@ class StatusTramitacaoAdministrativo(models.Model): class TramitacaoAdministrativo(models.Model): status = models.ForeignKey( StatusTramitacaoAdministrativo, + on_delete=models.PROTECT, verbose_name=_('Status')) - documento = models.ForeignKey(DocumentoAdministrativo) + documento = models.ForeignKey(DocumentoAdministrativo, + on_delete=models.PROTECT) data_tramitacao = models.DateField( verbose_name=_('Data Tramitação')) unidade_tramitacao_local = models.ForeignKey( UnidadeTramitacao, related_name='adm_tramitacoes_origem', + on_delete=models.PROTECT, verbose_name=_('Unidade Local')) data_encaminhamento = models.DateField( blank=True, null=True, verbose_name=_('Data Encaminhamento')) unidade_tramitacao_destino = models.ForeignKey( UnidadeTramitacao, related_name='adm_tramitacoes_destino', + on_delete=models.PROTECT, verbose_name=_('Unidade Destino')) texto = models.TextField( blank=True, verbose_name=_('Texto da Ação')) diff --git a/sapl/sessao/models.py b/sapl/sessao/models.py index ffbb4d753..33b2c73ad 100644 --- a/sapl/sessao/models.py +++ b/sapl/sessao/models.py @@ -32,11 +32,16 @@ class CargoBancada(models.Model): @reversion.register() class Bancada(models.Model): - legislatura = models.ForeignKey(Legislatura, verbose_name=_('Legislatura')) + legislatura = models.ForeignKey(Legislatura, + on_delete=models.PROTECT, + verbose_name=_('Legislatura')) nome = models.CharField( max_length=80, verbose_name=_('Nome da Bancada')) - partido = models.ForeignKey(Partido, blank=True, null=True, + partido = models.ForeignKey(Partido, + blank=True, + null=True, + on_delete=models.PROTECT, verbose_name=_('Partido')) data_criacao = models.DateField(blank=True, null=True, verbose_name=_('Data Criação')) @@ -104,10 +109,16 @@ class SessaoPlenaria(models.Model): # TODO analyze querying all hosted databases ! cod_andamento_sessao = models.PositiveIntegerField(blank=True, null=True) - tipo = models.ForeignKey(TipoSessaoPlenaria, verbose_name=_('Tipo')) + tipo = models.ForeignKey(TipoSessaoPlenaria, + on_delete=models.PROTECT, + verbose_name=_('Tipo')) sessao_legislativa = models.ForeignKey( - SessaoLegislativa, verbose_name=_('Sessão Legislativa')) - legislatura = models.ForeignKey(Legislatura, verbose_name=_('Legislatura')) + SessaoLegislativa, + on_delete=models.PROTECT, + verbose_name=_('Sessão Legislativa')) + legislatura = models.ForeignKey(Legislatura, + on_delete=models.PROTECT, + verbose_name=_('Legislatura')) # XXX seems to be empty data_inicio = models.DateField(verbose_name=_('Abertura')) hora_inicio = models.CharField( @@ -209,8 +220,10 @@ class AbstractOrdemDia(models.Model): (3, 'secreta', (('Secreta'))), ) - sessao_plenaria = models.ForeignKey(SessaoPlenaria) + sessao_plenaria = models.ForeignKey(SessaoPlenaria, + on_delete=models.PROTECT) materia = models.ForeignKey(MateriaLegislativa, + on_delete=models.PROTECT, verbose_name=_('Matéria')) data_ordem = models.DateField(verbose_name=_('Data da Sessão')) observacao = models.TextField( @@ -254,8 +267,9 @@ class TipoExpediente(models.Model): @reversion.register() class ExpedienteSessao(models.Model): # ExpedienteSessaoPlenaria - sessao_plenaria = models.ForeignKey(SessaoPlenaria) - tipo = models.ForeignKey(TipoExpediente) + sessao_plenaria = models.ForeignKey(SessaoPlenaria, + on_delete=models.PROTECT) + tipo = models.ForeignKey(TipoExpediente, on_delete=models.PROTECT) conteudo = models.TextField( blank=True, verbose_name=_('Conteúdo do expediente')) @@ -269,9 +283,10 @@ class ExpedienteSessao(models.Model): # ExpedienteSessaoPlenaria @reversion.register() class IntegranteMesa(models.Model): # MesaSessaoPlenaria - sessao_plenaria = models.ForeignKey(SessaoPlenaria) - cargo = models.ForeignKey(CargoMesa) - parlamentar = models.ForeignKey(Parlamentar) + sessao_plenaria = models.ForeignKey(SessaoPlenaria, + on_delete=models.PROTECT) + cargo = models.ForeignKey(CargoMesa, on_delete=models.PROTECT) + parlamentar = models.ForeignKey(Parlamentar, on_delete=models.PROTECT) class Meta: verbose_name = _('Participação em Mesa de Sessão Plenaria') @@ -283,8 +298,11 @@ class IntegranteMesa(models.Model): # MesaSessaoPlenaria @reversion.register() class AbstractOrador(models.Model): # Oradores - sessao_plenaria = models.ForeignKey(SessaoPlenaria) - parlamentar = models.ForeignKey(Parlamentar, verbose_name=_('Parlamentar')) + sessao_plenaria = models.ForeignKey(SessaoPlenaria, + on_delete=models.PROTECT) + parlamentar = models.ForeignKey(Parlamentar, + on_delete=models.PROTECT, + verbose_name=_('Parlamentar')) numero_ordem = models.PositiveIntegerField( verbose_name=_('Ordem de pronunciamento')) url_discurso = models.URLField( @@ -328,8 +346,9 @@ class OrdemDia(AbstractOrdemDia): @reversion.register() class PresencaOrdemDia(models.Model): # OrdemDiaPresenca - sessao_plenaria = models.ForeignKey(SessaoPlenaria) - parlamentar = models.ForeignKey(Parlamentar) + sessao_plenaria = models.ForeignKey(SessaoPlenaria, + on_delete=models.PROTECT) + parlamentar = models.ForeignKey(Parlamentar, on_delete=models.PROTECT) class Meta: verbose_name = _('Presença da Ordem do Dia') @@ -358,10 +377,18 @@ class TipoResultadoVotacao(models.Model): @reversion.register() class RegistroVotacao(models.Model): tipo_resultado_votacao = models.ForeignKey( - TipoResultadoVotacao, verbose_name=_('Resultado da Votação')) - materia = models.ForeignKey(MateriaLegislativa) - ordem = models.ForeignKey(OrdemDia, blank=True, null=True) - expediente = models.ForeignKey(ExpedienteMateria, blank=True, null=True) + TipoResultadoVotacao, + on_delete=models.PROTECT, + verbose_name=_('Resultado da Votação')) + materia = models.ForeignKey(MateriaLegislativa, on_delete=models.PROTECT) + ordem = models.ForeignKey(OrdemDia, + blank=True, + null=True, + on_delete=models.PROTECT) + expediente = models.ForeignKey(ExpedienteMateria, + blank=True, + null=True, + on_delete=models.PROTECT) numero_votos_sim = models.PositiveIntegerField(verbose_name=_('Sim')) numero_votos_nao = models.PositiveIntegerField(verbose_name=_('Não')) numero_abstencoes = models.PositiveIntegerField( @@ -383,8 +410,8 @@ class RegistroVotacao(models.Model): @reversion.register() class VotoParlamentar(models.Model): # RegistroVotacaoParlamentar - votacao = models.ForeignKey(RegistroVotacao) - parlamentar = models.ForeignKey(Parlamentar) + votacao = models.ForeignKey(RegistroVotacao, on_delete=models.PROTECT) + parlamentar = models.ForeignKey(Parlamentar, on_delete=models.PROTECT) # XXX change to restricted choices voto = models.CharField(max_length=10) @@ -399,13 +426,14 @@ class VotoParlamentar(models.Model): # RegistroVotacaoParlamentar @reversion.register() class VotoNominal(models.Model): - parlamentar = models.ForeignKey(Parlamentar) + parlamentar = models.ForeignKey(Parlamentar, on_delete=models.PROTECT) voto = models.CharField(verbose_name=_('Voto'), max_length=10) - sessao = models.ForeignKey(SessaoPlenaria) - materia = models.ForeignKey(MateriaLegislativa) + sessao = models.ForeignKey(SessaoPlenaria, on_delete=models.PROTECT) + materia = models.ForeignKey(MateriaLegislativa, on_delete=models.PROTECT) - user = models.ForeignKey(get_settings_auth_user_model()) + user = models.ForeignKey(get_settings_auth_user_model(), + on_delete=models.PROTECT) ip = models.CharField(verbose_name=_('IP'), max_length=30) data_hora = models.DateTimeField( verbose_name=_('Data/Hora'), auto_now_add=True) @@ -420,8 +448,9 @@ class VotoNominal(models.Model): @reversion.register() class SessaoPlenariaPresenca(models.Model): - sessao_plenaria = models.ForeignKey(SessaoPlenaria) - parlamentar = models.ForeignKey(Parlamentar) + sessao_plenaria = models.ForeignKey(SessaoPlenaria, + on_delete=models.PROTECT) + parlamentar = models.ForeignKey(Parlamentar, on_delete=models.PROTECT) data_sessao = models.DateField(blank=True, null=True) class Meta: From aa72156722d7a5a1f8563e807962843e00ef26d0 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 24 Mar 2017 12:46:55 -0300 Subject: [PATCH 008/140] =?UTF-8?q?Cria=20script=20p=20gerar=20gr=C3=A1fic?= =?UTF-8?q?o=20de=20deps=20entre=20models?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/gerar_grafico_apps.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 scripts/gerar_grafico_apps.sh diff --git a/scripts/gerar_grafico_apps.sh b/scripts/gerar_grafico_apps.sh new file mode 100644 index 000000000..312f04b0c --- /dev/null +++ b/scripts/gerar_grafico_apps.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +python -c "from sapl.settings import SAPL_APPS; print(*[s.split('.')[-1] for s in SAPL_APPS])" | xargs -t ./manage.py graph_models -d -g -o zzz.png -l fdp From b11ee25bccc954b2ede63a5eec3b38edbf5bf5c4 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Fri, 24 Mar 2017 15:18:20 -0300 Subject: [PATCH 009/140] Reordena imports --- sapl/protocoloadm/urls.py | 7 ++++--- scripts/fk_protocoloadm_docadm.py | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sapl/protocoloadm/urls.py b/sapl/protocoloadm/urls.py index 66dac0fdb..0c22d74d1 100644 --- a/sapl/protocoloadm/urls.py +++ b/sapl/protocoloadm/urls.py @@ -1,7 +1,6 @@ from django.conf.urls import include, url -from sapl.protocoloadm.views import (atualizar_numero_documento, - AnularProtocoloAdmView, +from sapl.protocoloadm.views import (AnularProtocoloAdmView, ComprovanteProtocoloView, CriarDocumentoProtocolo, DetailDocumentoAdministrativo, @@ -17,7 +16,9 @@ from sapl.protocoloadm.views import (atualizar_numero_documento, ProtocoloPesquisaView, StatusTramitacaoAdministrativoCrud, TipoDocumentoAdministrativoCrud, - TramitacaoAdmCrud, doc_texto_integral) + TramitacaoAdmCrud, + atualizar_numero_documento, + doc_texto_integral) from .apps import AppConfig diff --git a/scripts/fk_protocoloadm_docadm.py b/scripts/fk_protocoloadm_docadm.py index cb66a74bd..a4294206c 100644 --- a/scripts/fk_protocoloadm_docadm.py +++ b/scripts/fk_protocoloadm_docadm.py @@ -3,6 +3,7 @@ from django.core.exceptions import ObjectDoesNotExist + from sapl.protocoloadm.models import DocumentoAdministrativo, Protocolo From 3b0a0dc37bf1061fcea673b1de23e09ee5bd2e10 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Fri, 24 Mar 2017 15:41:30 -0300 Subject: [PATCH 010/140] =?UTF-8?q?Ajusta=20c=C3=B3digo=20para=20QA=20scri?= =?UTF-8?q?pt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/compilacao/views.py | 2 +- sapl/materia/forms.py | 19 +++++++++---------- sapl/materia/models.py | 1 - sapl/materia/views.py | 7 +++---- sapl/norma/views.py | 6 +----- sapl/parlamentares/forms.py | 2 +- sapl/parlamentares/models.py | 1 - .../parlamentares/tests/test_parlamentares.py | 4 ++-- sapl/parlamentares/views.py | 10 ++++++++-- sapl/protocoloadm/forms.py | 2 +- sapl/protocoloadm/views.py | 3 ++- sapl/sessao/models.py | 1 - sapl/sessao/views.py | 9 +++++---- sapl/utils.py | 1 - 14 files changed, 33 insertions(+), 35 deletions(-) diff --git a/sapl/compilacao/views.py b/sapl/compilacao/views.py index 2dc8f688c..142b7f46d 100644 --- a/sapl/compilacao/views.py +++ b/sapl/compilacao/views.py @@ -1,7 +1,7 @@ import logging import sys from collections import OrderedDict -from datetime import datetime, timedelta +from datetime import timedelta from braces.views import FormMessagesMixin from django import forms diff --git a/sapl/materia/forms.py b/sapl/materia/forms.py index 951a8ed7c..e1fda4119 100644 --- a/sapl/materia/forms.py +++ b/sapl/materia/forms.py @@ -26,16 +26,13 @@ import sapl from sapl.base.models import Autor from sapl.comissoes.models import Comissao from sapl.compilacao.models import (STATUS_TA_IMMUTABLE_PUBLIC, - STATUS_TA_PRIVATE, STATUS_TA_PUBLIC, - PerfilEstruturalTextoArticulado, - TextoArticulado) + STATUS_TA_PRIVATE) from sapl.crispy_layout_mixin import (SaplFormLayout, form_actions, to_column, to_row) from sapl.materia.models import (MateriaLegislativa, RegimeTramitacao, TipoDocumento, TipoProposicao) from sapl.norma.models import (LegislacaoCitada, NormaJuridica, TipoNormaJuridica) -from sapl.parlamentares.models import Parlamentar from sapl.protocoloadm.models import Protocolo from sapl.settings import MAX_DOC_UPLOAD_SIZE from sapl.utils import (RANGE_ANOS, YES_NO_CHOICES, @@ -780,7 +777,8 @@ class TipoProposicaoForm(ModelForm): tipo_select = Fieldset(TipoProposicao._meta.verbose_name, Div(to_column(('descricao', 5)), - to_column(('content_type', 7)), css_class='clearfix'), + to_column(('content_type', 7)), + css_class='clearfix'), to_column(('tipo_conteudo_related_radio', 6)), to_column(('perfis', 6))) @@ -847,11 +845,12 @@ class TipoProposicaoSelect(Select): selected_choices.remove(option_value) else: selected_html = '' - return format_html('', - option_value, - selected_html, - str(data_has_perfil), - force_text(option_label)) + return format_html( + '', + option_value, + selected_html, + str(data_has_perfil), + force_text(option_label)) def render_options(self, choices, selected_choices): # Normalize to strings. diff --git a/sapl/materia/models.py b/sapl/materia/models.py index bbffb6d45..372efadf0 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -5,7 +5,6 @@ from django.contrib.auth.models import Group from django.contrib.contenttypes.fields import GenericRelation from django.contrib.contenttypes.models import ContentType from django.db import models -from django.db.models.deletion import PROTECT from django.utils import formats from django.utils.translation import ugettext_lazy as _ from model_utils import Choices diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 8a401b079..e8331e469 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -24,8 +24,7 @@ from django_filters.views import FilterView import sapl from sapl.base.models import Autor, CasaLegislativa from sapl.comissoes.models import Comissao, Participacao -from sapl.compilacao.models import (STATUS_TA_EDITION, - STATUS_TA_IMMUTABLE_RESTRICT, +from sapl.compilacao.models import (STATUS_TA_IMMUTABLE_RESTRICT, STATUS_TA_PRIVATE) from sapl.compilacao.views import IntegracaoTaView from sapl.crispy_layout_mixin import SaplFormLayout, form_actions @@ -37,7 +36,6 @@ from sapl.materia.forms import (AnexadaForm, ConfirmarProposicaoForm, LegislacaoCitadaForm, ProposicaoForm, TipoProposicaoForm) from sapl.norma.models import LegislacaoCitada -from sapl.parlamentares.models import Parlamentar from sapl.protocoloadm.models import Protocolo from sapl.utils import (TURNO_TRAMITACAO_CHOICES, YES_NO_CHOICES, autor_label, autor_modal, gerar_hash_arquivo, get_base_url, @@ -417,7 +415,8 @@ class ReceberProposicao(PermissionRequiredForAppCrudMixin, FormView): else: hasher = gerar_hash_arquivo( proposicao.texto_original.path, - str(proposicao.pk)) if proposicao.texto_original else None + str(proposicao.pk)) \ + if proposicao.texto_original else None if hasher == form.cleaned_data['cod_hash']: return HttpResponseRedirect( reverse('sapl.materia:proposicao-confirmar', diff --git a/sapl/norma/views.py b/sapl/norma/views.py index 10dbf4ad2..461c1b9ef 100644 --- a/sapl/norma/views.py +++ b/sapl/norma/views.py @@ -1,13 +1,9 @@ -from datetime import datetime - +from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse from django.http import JsonResponse -from django.shortcuts import redirect from django.utils.translation import ugettext_lazy as _ -from django.views.generic import FormView, ListView from django.views.generic.base import RedirectView from django_filters.views import FilterView - from sapl.base.models import AppConfig from sapl.compilacao.views import IntegracaoTaView from sapl.crud.base import (RP_DETAIL, RP_LIST, Crud, CrudAux, diff --git a/sapl/parlamentares/forms.py b/sapl/parlamentares/forms.py index cd70ca995..9e2b26b59 100644 --- a/sapl/parlamentares/forms.py +++ b/sapl/parlamentares/forms.py @@ -62,7 +62,7 @@ class MandatoForm(ModelForm): data = self.cleaned_data try: if 'legislatura' in data and 'parlamentar' in data: - mandato = Mandato.objects.get( + Mandato.objects.get( parlamentar__pk=self.initial['parlamentar'].pk, legislatura__pk=data['legislatura'].pk) except ObjectDoesNotExist: diff --git a/sapl/parlamentares/models.py b/sapl/parlamentares/models.py index 1152b94df..d09f8dfac 100644 --- a/sapl/parlamentares/models.py +++ b/sapl/parlamentares/models.py @@ -1,7 +1,6 @@ from datetime import datetime import reversion -from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ from model_utils import Choices diff --git a/sapl/parlamentares/tests/test_parlamentares.py b/sapl/parlamentares/tests/test_parlamentares.py index 6881b7a18..b71816d5b 100644 --- a/sapl/parlamentares/tests/test_parlamentares.py +++ b/sapl/parlamentares/tests/test_parlamentares.py @@ -122,9 +122,9 @@ def test_mandato_submit(admin_client): mommy.make(Parlamentar, pk=14) mommy.make(Legislatura, pk=5) - response = admin_client.post(reverse('sapl.parlamentares:mandato_create', + admin_client.post(reverse('sapl.parlamentares:mandato_create', kwargs={'pk': 14}), - {'parlamentar': 14, # hidden field + {'parlamentar': 14, # hidden field 'legislatura': 5, 'data_fim_mandato': '2016-01-01', 'data_expedicao_diploma': '2016-03-22', diff --git a/sapl/parlamentares/views.py b/sapl/parlamentares/views.py index 0f7f0ee70..a4f698b5a 100644 --- a/sapl/parlamentares/views.py +++ b/sapl/parlamentares/views.py @@ -266,7 +266,11 @@ class ParlamentarCrud(Crud): class BaseMixin(Crud.BaseMixin): ordered_list = False list_field_names = [ - 'avatar_html', 'nome_parlamentar', 'filiacao_atual', 'ativo', 'mandato_titular'] + 'avatar_html', + 'nome_parlamentar', + 'filiacao_atual', + 'ativo', + 'mandato_titular'] class DetailView(Crud.DetailView): @@ -327,7 +331,9 @@ class ParlamentarCrud(Crud): mandato_titular=F('mandato__titular')) def get_headers(self): - return ['', _('Parlamentar'), _('Partido'), _('Ativo?'), _('Titular?')] + return ['', + _('Parlamentar'), _('Partido'), + _('Ativo?'), _('Titular?')] def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) diff --git a/sapl/protocoloadm/forms.py b/sapl/protocoloadm/forms.py index 1caf5c569..bca51df31 100644 --- a/sapl/protocoloadm/forms.py +++ b/sapl/protocoloadm/forms.py @@ -547,7 +547,7 @@ class DocumentoAdministrativoForm(ModelForm): get_field('ano').verbose_name, choices=RANGE_ANOS, widget=forms.Select( - attrs={'class': 'selector'})) + attrs={'class': 'selector'})) class Meta: model = DocumentoAdministrativo diff --git a/sapl/protocoloadm/views.py b/sapl/protocoloadm/views.py index 3e13920d4..9505f3bd9 100644 --- a/sapl/protocoloadm/views.py +++ b/sapl/protocoloadm/views.py @@ -341,7 +341,8 @@ class ProtocoloMostrarView(PermissionRequiredMixin, TemplateView): if protocolo.tipo_documento: context[ - 'documentos'] = protocolo.documentoadministrativo_set.all().order_by('-ano', '-numero') + 'documentos'] = protocolo.documentoadministrativo_set\ + .all().order_by('-ano', '-numero') context['protocolo'] = protocolo return context diff --git a/sapl/sessao/models.py b/sapl/sessao/models.py index 33b2c73ad..e308b4187 100644 --- a/sapl/sessao/models.py +++ b/sapl/sessao/models.py @@ -1,5 +1,4 @@ import reversion -from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ from model_utils import Choices diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 928e5f746..372cbff7e 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -603,9 +603,11 @@ class PainelView(PermissionRequiredForAppCrudMixin, TemplateView): cronometro_aparte = AppsAppConfig.attr('cronometro_aparte') cronometro_ordem = AppsAppConfig.attr('cronometro_ordem') - if not cronometro_discurso or not cronometro_aparte or not cronometro_ordem: + if (not cronometro_discurso or not cronometro_aparte + or not cronometro_ordem): msg = _( - 'Você precisa primeiro configurar os cronômetros nas Configurações da Aplicação') + 'Você precisa primeiro configurar os cronômetros \ + nas Configurações da Aplicação') messages.add_message(self.request, messages.ERROR, msg) else: @@ -2419,7 +2421,7 @@ def mudar_ordem_materia_sessao(request): pk_list = request.POST.getlist('pk_list[]') materia = request.POST['materia'] - + # Verifica se está nas Matérias do Expediente ou da Ordem do Dia if materia == 'expediente': materia = ExpedienteMateria @@ -2448,7 +2450,6 @@ def mudar_ordem_materia_sessao(request): m.numero_ordem = m.numero_ordem - 1 m.save() - # Se a posição inicial for maior que a final, todos que # estiverem abaixo da nova posição devem ter sua ordem incrementada # em uma posição diff --git a/sapl/utils.py b/sapl/utils.py index 09902fae9..d957add71 100644 --- a/sapl/utils.py +++ b/sapl/utils.py @@ -16,7 +16,6 @@ from django.contrib import admin from django.contrib.contenttypes.fields import (GenericForeignKey, GenericRel, GenericRelation) from django.core.exceptions import ValidationError -from django.utils.text import slugify from django.utils.translation import ugettext_lazy as _ from floppyforms import ClearableFileInput from reversion.admin import VersionAdmin From 2b885027b02613a820157e63b4c04ddfd761b401 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Fri, 24 Mar 2017 17:21:52 -0300 Subject: [PATCH 011/140] Remove strings vazias da lista Signed-off-by: Luciano Almeida --- sapl/legacy/migration.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 307eef716..379ac13ad 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -633,7 +633,9 @@ def adjust_normajuridica_antes_salvar(new, old): def adjust_normajuridica_depois_salvar(new, old): # Ajusta relação M2M lista_pks_assunto = old.cod_assunto.split(',') - for pk_assunto in lista_pks_assunto: + + # list(filter(..)) usado para retirar strings vazias da lista + for pk_assunto in list(filter(None, lista_pks_assunto)): new.assuntos.add(AssuntoNorma.objects.get(pk=pk_assunto)) From 8352b010aec063b1c73ac8a8cf92fb87de051228 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Sat, 25 Mar 2017 11:09:58 -0300 Subject: [PATCH 012/140] Adiciona migrations que faltavam --- .../migrations/0010_auto_20170325_1052.py | 46 +++++ .../migrations/0078_auto_20170325_1052.py | 181 ++++++++++++++++++ .../migrations/0037_auto_20170325_1052.py | 51 +++++ .../migrations/0042_auto_20170325_1052.py | 117 +++++++++++ .../migrations/0015_auto_20170325_1052.py | 76 ++++++++ .../migrations/0036_auto_20170325_1052.py | 177 +++++++++++++++++ 6 files changed, 648 insertions(+) create mode 100644 sapl/comissoes/migrations/0010_auto_20170325_1052.py create mode 100644 sapl/materia/migrations/0078_auto_20170325_1052.py create mode 100644 sapl/norma/migrations/0037_auto_20170325_1052.py create mode 100644 sapl/parlamentares/migrations/0042_auto_20170325_1052.py create mode 100644 sapl/protocoloadm/migrations/0015_auto_20170325_1052.py create mode 100644 sapl/sessao/migrations/0036_auto_20170325_1052.py diff --git a/sapl/comissoes/migrations/0010_auto_20170325_1052.py b/sapl/comissoes/migrations/0010_auto_20170325_1052.py new file mode 100644 index 000000000..a1d7d5788 --- /dev/null +++ b/sapl/comissoes/migrations/0010_auto_20170325_1052.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 10:52 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('comissoes', '0009_auto_20161011_0843'), + ] + + operations = [ + migrations.AlterField( + model_name='comissao', + name='tipo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.TipoComissao', verbose_name='Tipo'), + ), + migrations.AlterField( + model_name='composicao', + name='comissao', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.Comissao', verbose_name='Comissão'), + ), + migrations.AlterField( + model_name='composicao', + name='periodo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.Periodo', verbose_name='Período'), + ), + migrations.AlterField( + model_name='participacao', + name='cargo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.CargoComissao'), + ), + migrations.AlterField( + model_name='participacao', + name='composicao', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='participacao_set', to='comissoes.Composicao'), + ), + migrations.AlterField( + model_name='participacao', + name='parlamentar', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), + ), + ] diff --git a/sapl/materia/migrations/0078_auto_20170325_1052.py b/sapl/materia/migrations/0078_auto_20170325_1052.py new file mode 100644 index 000000000..fb0a733af --- /dev/null +++ b/sapl/materia/migrations/0078_auto_20170325_1052.py @@ -0,0 +1,181 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 10:52 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('materia', '0077_auto_20170321_1130'), + ] + + operations = [ + migrations.AlterField( + model_name='acompanhamentomateria', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), + ), + migrations.AlterField( + model_name='anexada', + name='materia_anexada', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='materia_anexada_set', to='materia.MateriaLegislativa'), + ), + migrations.AlterField( + model_name='anexada', + name='materia_principal', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='materia_principal_set', to='materia.MateriaLegislativa'), + ), + migrations.AlterField( + model_name='autoria', + name='autor', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='base.Autor', verbose_name='Autor'), + ), + migrations.AlterField( + model_name='autoria', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa', verbose_name='Matéria Legislativa'), + ), + migrations.AlterField( + model_name='despachoinicial', + name='comissao', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.Comissao'), + ), + migrations.AlterField( + model_name='despachoinicial', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), + ), + migrations.AlterField( + model_name='documentoacessorio', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), + ), + migrations.AlterField( + model_name='documentoacessorio', + name='tipo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.TipoDocumento', verbose_name='Tipo'), + ), + migrations.AlterField( + model_name='materiaassunto', + name='assunto', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.AssuntoMateria'), + ), + migrations.AlterField( + model_name='materiaassunto', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), + ), + migrations.AlterField( + model_name='materialegislativa', + name='local_origem_externa', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.Origem', verbose_name='Local Origem'), + ), + migrations.AlterField( + model_name='materialegislativa', + name='regime_tramitacao', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.RegimeTramitacao', verbose_name='Regime Tramitação'), + ), + migrations.AlterField( + model_name='materialegislativa', + name='tipo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.TipoMateriaLegislativa', verbose_name='Tipo'), + ), + migrations.AlterField( + model_name='materialegislativa', + name='tipo_origem_externa', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='tipo_origem_externa_set', to='materia.TipoMateriaLegislativa', verbose_name='Tipo'), + ), + migrations.AlterField( + model_name='numeracao', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), + ), + migrations.AlterField( + model_name='numeracao', + name='tipo_materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.TipoMateriaLegislativa', verbose_name='Tipo de Matéria'), + ), + migrations.AlterField( + model_name='parecer', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), + ), + migrations.AlterField( + model_name='parecer', + name='relatoria', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.Relatoria'), + ), + migrations.AlterField( + model_name='proposicao', + name='materia_de_vinculo', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='proposicao_set', to='materia.MateriaLegislativa', verbose_name='Matéria anexadora'), + ), + migrations.AlterField( + model_name='proposicao', + name='tipo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.TipoProposicao', verbose_name='Tipo'), + ), + migrations.AlterField( + model_name='relatoria', + name='comissao', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='comissoes.Comissao', verbose_name='Comissão'), + ), + migrations.AlterField( + model_name='relatoria', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), + ), + migrations.AlterField( + model_name='relatoria', + name='parlamentar', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar', verbose_name='Parlamentar'), + ), + migrations.AlterField( + model_name='relatoria', + name='tipo_fim_relatoria', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.TipoFimRelatoria', verbose_name='Motivo Fim Relatoria'), + ), + migrations.AlterField( + model_name='tipoproposicao', + name='content_type', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='contenttypes.ContentType', verbose_name='Definição de Tipo'), + ), + migrations.AlterField( + model_name='tramitacao', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), + ), + migrations.AlterField( + model_name='tramitacao', + name='status', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.StatusTramitacao', verbose_name='Status'), + ), + migrations.AlterField( + model_name='tramitacao', + name='unidade_tramitacao_destino', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='tramitacoes_destino', to='materia.UnidadeTramitacao', verbose_name='Unidade Destino'), + ), + migrations.AlterField( + model_name='tramitacao', + name='unidade_tramitacao_local', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='tramitacoes_origem', to='materia.UnidadeTramitacao', verbose_name='Unidade Local'), + ), + migrations.AlterField( + model_name='unidadetramitacao', + name='comissao', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='comissoes.Comissao', verbose_name='Comissão'), + ), + migrations.AlterField( + model_name='unidadetramitacao', + name='orgao', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.Orgao', verbose_name='Órgão'), + ), + migrations.AlterField( + model_name='unidadetramitacao', + name='parlamentar', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar', verbose_name='Parlamentar'), + ), + ] diff --git a/sapl/norma/migrations/0037_auto_20170325_1052.py b/sapl/norma/migrations/0037_auto_20170325_1052.py new file mode 100644 index 000000000..183da7713 --- /dev/null +++ b/sapl/norma/migrations/0037_auto_20170325_1052.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 10:52 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('norma', '0036_merge'), + ] + + operations = [ + migrations.AlterField( + model_name='legislacaocitada', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), + ), + migrations.AlterField( + model_name='legislacaocitada', + name='norma', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='norma.NormaJuridica'), + ), + migrations.AlterField( + model_name='normajuridica', + name='materia', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa', verbose_name='Matéria'), + ), + migrations.AlterField( + model_name='normajuridica', + name='tipo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='norma.TipoNormaJuridica', verbose_name='Tipo da Norma Juridica'), + ), + migrations.AlterField( + model_name='normarelacionada', + name='norma_principal', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='norma_principal', to='norma.NormaJuridica', verbose_name='Norma Principal'), + ), + migrations.AlterField( + model_name='normarelacionada', + name='norma_relacionada', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='norma_relacionada', to='norma.NormaJuridica', verbose_name='Norma Relacionada'), + ), + migrations.AlterField( + model_name='normarelacionada', + name='tipo_vinculo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='norma.TipoVinculoNormaJuridica', verbose_name='Tipo de Vínculo'), + ), + ] diff --git a/sapl/parlamentares/migrations/0042_auto_20170325_1052.py b/sapl/parlamentares/migrations/0042_auto_20170325_1052.py new file mode 100644 index 000000000..d6d2e8736 --- /dev/null +++ b/sapl/parlamentares/migrations/0042_auto_20170325_1052.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 10:52 +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 = [ + ('parlamentares', '0041_mandato_titular'), + ] + + operations = [ + migrations.AlterField( + model_name='coligacao', + name='legislatura', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura'), + ), + migrations.AlterField( + model_name='composicaocoligacao', + name='coligacao', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Coligacao'), + ), + migrations.AlterField( + model_name='composicaocoligacao', + name='partido', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Partido', verbose_name='Partidos da Coligação'), + ), + migrations.AlterField( + model_name='composicaomesa', + name='cargo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.CargoMesa'), + ), + migrations.AlterField( + model_name='composicaomesa', + name='parlamentar', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), + ), + migrations.AlterField( + model_name='composicaomesa', + name='sessao_legislativa', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.SessaoLegislativa'), + ), + migrations.AlterField( + model_name='dependente', + name='parlamentar', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), + ), + migrations.AlterField( + model_name='dependente', + name='tipo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.TipoDependente', verbose_name='Tipo'), + ), + migrations.AlterField( + model_name='filiacao', + name='parlamentar', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), + ), + migrations.AlterField( + model_name='filiacao', + name='partido', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Partido', verbose_name='Partido'), + ), + migrations.AlterField( + model_name='mandato', + name='coligacao', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Coligacao', verbose_name='Coligação'), + ), + migrations.AlterField( + model_name='mandato', + name='legislatura', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura'), + ), + migrations.AlterField( + model_name='mandato', + name='parlamentar', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), + ), + migrations.AlterField( + model_name='mandato', + name='tipo_afastamento', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.TipoAfastamento'), + ), + migrations.AlterField( + model_name='parlamentar', + name='municipio_residencia', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Municipio', verbose_name='Município'), + ), + migrations.AlterField( + model_name='parlamentar', + name='nivel_instrucao', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.NivelInstrucao', verbose_name='Nível Instrução'), + ), + migrations.AlterField( + model_name='parlamentar', + name='situacao_militar', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.SituacaoMilitar', verbose_name='Situação Militar'), + ), + migrations.AlterField( + model_name='sessaolegislativa', + name='legislatura', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura'), + ), + migrations.AlterField( + model_name='votante', + name='parlamentar', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='parlamentar', to='parlamentares.Parlamentar', verbose_name='Parlamentar'), + ), + migrations.AlterField( + model_name='votante', + name='user', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='user', to=settings.AUTH_USER_MODEL, verbose_name='User'), + ), + ] diff --git a/sapl/protocoloadm/migrations/0015_auto_20170325_1052.py b/sapl/protocoloadm/migrations/0015_auto_20170325_1052.py new file mode 100644 index 000000000..f080b796f --- /dev/null +++ b/sapl/protocoloadm/migrations/0015_auto_20170325_1052.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 10:52 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('protocoloadm', '0014_auto_20170321_1130'), + ] + + operations = [ + migrations.AlterField( + model_name='documentoacessorioadministrativo', + name='documento', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.DocumentoAdministrativo'), + ), + migrations.AlterField( + model_name='documentoacessorioadministrativo', + name='tipo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.TipoDocumentoAdministrativo', verbose_name='Tipo'), + ), + migrations.AlterField( + model_name='documentoadministrativo', + name='autor', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='base.Autor'), + ), + migrations.AlterField( + model_name='documentoadministrativo', + name='protocolo', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.Protocolo', verbose_name='Protocolo'), + ), + migrations.AlterField( + model_name='documentoadministrativo', + name='tipo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.TipoDocumentoAdministrativo', verbose_name='Tipo Documento'), + ), + migrations.AlterField( + model_name='protocolo', + name='autor', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='base.Autor'), + ), + migrations.AlterField( + model_name='protocolo', + name='tipo_documento', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.TipoDocumentoAdministrativo', verbose_name='Tipo de documento'), + ), + migrations.AlterField( + model_name='protocolo', + name='tipo_materia', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.TipoMateriaLegislativa', verbose_name='Tipo Matéria'), + ), + migrations.AlterField( + model_name='tramitacaoadministrativo', + name='documento', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.DocumentoAdministrativo'), + ), + migrations.AlterField( + model_name='tramitacaoadministrativo', + name='status', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.StatusTramitacaoAdministrativo', verbose_name='Status'), + ), + migrations.AlterField( + model_name='tramitacaoadministrativo', + name='unidade_tramitacao_destino', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='adm_tramitacoes_destino', to='materia.UnidadeTramitacao', verbose_name='Unidade Destino'), + ), + migrations.AlterField( + model_name='tramitacaoadministrativo', + name='unidade_tramitacao_local', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='adm_tramitacoes_origem', to='materia.UnidadeTramitacao', verbose_name='Unidade Local'), + ), + ] diff --git a/sapl/sessao/migrations/0036_auto_20170325_1052.py b/sapl/sessao/migrations/0036_auto_20170325_1052.py new file mode 100644 index 000000000..8fb9eb40d --- /dev/null +++ b/sapl/sessao/migrations/0036_auto_20170325_1052.py @@ -0,0 +1,177 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 10:52 +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 = [ + ('sessao', '0035_auto_20170213_1455'), + ] + + operations = [ + migrations.AlterField( + model_name='bancada', + name='legislatura', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura'), + ), + migrations.AlterField( + model_name='bancada', + name='partido', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Partido', verbose_name='Partido'), + ), + migrations.AlterField( + model_name='expedientemateria', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa', verbose_name='Matéria'), + ), + migrations.AlterField( + model_name='expedientemateria', + name='sessao_plenaria', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), + ), + migrations.AlterField( + model_name='expedientesessao', + name='sessao_plenaria', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), + ), + migrations.AlterField( + model_name='expedientesessao', + name='tipo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.TipoExpediente'), + ), + migrations.AlterField( + model_name='integrantemesa', + name='cargo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.CargoMesa'), + ), + migrations.AlterField( + model_name='integrantemesa', + name='parlamentar', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), + ), + migrations.AlterField( + model_name='integrantemesa', + name='sessao_plenaria', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), + ), + migrations.AlterField( + model_name='orador', + name='parlamentar', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar', verbose_name='Parlamentar'), + ), + migrations.AlterField( + model_name='orador', + name='sessao_plenaria', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), + ), + migrations.AlterField( + model_name='oradorexpediente', + name='parlamentar', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar', verbose_name='Parlamentar'), + ), + migrations.AlterField( + model_name='oradorexpediente', + name='sessao_plenaria', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), + ), + migrations.AlterField( + model_name='ordemdia', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa', verbose_name='Matéria'), + ), + migrations.AlterField( + model_name='ordemdia', + name='sessao_plenaria', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), + ), + migrations.AlterField( + model_name='presencaordemdia', + name='parlamentar', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), + ), + migrations.AlterField( + model_name='presencaordemdia', + name='sessao_plenaria', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), + ), + migrations.AlterField( + model_name='registrovotacao', + name='expediente', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='sessao.ExpedienteMateria'), + ), + migrations.AlterField( + model_name='registrovotacao', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), + ), + migrations.AlterField( + model_name='registrovotacao', + name='ordem', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='sessao.OrdemDia'), + ), + migrations.AlterField( + model_name='registrovotacao', + name='tipo_resultado_votacao', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.TipoResultadoVotacao', verbose_name='Resultado da Votação'), + ), + migrations.AlterField( + model_name='sessaoplenaria', + name='legislatura', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura'), + ), + migrations.AlterField( + model_name='sessaoplenaria', + name='sessao_legislativa', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.SessaoLegislativa', verbose_name='Sessão Legislativa'), + ), + migrations.AlterField( + model_name='sessaoplenaria', + name='tipo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.TipoSessaoPlenaria', verbose_name='Tipo'), + ), + migrations.AlterField( + model_name='sessaoplenariapresenca', + name='parlamentar', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), + ), + migrations.AlterField( + model_name='sessaoplenariapresenca', + name='sessao_plenaria', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), + ), + migrations.AlterField( + model_name='votonominal', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), + ), + migrations.AlterField( + model_name='votonominal', + name='parlamentar', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), + ), + migrations.AlterField( + model_name='votonominal', + name='sessao', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), + ), + migrations.AlterField( + model_name='votonominal', + name='user', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='votoparlamentar', + name='parlamentar', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), + ), + migrations.AlterField( + model_name='votoparlamentar', + name='votacao', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.RegistroVotacao'), + ), + ] From 0961ad4af55361f1baed4ae3dd906bb5a46cbbb8 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Sat, 25 Mar 2017 11:14:24 -0300 Subject: [PATCH 013/140] Zera todas as migrations --- sapl/api/migrations/__init__.py | 0 sapl/base/migrations/0001_initial.py | 108 +- .../migrations/0002_casalegislativa_codigo.py | 20 - .../migrations/0003_auto_20160107_1122.py | 21 - .../migrations/0004_auto_20160107_1158.py | 26 - .../migrations/0005_auto_20160107_1244.py | 39 - .../migrations/0006_auto_20160107_1257.py | 20 - .../migrations/0007_auto_20160107_1837.py | 27 - .../migrations/0008_auto_20160216_1015.py | 56 - .../migrations/0009_auto_20160307_0905.py | 25 - .../migrations/0010_auto_20160309_1323.py | 25 - sapl/base/migrations/0011_problemamigracao.py | 32 - .../0012_problemamigracao_eh_stub.py | 21 - .../0013_remove_problemamigracao_endereco.py | 19 - .../migrations/0014_auto_20160502_1635.py | 27 - .../0015_problemamigracao_nome_campo.py | 20 - .../migrations/0016_auto_20160701_0940.py | 19 - sapl/base/migrations/0017_appconfig.py | 24 - .../migrations/0018_auto_20160919_1333.py | 34 - .../migrations/0019_auto_20160928_1951.py | 19 - .../migrations/0020_auto_20161006_0950.py | 30 - .../migrations/0021_auto_20161006_1019.py | 20 - .../migrations/0022_auto_20161009_1222.py | 55 - .../migrations/0023_auto_20161009_1852.py | 25 - .../migrations/0024_auto_20161010_1002.py | 26 - .../migrations/0025_tipoautor_cria_usuario.py | 20 - .../0026_remove_tipoautor_cria_usuario.py | 19 - .../migrations/0027_auto_20161011_1624.py | 22 - ...fig_proposicao_incorporacao_obrigatoria.py | 20 - .../migrations/0029_auto_20161021_1445.py | 20 - .../migrations/0030_auto_20161021_2017.py | 20 - .../migrations/0031_auto_20170203_1019.py | 19 - .../migrations/0032_auto_20170308_1006.py | 30 - sapl/comissoes/migrations/0001_initial.py | 73 +- .../migrations/0002_auto_20150729_1310.py | 19 - .../migrations/0003_auto_20160216_1015.py | 79 -- .../migrations/0004_auto_20160307_0905.py | 20 - .../migrations/0005_comissao_ativa.py | 21 - .../migrations/0006_auto_20160825_1335.py | 20 - .../migrations/0006_auto_20160916_1243.py | 20 - sapl/comissoes/migrations/0007_merge.py | 16 - .../migrations/0008_auto_20160929_1611.py | 21 - .../migrations/0009_auto_20161011_0843.py | 20 - .../migrations/0010_auto_20170325_1052.py | 46 - sapl/compilacao/migrations/0001_initial.py | 280 +++- .../migrations/0002_auto_20150907_2334.py | 48 - .../migrations/0003_auto_20150911_1735.py | 19 - .../migrations/0004_auto_20150914_0842.py | 34 - .../migrations/0005_auto_20150924_1012.py | 77 -- .../migrations/0006_auto_20150924_1121.py | 54 - .../migrations/0007_auto_20150924_1131.py | 19 - .../migrations/0008_auto_20151005_1023.py | 50 - .../migrations/0009_auto_20151007_1635.py | 23 - .../migrations/0010_auto_20151105_1532.py | 30 - .../migrations/0011_auto_20151105_1540.py | 27 - .../migrations/0012_auto_20151105_1658.py | 34 - .../migrations/0013_auto_20151106_1843.py | 24 - .../migrations/0014_auto_20151107_1836.py | 19 - .../migrations/0015_auto_20151115_2310.py | 24 - .../migrations/0016_auto_20151119_0950.py | 49 - .../migrations/0017_auto_20151119_1035.py | 28 - .../migrations/0018_auto_20151119_1052.py | 23 - .../migrations/0019_auto_20151119_1120.py | 20 - .../migrations/0020_auto_20151119_1126.py | 20 - .../migrations/0021_auto_20151119_1617.py | 23 - .../migrations/0022_auto_20151120_1503.py | 33 - .../migrations/0023_auto_20151120_1529.py | 29 - .../migrations/0024_auto_20151120_1814.py | 37 - .../migrations/0025_auto_20151122_1744.py | 24 - .../migrations/0026_auto_20151122_1756.py | 28 - .../migrations/0027_auto_20151130_1632.py | 33 - .../migrations/0028_auto_20151201_0042.py | 18 - .../migrations/0029_auto_20151201_1611.py | 19 - .../migrations/0030_auto_20151203_1114.py | 19 - .../migrations/0030_auto_20151203_1117.py | 19 - sapl/compilacao/migrations/0031_merge.py | 15 - .../migrations/0032_auto_20151213_1538.py | 19 - .../migrations/0033_auto_20151226_1320.py | 115 -- .../migrations/0034_auto_20151226_1321.py | 18 - .../migrations/0035_auto_20151226_1349.py | 30 - .../migrations/0036_auto_20151226_1411.py | 19 - .../migrations/0037_auto_20151226_1414.py | 19 - .../0038_tipotextoarticulado_model.py | 19 - .../migrations/0039_auto_20151226_1433.py | 19 - .../migrations/0040_auto_20160106_1956.py | 24 - .../migrations/0041_auto_20160109_1928.py | 39 - .../migrations/0042_auto_20160110_1620.py | 47 - .../migrations/0043_auto_20160110_1733.py | 19 - .../migrations/0044_auto_20160307_0918.py | 25 - .../migrations/0045_auto_20160311_1117.py | 36 - .../migrations/0045_auto_20160404_1411.py | 21 - .../migrations/0046_auto_20160319_1542.py | 25 - .../migrations/0047_auto_20160330_0027.py | 21 - .../migrations/0048_auto_20160404_2309.py | 21 - sapl/compilacao/migrations/0049_merge.py | 16 - .../migrations/0050_auto_20160503_0926.py | 46 - .../0051_dispositivo_auto_inserido.py | 20 - .../migrations/0052_auto_20160915_1327.py | 19 - .../migrations/0053_auto_20160916_1420.py | 19 - .../migrations/0054_auto_20160916_1424.py | 19 - ...55_dispositivo_dispositivo_de_revogacao.py | 20 - .../migrations/0056_auto_20161006_1251.py | 21 - .../migrations/0057_auto_20161007_2200.py | 25 - .../migrations/0058_auto_20161008_0143.py | 31 - .../migrations/0059_auto_20161027_1323.py | 19 - .../migrations/0060_auto_20161101_0913.py | 19 - .../migrations/0061_auto_20161101_1025.py | 21 - .../migrations/0062_auto_20161101_1221.py | 19 - ...063_tipotextoarticulado_publicacao_func.py | 20 - .../migrations/0064_auto_20161104_1420.py | 46 - .../migrations/0065_auto_20161107_1024.py | 20 - .../migrations/0066_auto_20161107_1028.py | 20 - .../migrations/0067_auto_20161107_1351.py | 19 - .../migrations/0068_auto_20161107_1546.py | 19 - .../migrations/0069_auto_20161107_1932.py | 20 - ..._perfilestruturaltextoarticulado_parent.py | 21 - .../0071_tipotextoarticulado_perfis.py | 20 - .../migrations/0072_auto_20161112_1553.py | 55 - sapl/legacy/migrations/0001_initial.py | 1210 ----------------- sapl/legacy/migrations/__init__.py | 0 sapl/lexml/migrations/0001_initial.py | 31 +- .../migrations/0002_auto_20150806_1614.py | 34 - .../migrations/0003_auto_20160216_1015.py | 44 - .../migrations/0004_auto_20160307_0918.py | 25 - sapl/materia/migrations/0001_initial.py | 318 +++-- .../migrations/0002_auto_20150729_1310.py | 19 - .../migrations/0003_auto_20150729_1717.py | 64 - .../0004_materialegislativa_texto_original.py | 22 - .../migrations/0005_auto_20150923_0941.py | 18 - .../migrations/0006_proposicao_status.py | 19 - .../migrations/0007_auto_20151021_1200.py | 19 - .../migrations/0008_auto_20151029_1416.py | 18 - .../migrations/0009_auto_20151029_1420.py | 18 - .../migrations/0010_auto_20151117_1551.py | 22 - .../0011_proposicao_texto_original.py | 21 - .../migrations/0012_auto_20151124_1328.py | 19 - .../0013_remove_tramitacao_ultima.py | 18 - .../migrations/0014_autoria_partido.py | 20 - .../migrations/0015_auto_20160216_1015.py | 124 -- .../migrations/0016_auto_20160223_0813.py | 28 - .../migrations/0016_auto_20160225_0918.py | 19 - .../0017_acompanhamentomateria_confirmado.py | 19 - sapl/materia/migrations/0018_merge.py | 16 - .../migrations/0019_auto_20160229_1321.py | 19 - .../migrations/0020_auto_20160229_1324.py | 22 - .../migrations/0021_auto_20160307_0905.py | 20 - .../migrations/0022_auto_20160309_1323.py | 25 - .../migrations/0023_auto_20160309_1407.py | 25 - .../migrations/0024_auto_20160311_1501.py | 20 - .../migrations/0025_auto_20160311_1613.py | 20 - .../migrations/0026_auto_20160322_1514.py | 41 - .../migrations/0027_auto_20160404_1409.py | 29 - .../migrations/0028_auto_20160419_1000.py | 25 - .../migrations/0028_auto_20160419_1056.py | 26 - .../migrations/0029_auto_20160428_1020.py | 20 - sapl/materia/migrations/0029_merge.py | 16 - .../migrations/0030_auto_20160429_1349.py | 19 - .../migrations/0030_auto_20160502_1630.py | 21 - .../migrations/0031_auto_20160502_1131.py | 20 - sapl/materia/migrations/0031_merge.py | 16 - .../migrations/0032_auto_20160503_0926.py | 26 - sapl/materia/migrations/0032_merge.py | 16 - .../0033_documentoacessorio_texto_original.py | 23 - .../migrations/0034_auto_20160510_0946.py | 20 - .../migrations/0035_auto_20160510_0949.py | 20 - sapl/materia/migrations/0036_merge.py | 16 - .../migrations/0037_auto_20160520_1250.py | 23 - .../migrations/0038_auto_20160612_1506.py | 20 - .../migrations/0039_auto_20160628_1251.py | 37 - .../migrations/0039_auto_20160808_1753.py | 42 - .../migrations/0040_auto_20160810_1524.py | 35 - ...1_remove_proposicao_data_incorporação.py | 19 - .../0042_proposicao_data_devolução.py | 20 - .../migrations/0043_auto_20160810_1738.py | 20 - sapl/materia/migrations/0044_merge.py | 16 - .../migrations/0045_auto_20160823_1658.py | 24 - .../migrations/0046_auto_20160825_1504.py | 22 - .../migrations/0046_auto_20160825_1833.py | 22 - sapl/materia/migrations/0047_merge.py | 16 - .../migrations/0048_auto_20160927_1254.py | 26 - .../migrations/0049_remove_autoria_partido.py | 19 - .../migrations/0050_auto_20161003_0417.py | 19 - .../migrations/0051_auto_20161004_0927.py | 19 - .../migrations/0052_auto_20161004_1041.py | 20 - .../migrations/0053_auto_20161004_1854.py | 19 - .../migrations/0054_auto_20161009_1222.py | 63 - .../migrations/0054_auto_20161011_0904.py | 20 - .../migrations/0055_auto_20161009_1418.py | 32 - sapl/materia/migrations/0056_merge.py | 16 - .../migrations/0056_remove_tipo_proposicao.py | 20 - .../migrations/0057_auto_20161016_0156.py | 45 - .../migrations/0058_auto_20161016_0329.py | 26 - .../migrations/0059_auto_20161016_1333.py | 19 - .../migrations/0060_auto_20161017_0050.py | 22 - .../migrations/0061_auto_20161017_1655.py | 20 - .../migrations/0062_auto_20161021_1424.py | 26 - .../migrations/0063_auto_20161021_1445.py | 25 - .../migrations/0064_auto_20161022_1405.py | 48 - .../migrations/0065_auto_20161022_1411.py | 21 - .../materia/migrations/0066_proposicao_ano.py | 20 - .../migrations/0067_auto_20161025_1630.py | 24 - .../migrations/0068_auto_20161110_0910.py | 35 - .../migrations/0069_tipoproposicao_perfis.py | 21 - .../migrations/0070_auto_20161111_1301.py | 21 - .../migrations/0071_auto_20161130_1001.py | 19 - .../migrations/0072_auto_20161130_1618.py | 19 - .../migrations/0073_auto_20161216_1640.py | 23 - .../migrations/0074_auto_20170102_0951.py | 35 - .../migrations/0075_auto_20170123_1548.py | 35 - .../migrations/0075_auto_20170203_1019.py | 46 - sapl/materia/migrations/0076_merge.py | 16 - .../migrations/0077_auto_20170321_1130.py | 21 - .../migrations/0078_auto_20170325_1052.py | 181 --- sapl/norma/migrations/0001_initial.py | 113 +- .../migrations/0002_auto_20150729_1717.py | 34 - .../migrations/0003_auto_20150906_0239.py | 35 - .../migrations/0004_auto_20150907_0004.py | 18 - .../migrations/0005_auto_20150915_1141.py | 18 - .../migrations/0006_auto_20151025_1427.py | 18 - .../migrations/0007_auto_20151130_1632.py | 19 - .../0008_normajuridica_texto_integral.py | 21 - .../migrations/0009_auto_20160106_1511.py | 19 - .../migrations/0010_auto_20160216_1015.py | 104 -- .../migrations/0011_auto_20160307_1153.py | 23 - .../migrations/0012_auto_20160309_1407.py | 20 - .../migrations/0013_auto_20160503_0926.py | 26 - .../migrations/0013_auto_20160510_1404.py | 20 - sapl/norma/migrations/0014_merge.py | 16 - .../migrations/0015_auto_20160929_1635.py | 19 - .../migrations/0016_auto_20161027_1419.py | 23 - .../migrations/0017_auto_20161027_1432.py | 20 - .../migrations/0018_auto_20161027_1434.py | 26 - .../migrations/0019_auto_20161028_0232.py | 19 - .../migrations/0020_auto_20161028_1335.py | 39 - .../migrations/0021_auto_20161028_1335.py | 24 - .../migrations/0022_auto_20161110_0910.py | 20 - .../migrations/0023_auto_20161123_1359.py | 41 - .../migrations/0024_auto_20161123_1430.py | 25 - .../norma/migrations/0025_normarelacionada.py | 29 - .../migrations/0026_auto_20161123_1450.py | 21 - .../migrations/0027_auto_20161123_1538.py | 26 - .../migrations/0028_auto_20161202_1025.py | 21 - .../migrations/0029_auto_20161215_1652.py | 19 - .../migrations/0029_auto_20161216_1640.py | 19 - .../migrations/0030_auto_20170102_0951.py | 20 - sapl/norma/migrations/0030_merge.py | 16 - .../migrations/0031_auto_20161219_1324.py | 20 - sapl/norma/migrations/0032_merge.py | 16 - .../migrations/0033_auto_20170123_1548.py | 20 - .../migrations/0033_auto_20170203_1019.py | 20 - .../migrations/0034_auto_20170222_1435.py | 29 - .../migrations/0035_auto_20170222_1438.py | 19 - sapl/norma/migrations/0036_merge.py | 16 - .../migrations/0037_auto_20170325_1052.py | 51 - sapl/painel/migrations/0001_initial.py | 13 +- sapl/parlamentares/migrations/0001_initial.py | 220 +-- .../migrations/0002_auto_20150729_1310.py | 19 - .../migrations/0003_auto_20150729_1717.py | 39 - .../migrations/0004_auto_20150929_1425.py | 18 - .../migrations/0005_parlamentar_fotografia.py | 22 - .../migrations/0006_auto_20151119_1318.py | 19 - .../migrations/0007_auto_20151123_1258.py | 19 - .../migrations/0008_auto_20151126_1332.py | 25 - .../migrations/0009_auto_20151126_1334.py | 22 - .../migrations/0010_auto_20160107_1850.py | 21 - .../migrations/0011_auto_20160216_1015.py | 129 -- .../migrations/0012_auto_20160307_0905.py | 25 - .../0012_parlamentar_unidade_deliberativa.py | 21 - sapl/parlamentares/migrations/0013_merge.py | 16 - .../migrations/0014_auto_20160318_1504.py | 20 - .../migrations/0015_auto_20160322_1401.py | 25 - .../migrations/0016_auto_20160404_1409.py | 23 - ...remove_parlamentar_unidade_deliberativa.py | 19 - .../migrations/0018_auto_20160510_0943.py | 19 - .../migrations/0019_auto_20160518_1136.py | 21 - .../migrations/0019_auto_20160518_1204.py | 19 - .../migrations/0020_auto_20160518_1201.py | 21 - sapl/parlamentares/migrations/0021_merge.py | 16 - .../migrations/0022_auto_20160624_1124.py | 22 - .../migrations/0022_auto_20160702_1519.py | 21 - .../migrations/0023_auto_20160628_1247.py | 21 - sapl/parlamentares/migrations/0024_merge.py | 16 - .../migrations/0025_auto_20160916_1030.py | 20 - sapl/parlamentares/migrations/0025_frente.py | 30 - .../migrations/0026_auto_20160916_1034.py | 20 - sapl/parlamentares/migrations/0027_merge.py | 16 - .../migrations/0028_auto_20160922_1443.py | 28 - .../migrations/0028_legislatura_numero.py | 21 - sapl/parlamentares/migrations/0029_merge.py | 16 - .../migrations/0030_auto_20160928_0846.py | 20 - .../migrations/0031_auto_20160929_1842.py | 19 - .../0032_frenteproxymasterdetail.py | 24 - .../migrations/0033_auto_20160930_1715.py | 29 - .../0034_delete_frenteparlamentar.py | 18 - .../migrations/0035_auto_20161011_0840.py | 20 - .../migrations/0036_partido_logo_partido.py | 22 - sapl/parlamentares/migrations/0037_votante.py | 31 - .../migrations/0038_auto_20170213_1425.py | 19 - .../migrations/0039_remove_votante_ip.py | 19 - .../migrations/0040_auto_20170214_1709.py | 19 - .../migrations/0041_mandato_titular.py | 20 - .../migrations/0042_auto_20170325_1052.py | 117 -- sapl/protocoloadm/migrations/0001_initial.py | 57 +- .../migrations/0002_delete_tipoinstituicao.py | 18 - .../migrations/0003_auto_20161009_1222.py | 36 - .../migrations/0004_auto_20161023_1444.py | 21 - .../migrations/0005_auto_20161027_1741.py | 19 - .../migrations/0006_auto_20161103_1721.py | 20 - .../migrations/0007_auto_20161110_0910.py | 25 - .../migrations/0008_auto_20161216_1640.py | 19 - .../migrations/0009_auto_20170102_0951.py | 25 - .../migrations/0010_auto_20170123_1548.py | 25 - .../migrations/0010_auto_20170203_1019.py | 25 - sapl/protocoloadm/migrations/0011_merge.py | 16 - .../migrations/0012_auto_20170315_1211.py | 26 - .../migrations/0013_auto_20170320_1637.py | 21 - .../migrations/0014_auto_20170321_1130.py | 21 - .../migrations/0015_auto_20170325_1052.py | 76 -- sapl/relatorios/migrations/__init__.py | 0 sapl/rules/migrations/__init__.py | 0 sapl/sessao/migrations/0001_initial.py | 240 ++-- .../migrations/0002_auto_20150729_1450.py | 48 - ...3_remove_sessaoplenaria_tipo_expediente.py | 18 - .../migrations/0004_auto_20150806_1614.py | 92 -- ...0005_remove_presencaordemdia_data_ordem.py | 18 - .../migrations/0006_auto_20150929_1425.py | 30 - .../migrations/0007_auto_20150929_1426.py | 19 - .../migrations/0008_auto_20151005_0814.py | 24 - .../migrations/0009_auto_20151005_0934.py | 24 - .../migrations/0010_acompanharmateria.py | 27 - .../migrations/0011_auto_20160113_1239.py | 19 - .../migrations/0012_auto_20160120_1237.py | 24 - .../migrations/0013_auto_20160216_1015.py | 69 - .../migrations/0014_auto_20160223_0813.py | 21 - .../migrations/0015_auto_20160307_0918.py | 35 - .../migrations/0016_auto_20160404_1409.py | 30 - sapl/sessao/migrations/0017_bancada.py | 33 - .../migrations/0018_auto_20160517_1435.py | 31 - sapl/sessao/migrations/0019_cargobancada.py | 27 - .../migrations/0020_auto_20160517_1450.py | 20 - .../0021_adicionamultiplasmaterias.py | 28 - .../migrations/0022_auto_20160805_0943.py | 22 - .../migrations/0023_auto_20160915_1405.py | 20 - sapl/sessao/migrations/0024_bloco.py | 30 - .../migrations/0025_auto_20160919_1503.py | 25 - .../migrations/0026_auto_20160926_1445.py | 36 - .../migrations/0027_auto_20161003_0417.py | 19 - .../migrations/0028_auto_20161004_0927.py | 25 - .../migrations/0029_auto_20161004_1101.py | 35 - .../migrations/0030_auto_20161215_1652.py | 20 - .../migrations/0030_auto_20161216_1640.py | 20 - .../migrations/0031_auto_20170102_0951.py | 20 - sapl/sessao/migrations/0031_merge.py | 16 - .../migrations/0032_auto_20170102_0953.py | 20 - .../0032_sessaoplenaria_upload_anexo.py | 21 - sapl/sessao/migrations/0033_merge.py | 16 - sapl/sessao/migrations/0034_votonominal.py | 39 - .../migrations/0035_auto_20170213_1455.py | 23 - .../migrations/0036_auto_20170325_1052.py | 177 --- 359 files changed, 912 insertions(+), 11139 deletions(-) delete mode 100644 sapl/api/migrations/__init__.py delete mode 100644 sapl/base/migrations/0002_casalegislativa_codigo.py delete mode 100644 sapl/base/migrations/0003_auto_20160107_1122.py delete mode 100644 sapl/base/migrations/0004_auto_20160107_1158.py delete mode 100644 sapl/base/migrations/0005_auto_20160107_1244.py delete mode 100644 sapl/base/migrations/0006_auto_20160107_1257.py delete mode 100644 sapl/base/migrations/0007_auto_20160107_1837.py delete mode 100644 sapl/base/migrations/0008_auto_20160216_1015.py delete mode 100644 sapl/base/migrations/0009_auto_20160307_0905.py delete mode 100644 sapl/base/migrations/0010_auto_20160309_1323.py delete mode 100644 sapl/base/migrations/0011_problemamigracao.py delete mode 100644 sapl/base/migrations/0012_problemamigracao_eh_stub.py delete mode 100644 sapl/base/migrations/0013_remove_problemamigracao_endereco.py delete mode 100644 sapl/base/migrations/0014_auto_20160502_1635.py delete mode 100644 sapl/base/migrations/0015_problemamigracao_nome_campo.py delete mode 100644 sapl/base/migrations/0016_auto_20160701_0940.py delete mode 100644 sapl/base/migrations/0017_appconfig.py delete mode 100644 sapl/base/migrations/0018_auto_20160919_1333.py delete mode 100644 sapl/base/migrations/0019_auto_20160928_1951.py delete mode 100644 sapl/base/migrations/0020_auto_20161006_0950.py delete mode 100644 sapl/base/migrations/0021_auto_20161006_1019.py delete mode 100644 sapl/base/migrations/0022_auto_20161009_1222.py delete mode 100644 sapl/base/migrations/0023_auto_20161009_1852.py delete mode 100644 sapl/base/migrations/0024_auto_20161010_1002.py delete mode 100644 sapl/base/migrations/0025_tipoautor_cria_usuario.py delete mode 100644 sapl/base/migrations/0026_remove_tipoautor_cria_usuario.py delete mode 100644 sapl/base/migrations/0027_auto_20161011_1624.py delete mode 100644 sapl/base/migrations/0028_appconfig_proposicao_incorporacao_obrigatoria.py delete mode 100644 sapl/base/migrations/0029_auto_20161021_1445.py delete mode 100644 sapl/base/migrations/0030_auto_20161021_2017.py delete mode 100644 sapl/base/migrations/0031_auto_20170203_1019.py delete mode 100644 sapl/base/migrations/0032_auto_20170308_1006.py delete mode 100644 sapl/comissoes/migrations/0002_auto_20150729_1310.py delete mode 100644 sapl/comissoes/migrations/0003_auto_20160216_1015.py delete mode 100644 sapl/comissoes/migrations/0004_auto_20160307_0905.py delete mode 100644 sapl/comissoes/migrations/0005_comissao_ativa.py delete mode 100644 sapl/comissoes/migrations/0006_auto_20160825_1335.py delete mode 100644 sapl/comissoes/migrations/0006_auto_20160916_1243.py delete mode 100644 sapl/comissoes/migrations/0007_merge.py delete mode 100644 sapl/comissoes/migrations/0008_auto_20160929_1611.py delete mode 100644 sapl/comissoes/migrations/0009_auto_20161011_0843.py delete mode 100644 sapl/comissoes/migrations/0010_auto_20170325_1052.py delete mode 100644 sapl/compilacao/migrations/0002_auto_20150907_2334.py delete mode 100644 sapl/compilacao/migrations/0003_auto_20150911_1735.py delete mode 100644 sapl/compilacao/migrations/0004_auto_20150914_0842.py delete mode 100644 sapl/compilacao/migrations/0005_auto_20150924_1012.py delete mode 100644 sapl/compilacao/migrations/0006_auto_20150924_1121.py delete mode 100644 sapl/compilacao/migrations/0007_auto_20150924_1131.py delete mode 100644 sapl/compilacao/migrations/0008_auto_20151005_1023.py delete mode 100644 sapl/compilacao/migrations/0009_auto_20151007_1635.py delete mode 100644 sapl/compilacao/migrations/0010_auto_20151105_1532.py delete mode 100644 sapl/compilacao/migrations/0011_auto_20151105_1540.py delete mode 100644 sapl/compilacao/migrations/0012_auto_20151105_1658.py delete mode 100644 sapl/compilacao/migrations/0013_auto_20151106_1843.py delete mode 100644 sapl/compilacao/migrations/0014_auto_20151107_1836.py delete mode 100644 sapl/compilacao/migrations/0015_auto_20151115_2310.py delete mode 100644 sapl/compilacao/migrations/0016_auto_20151119_0950.py delete mode 100644 sapl/compilacao/migrations/0017_auto_20151119_1035.py delete mode 100644 sapl/compilacao/migrations/0018_auto_20151119_1052.py delete mode 100644 sapl/compilacao/migrations/0019_auto_20151119_1120.py delete mode 100644 sapl/compilacao/migrations/0020_auto_20151119_1126.py delete mode 100644 sapl/compilacao/migrations/0021_auto_20151119_1617.py delete mode 100644 sapl/compilacao/migrations/0022_auto_20151120_1503.py delete mode 100644 sapl/compilacao/migrations/0023_auto_20151120_1529.py delete mode 100644 sapl/compilacao/migrations/0024_auto_20151120_1814.py delete mode 100644 sapl/compilacao/migrations/0025_auto_20151122_1744.py delete mode 100644 sapl/compilacao/migrations/0026_auto_20151122_1756.py delete mode 100644 sapl/compilacao/migrations/0027_auto_20151130_1632.py delete mode 100644 sapl/compilacao/migrations/0028_auto_20151201_0042.py delete mode 100644 sapl/compilacao/migrations/0029_auto_20151201_1611.py delete mode 100644 sapl/compilacao/migrations/0030_auto_20151203_1114.py delete mode 100644 sapl/compilacao/migrations/0030_auto_20151203_1117.py delete mode 100644 sapl/compilacao/migrations/0031_merge.py delete mode 100644 sapl/compilacao/migrations/0032_auto_20151213_1538.py delete mode 100644 sapl/compilacao/migrations/0033_auto_20151226_1320.py delete mode 100644 sapl/compilacao/migrations/0034_auto_20151226_1321.py delete mode 100644 sapl/compilacao/migrations/0035_auto_20151226_1349.py delete mode 100644 sapl/compilacao/migrations/0036_auto_20151226_1411.py delete mode 100644 sapl/compilacao/migrations/0037_auto_20151226_1414.py delete mode 100644 sapl/compilacao/migrations/0038_tipotextoarticulado_model.py delete mode 100644 sapl/compilacao/migrations/0039_auto_20151226_1433.py delete mode 100644 sapl/compilacao/migrations/0040_auto_20160106_1956.py delete mode 100644 sapl/compilacao/migrations/0041_auto_20160109_1928.py delete mode 100644 sapl/compilacao/migrations/0042_auto_20160110_1620.py delete mode 100644 sapl/compilacao/migrations/0043_auto_20160110_1733.py delete mode 100644 sapl/compilacao/migrations/0044_auto_20160307_0918.py delete mode 100644 sapl/compilacao/migrations/0045_auto_20160311_1117.py delete mode 100644 sapl/compilacao/migrations/0045_auto_20160404_1411.py delete mode 100644 sapl/compilacao/migrations/0046_auto_20160319_1542.py delete mode 100644 sapl/compilacao/migrations/0047_auto_20160330_0027.py delete mode 100644 sapl/compilacao/migrations/0048_auto_20160404_2309.py delete mode 100644 sapl/compilacao/migrations/0049_merge.py delete mode 100644 sapl/compilacao/migrations/0050_auto_20160503_0926.py delete mode 100644 sapl/compilacao/migrations/0051_dispositivo_auto_inserido.py delete mode 100644 sapl/compilacao/migrations/0052_auto_20160915_1327.py delete mode 100644 sapl/compilacao/migrations/0053_auto_20160916_1420.py delete mode 100644 sapl/compilacao/migrations/0054_auto_20160916_1424.py delete mode 100644 sapl/compilacao/migrations/0055_dispositivo_dispositivo_de_revogacao.py delete mode 100644 sapl/compilacao/migrations/0056_auto_20161006_1251.py delete mode 100644 sapl/compilacao/migrations/0057_auto_20161007_2200.py delete mode 100644 sapl/compilacao/migrations/0058_auto_20161008_0143.py delete mode 100644 sapl/compilacao/migrations/0059_auto_20161027_1323.py delete mode 100644 sapl/compilacao/migrations/0060_auto_20161101_0913.py delete mode 100644 sapl/compilacao/migrations/0061_auto_20161101_1025.py delete mode 100644 sapl/compilacao/migrations/0062_auto_20161101_1221.py delete mode 100644 sapl/compilacao/migrations/0063_tipotextoarticulado_publicacao_func.py delete mode 100644 sapl/compilacao/migrations/0064_auto_20161104_1420.py delete mode 100644 sapl/compilacao/migrations/0065_auto_20161107_1024.py delete mode 100644 sapl/compilacao/migrations/0066_auto_20161107_1028.py delete mode 100644 sapl/compilacao/migrations/0067_auto_20161107_1351.py delete mode 100644 sapl/compilacao/migrations/0068_auto_20161107_1546.py delete mode 100644 sapl/compilacao/migrations/0069_auto_20161107_1932.py delete mode 100644 sapl/compilacao/migrations/0070_perfilestruturaltextoarticulado_parent.py delete mode 100644 sapl/compilacao/migrations/0071_tipotextoarticulado_perfis.py delete mode 100644 sapl/compilacao/migrations/0072_auto_20161112_1553.py delete mode 100644 sapl/legacy/migrations/0001_initial.py delete mode 100644 sapl/legacy/migrations/__init__.py delete mode 100644 sapl/lexml/migrations/0002_auto_20150806_1614.py delete mode 100644 sapl/lexml/migrations/0003_auto_20160216_1015.py delete mode 100644 sapl/lexml/migrations/0004_auto_20160307_0918.py delete mode 100644 sapl/materia/migrations/0002_auto_20150729_1310.py delete mode 100644 sapl/materia/migrations/0003_auto_20150729_1717.py delete mode 100644 sapl/materia/migrations/0004_materialegislativa_texto_original.py delete mode 100644 sapl/materia/migrations/0005_auto_20150923_0941.py delete mode 100644 sapl/materia/migrations/0006_proposicao_status.py delete mode 100644 sapl/materia/migrations/0007_auto_20151021_1200.py delete mode 100644 sapl/materia/migrations/0008_auto_20151029_1416.py delete mode 100644 sapl/materia/migrations/0009_auto_20151029_1420.py delete mode 100644 sapl/materia/migrations/0010_auto_20151117_1551.py delete mode 100644 sapl/materia/migrations/0011_proposicao_texto_original.py delete mode 100644 sapl/materia/migrations/0012_auto_20151124_1328.py delete mode 100644 sapl/materia/migrations/0013_remove_tramitacao_ultima.py delete mode 100644 sapl/materia/migrations/0014_autoria_partido.py delete mode 100644 sapl/materia/migrations/0015_auto_20160216_1015.py delete mode 100644 sapl/materia/migrations/0016_auto_20160223_0813.py delete mode 100644 sapl/materia/migrations/0016_auto_20160225_0918.py delete mode 100644 sapl/materia/migrations/0017_acompanhamentomateria_confirmado.py delete mode 100644 sapl/materia/migrations/0018_merge.py delete mode 100644 sapl/materia/migrations/0019_auto_20160229_1321.py delete mode 100644 sapl/materia/migrations/0020_auto_20160229_1324.py delete mode 100644 sapl/materia/migrations/0021_auto_20160307_0905.py delete mode 100644 sapl/materia/migrations/0022_auto_20160309_1323.py delete mode 100644 sapl/materia/migrations/0023_auto_20160309_1407.py delete mode 100644 sapl/materia/migrations/0024_auto_20160311_1501.py delete mode 100644 sapl/materia/migrations/0025_auto_20160311_1613.py delete mode 100644 sapl/materia/migrations/0026_auto_20160322_1514.py delete mode 100644 sapl/materia/migrations/0027_auto_20160404_1409.py delete mode 100644 sapl/materia/migrations/0028_auto_20160419_1000.py delete mode 100644 sapl/materia/migrations/0028_auto_20160419_1056.py delete mode 100644 sapl/materia/migrations/0029_auto_20160428_1020.py delete mode 100644 sapl/materia/migrations/0029_merge.py delete mode 100644 sapl/materia/migrations/0030_auto_20160429_1349.py delete mode 100644 sapl/materia/migrations/0030_auto_20160502_1630.py delete mode 100644 sapl/materia/migrations/0031_auto_20160502_1131.py delete mode 100644 sapl/materia/migrations/0031_merge.py delete mode 100644 sapl/materia/migrations/0032_auto_20160503_0926.py delete mode 100644 sapl/materia/migrations/0032_merge.py delete mode 100644 sapl/materia/migrations/0033_documentoacessorio_texto_original.py delete mode 100644 sapl/materia/migrations/0034_auto_20160510_0946.py delete mode 100644 sapl/materia/migrations/0035_auto_20160510_0949.py delete mode 100644 sapl/materia/migrations/0036_merge.py delete mode 100644 sapl/materia/migrations/0037_auto_20160520_1250.py delete mode 100644 sapl/materia/migrations/0038_auto_20160612_1506.py delete mode 100644 sapl/materia/migrations/0039_auto_20160628_1251.py delete mode 100644 sapl/materia/migrations/0039_auto_20160808_1753.py delete mode 100644 sapl/materia/migrations/0040_auto_20160810_1524.py delete mode 100644 sapl/materia/migrations/0041_remove_proposicao_data_incorporação.py delete mode 100644 sapl/materia/migrations/0042_proposicao_data_devolução.py delete mode 100644 sapl/materia/migrations/0043_auto_20160810_1738.py delete mode 100644 sapl/materia/migrations/0044_merge.py delete mode 100644 sapl/materia/migrations/0045_auto_20160823_1658.py delete mode 100644 sapl/materia/migrations/0046_auto_20160825_1504.py delete mode 100644 sapl/materia/migrations/0046_auto_20160825_1833.py delete mode 100644 sapl/materia/migrations/0047_merge.py delete mode 100644 sapl/materia/migrations/0048_auto_20160927_1254.py delete mode 100644 sapl/materia/migrations/0049_remove_autoria_partido.py delete mode 100644 sapl/materia/migrations/0050_auto_20161003_0417.py delete mode 100644 sapl/materia/migrations/0051_auto_20161004_0927.py delete mode 100644 sapl/materia/migrations/0052_auto_20161004_1041.py delete mode 100644 sapl/materia/migrations/0053_auto_20161004_1854.py delete mode 100644 sapl/materia/migrations/0054_auto_20161009_1222.py delete mode 100644 sapl/materia/migrations/0054_auto_20161011_0904.py delete mode 100644 sapl/materia/migrations/0055_auto_20161009_1418.py delete mode 100644 sapl/materia/migrations/0056_merge.py delete mode 100644 sapl/materia/migrations/0056_remove_tipo_proposicao.py delete mode 100644 sapl/materia/migrations/0057_auto_20161016_0156.py delete mode 100644 sapl/materia/migrations/0058_auto_20161016_0329.py delete mode 100644 sapl/materia/migrations/0059_auto_20161016_1333.py delete mode 100644 sapl/materia/migrations/0060_auto_20161017_0050.py delete mode 100644 sapl/materia/migrations/0061_auto_20161017_1655.py delete mode 100644 sapl/materia/migrations/0062_auto_20161021_1424.py delete mode 100644 sapl/materia/migrations/0063_auto_20161021_1445.py delete mode 100644 sapl/materia/migrations/0064_auto_20161022_1405.py delete mode 100644 sapl/materia/migrations/0065_auto_20161022_1411.py delete mode 100644 sapl/materia/migrations/0066_proposicao_ano.py delete mode 100644 sapl/materia/migrations/0067_auto_20161025_1630.py delete mode 100644 sapl/materia/migrations/0068_auto_20161110_0910.py delete mode 100644 sapl/materia/migrations/0069_tipoproposicao_perfis.py delete mode 100644 sapl/materia/migrations/0070_auto_20161111_1301.py delete mode 100644 sapl/materia/migrations/0071_auto_20161130_1001.py delete mode 100644 sapl/materia/migrations/0072_auto_20161130_1618.py delete mode 100644 sapl/materia/migrations/0073_auto_20161216_1640.py delete mode 100644 sapl/materia/migrations/0074_auto_20170102_0951.py delete mode 100644 sapl/materia/migrations/0075_auto_20170123_1548.py delete mode 100644 sapl/materia/migrations/0075_auto_20170203_1019.py delete mode 100644 sapl/materia/migrations/0076_merge.py delete mode 100644 sapl/materia/migrations/0077_auto_20170321_1130.py delete mode 100644 sapl/materia/migrations/0078_auto_20170325_1052.py delete mode 100644 sapl/norma/migrations/0002_auto_20150729_1717.py delete mode 100644 sapl/norma/migrations/0003_auto_20150906_0239.py delete mode 100644 sapl/norma/migrations/0004_auto_20150907_0004.py delete mode 100644 sapl/norma/migrations/0005_auto_20150915_1141.py delete mode 100644 sapl/norma/migrations/0006_auto_20151025_1427.py delete mode 100644 sapl/norma/migrations/0007_auto_20151130_1632.py delete mode 100644 sapl/norma/migrations/0008_normajuridica_texto_integral.py delete mode 100644 sapl/norma/migrations/0009_auto_20160106_1511.py delete mode 100644 sapl/norma/migrations/0010_auto_20160216_1015.py delete mode 100644 sapl/norma/migrations/0011_auto_20160307_1153.py delete mode 100644 sapl/norma/migrations/0012_auto_20160309_1407.py delete mode 100644 sapl/norma/migrations/0013_auto_20160503_0926.py delete mode 100644 sapl/norma/migrations/0013_auto_20160510_1404.py delete mode 100644 sapl/norma/migrations/0014_merge.py delete mode 100644 sapl/norma/migrations/0015_auto_20160929_1635.py delete mode 100644 sapl/norma/migrations/0016_auto_20161027_1419.py delete mode 100644 sapl/norma/migrations/0017_auto_20161027_1432.py delete mode 100644 sapl/norma/migrations/0018_auto_20161027_1434.py delete mode 100644 sapl/norma/migrations/0019_auto_20161028_0232.py delete mode 100644 sapl/norma/migrations/0020_auto_20161028_1335.py delete mode 100644 sapl/norma/migrations/0021_auto_20161028_1335.py delete mode 100644 sapl/norma/migrations/0022_auto_20161110_0910.py delete mode 100644 sapl/norma/migrations/0023_auto_20161123_1359.py delete mode 100644 sapl/norma/migrations/0024_auto_20161123_1430.py delete mode 100644 sapl/norma/migrations/0025_normarelacionada.py delete mode 100644 sapl/norma/migrations/0026_auto_20161123_1450.py delete mode 100644 sapl/norma/migrations/0027_auto_20161123_1538.py delete mode 100644 sapl/norma/migrations/0028_auto_20161202_1025.py delete mode 100644 sapl/norma/migrations/0029_auto_20161215_1652.py delete mode 100644 sapl/norma/migrations/0029_auto_20161216_1640.py delete mode 100644 sapl/norma/migrations/0030_auto_20170102_0951.py delete mode 100644 sapl/norma/migrations/0030_merge.py delete mode 100644 sapl/norma/migrations/0031_auto_20161219_1324.py delete mode 100644 sapl/norma/migrations/0032_merge.py delete mode 100644 sapl/norma/migrations/0033_auto_20170123_1548.py delete mode 100644 sapl/norma/migrations/0033_auto_20170203_1019.py delete mode 100644 sapl/norma/migrations/0034_auto_20170222_1435.py delete mode 100644 sapl/norma/migrations/0035_auto_20170222_1438.py delete mode 100644 sapl/norma/migrations/0036_merge.py delete mode 100644 sapl/norma/migrations/0037_auto_20170325_1052.py delete mode 100644 sapl/parlamentares/migrations/0002_auto_20150729_1310.py delete mode 100644 sapl/parlamentares/migrations/0003_auto_20150729_1717.py delete mode 100644 sapl/parlamentares/migrations/0004_auto_20150929_1425.py delete mode 100644 sapl/parlamentares/migrations/0005_parlamentar_fotografia.py delete mode 100644 sapl/parlamentares/migrations/0006_auto_20151119_1318.py delete mode 100644 sapl/parlamentares/migrations/0007_auto_20151123_1258.py delete mode 100644 sapl/parlamentares/migrations/0008_auto_20151126_1332.py delete mode 100644 sapl/parlamentares/migrations/0009_auto_20151126_1334.py delete mode 100644 sapl/parlamentares/migrations/0010_auto_20160107_1850.py delete mode 100644 sapl/parlamentares/migrations/0011_auto_20160216_1015.py delete mode 100644 sapl/parlamentares/migrations/0012_auto_20160307_0905.py delete mode 100644 sapl/parlamentares/migrations/0012_parlamentar_unidade_deliberativa.py delete mode 100644 sapl/parlamentares/migrations/0013_merge.py delete mode 100644 sapl/parlamentares/migrations/0014_auto_20160318_1504.py delete mode 100644 sapl/parlamentares/migrations/0015_auto_20160322_1401.py delete mode 100644 sapl/parlamentares/migrations/0016_auto_20160404_1409.py delete mode 100644 sapl/parlamentares/migrations/0017_remove_parlamentar_unidade_deliberativa.py delete mode 100644 sapl/parlamentares/migrations/0018_auto_20160510_0943.py delete mode 100644 sapl/parlamentares/migrations/0019_auto_20160518_1136.py delete mode 100644 sapl/parlamentares/migrations/0019_auto_20160518_1204.py delete mode 100644 sapl/parlamentares/migrations/0020_auto_20160518_1201.py delete mode 100644 sapl/parlamentares/migrations/0021_merge.py delete mode 100644 sapl/parlamentares/migrations/0022_auto_20160624_1124.py delete mode 100644 sapl/parlamentares/migrations/0022_auto_20160702_1519.py delete mode 100644 sapl/parlamentares/migrations/0023_auto_20160628_1247.py delete mode 100644 sapl/parlamentares/migrations/0024_merge.py delete mode 100644 sapl/parlamentares/migrations/0025_auto_20160916_1030.py delete mode 100644 sapl/parlamentares/migrations/0025_frente.py delete mode 100644 sapl/parlamentares/migrations/0026_auto_20160916_1034.py delete mode 100644 sapl/parlamentares/migrations/0027_merge.py delete mode 100644 sapl/parlamentares/migrations/0028_auto_20160922_1443.py delete mode 100644 sapl/parlamentares/migrations/0028_legislatura_numero.py delete mode 100644 sapl/parlamentares/migrations/0029_merge.py delete mode 100644 sapl/parlamentares/migrations/0030_auto_20160928_0846.py delete mode 100644 sapl/parlamentares/migrations/0031_auto_20160929_1842.py delete mode 100644 sapl/parlamentares/migrations/0032_frenteproxymasterdetail.py delete mode 100644 sapl/parlamentares/migrations/0033_auto_20160930_1715.py delete mode 100644 sapl/parlamentares/migrations/0034_delete_frenteparlamentar.py delete mode 100644 sapl/parlamentares/migrations/0035_auto_20161011_0840.py delete mode 100644 sapl/parlamentares/migrations/0036_partido_logo_partido.py delete mode 100644 sapl/parlamentares/migrations/0037_votante.py delete mode 100644 sapl/parlamentares/migrations/0038_auto_20170213_1425.py delete mode 100644 sapl/parlamentares/migrations/0039_remove_votante_ip.py delete mode 100644 sapl/parlamentares/migrations/0040_auto_20170214_1709.py delete mode 100644 sapl/parlamentares/migrations/0041_mandato_titular.py delete mode 100644 sapl/parlamentares/migrations/0042_auto_20170325_1052.py delete mode 100644 sapl/protocoloadm/migrations/0002_delete_tipoinstituicao.py delete mode 100644 sapl/protocoloadm/migrations/0003_auto_20161009_1222.py delete mode 100644 sapl/protocoloadm/migrations/0004_auto_20161023_1444.py delete mode 100644 sapl/protocoloadm/migrations/0005_auto_20161027_1741.py delete mode 100644 sapl/protocoloadm/migrations/0006_auto_20161103_1721.py delete mode 100644 sapl/protocoloadm/migrations/0007_auto_20161110_0910.py delete mode 100644 sapl/protocoloadm/migrations/0008_auto_20161216_1640.py delete mode 100644 sapl/protocoloadm/migrations/0009_auto_20170102_0951.py delete mode 100644 sapl/protocoloadm/migrations/0010_auto_20170123_1548.py delete mode 100644 sapl/protocoloadm/migrations/0010_auto_20170203_1019.py delete mode 100644 sapl/protocoloadm/migrations/0011_merge.py delete mode 100644 sapl/protocoloadm/migrations/0012_auto_20170315_1211.py delete mode 100644 sapl/protocoloadm/migrations/0013_auto_20170320_1637.py delete mode 100644 sapl/protocoloadm/migrations/0014_auto_20170321_1130.py delete mode 100644 sapl/protocoloadm/migrations/0015_auto_20170325_1052.py delete mode 100644 sapl/relatorios/migrations/__init__.py delete mode 100644 sapl/rules/migrations/__init__.py delete mode 100644 sapl/sessao/migrations/0002_auto_20150729_1450.py delete mode 100644 sapl/sessao/migrations/0003_remove_sessaoplenaria_tipo_expediente.py delete mode 100644 sapl/sessao/migrations/0004_auto_20150806_1614.py delete mode 100644 sapl/sessao/migrations/0005_remove_presencaordemdia_data_ordem.py delete mode 100644 sapl/sessao/migrations/0006_auto_20150929_1425.py delete mode 100644 sapl/sessao/migrations/0007_auto_20150929_1426.py delete mode 100644 sapl/sessao/migrations/0008_auto_20151005_0814.py delete mode 100644 sapl/sessao/migrations/0009_auto_20151005_0934.py delete mode 100644 sapl/sessao/migrations/0010_acompanharmateria.py delete mode 100644 sapl/sessao/migrations/0011_auto_20160113_1239.py delete mode 100644 sapl/sessao/migrations/0012_auto_20160120_1237.py delete mode 100644 sapl/sessao/migrations/0013_auto_20160216_1015.py delete mode 100644 sapl/sessao/migrations/0014_auto_20160223_0813.py delete mode 100644 sapl/sessao/migrations/0015_auto_20160307_0918.py delete mode 100644 sapl/sessao/migrations/0016_auto_20160404_1409.py delete mode 100644 sapl/sessao/migrations/0017_bancada.py delete mode 100644 sapl/sessao/migrations/0018_auto_20160517_1435.py delete mode 100644 sapl/sessao/migrations/0019_cargobancada.py delete mode 100644 sapl/sessao/migrations/0020_auto_20160517_1450.py delete mode 100644 sapl/sessao/migrations/0021_adicionamultiplasmaterias.py delete mode 100644 sapl/sessao/migrations/0022_auto_20160805_0943.py delete mode 100644 sapl/sessao/migrations/0023_auto_20160915_1405.py delete mode 100644 sapl/sessao/migrations/0024_bloco.py delete mode 100644 sapl/sessao/migrations/0025_auto_20160919_1503.py delete mode 100644 sapl/sessao/migrations/0026_auto_20160926_1445.py delete mode 100644 sapl/sessao/migrations/0027_auto_20161003_0417.py delete mode 100644 sapl/sessao/migrations/0028_auto_20161004_0927.py delete mode 100644 sapl/sessao/migrations/0029_auto_20161004_1101.py delete mode 100644 sapl/sessao/migrations/0030_auto_20161215_1652.py delete mode 100644 sapl/sessao/migrations/0030_auto_20161216_1640.py delete mode 100644 sapl/sessao/migrations/0031_auto_20170102_0951.py delete mode 100644 sapl/sessao/migrations/0031_merge.py delete mode 100644 sapl/sessao/migrations/0032_auto_20170102_0953.py delete mode 100644 sapl/sessao/migrations/0032_sessaoplenaria_upload_anexo.py delete mode 100644 sapl/sessao/migrations/0033_merge.py delete mode 100644 sapl/sessao/migrations/0034_votonominal.py delete mode 100644 sapl/sessao/migrations/0035_auto_20170213_1455.py delete mode 100644 sapl/sessao/migrations/0036_auto_20170325_1052.py diff --git a/sapl/api/migrations/__init__.py b/sapl/api/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/sapl/base/migrations/0001_initial.py b/sapl/base/migrations/0001_initial.py index 8b7f64d04..bcd9ae29d 100644 --- a/sapl/base/migrations/0001_initial.py +++ b/sapl/base/migrations/0001_initial.py @@ -1,38 +1,122 @@ # -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 11:14 from __future__ import unicode_literals +from django.conf import settings from django.db import migrations, models +import django.db.models.deletion +import sapl.base.models class Migration(migrations.Migration): + initial = True + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('contenttypes', '0002_remove_content_type_name'), ] operations = [ + migrations.CreateModel( + name='AppConfig', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('documentos_administrativos', models.CharField(choices=[('O', 'Ostensivo'), ('R', 'Restritivo')], default='O', max_length=1, verbose_name='Ostensivo/Restritivo')), + ('sequencia_numeracao', models.CharField(choices=[('A', 'Sequencial por ano'), ('U', 'Sequencial único')], default='A', max_length=1, verbose_name='Sequência de numeração')), + ('painel_aberto', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Painel aberto para usuário anônimo')), + ('texto_articulado_proposicao', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Usar Textos Articulados para Proposições')), + ('texto_articulado_materia', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Usar Textos Articulados para Matérias')), + ('texto_articulado_norma', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=True, verbose_name='Usar Textos Articulados para Normas')), + ('proposicao_incorporacao_obrigatoria', models.CharField(choices=[('O', 'Sempre Gerar Protocolo'), ('C', 'Perguntar se é pra gerar protocolo ao incorporar'), ('N', 'Nunca Protocolar ao incorporar uma proposição')], default='O', max_length=1, verbose_name='Regra de incorporação de proposições e protocolo')), + ('cronometro_discurso', models.TimeField(blank=True, null=True, verbose_name='Cronômetro do Discurso')), + ('cronometro_aparte', models.TimeField(blank=True, null=True, verbose_name='Cronômetro do Aparte')), + ('cronometro_ordem', models.TimeField(blank=True, null=True, verbose_name='Cronômetro da Ordem')), + ], + options={ + 'permissions': (('menu_sistemas', 'Renderizar Menu Sistemas'), ('view_tabelas_auxiliares', 'Visualizar Tabelas Auxiliares')), + 'verbose_name': 'Configurações da Aplicação', + 'verbose_name_plural': 'Configurações da Aplicação', + }, + ), + migrations.CreateModel( + name='Autor', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('object_id', models.PositiveIntegerField(blank=True, default=None, null=True)), + ('nome', models.CharField(blank=True, max_length=50, verbose_name='Nome do Autor')), + ('cargo', models.CharField(blank=True, max_length=50)), + ('content_type', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')), + ], + options={ + 'verbose_name': 'Autor', + 'verbose_name_plural': 'Autores', + }, + ), migrations.CreateModel( name='CasaLegislativa', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('codigo', models.CharField(max_length=100, verbose_name='Codigo')), ('nome', models.CharField(max_length=100, verbose_name='Nome')), ('sigla', models.CharField(max_length=100, verbose_name='Sigla')), ('endereco', models.CharField(max_length=100, verbose_name='Endereço')), ('cep', models.CharField(max_length=100, verbose_name='CEP')), ('municipio', models.CharField(max_length=100, verbose_name='Município')), - ('uf', models.CharField(max_length=100, verbose_name='UF')), - ('telefone', models.CharField(max_length=100, verbose_name='Telefone')), - ('fax', models.CharField(max_length=100, verbose_name='Fax')), - ('cor_fundo', models.CharField(max_length=100, verbose_name='Cor de fundo')), - ('cor_borda', models.CharField(max_length=100, verbose_name='Cor da borda')), - ('cor_principal', models.CharField(max_length=100, verbose_name='Cor principal')), - ('logotipo', models.CharField(max_length=100, verbose_name='Logotipo')), - ('endereco_web', models.CharField(max_length=100, verbose_name='HomePage')), - ('email', models.CharField(max_length=100, verbose_name='E-mail')), - ('informacao_geral', models.CharField(max_length=100, verbose_name='Informação Geral')), + ('uf', models.CharField(choices=[('AC', 'Acre'), ('AL', 'Alagoas'), ('AP', 'Amapá'), ('AM', 'Amazonas'), ('BA', 'Bahia'), ('CE', 'Ceará'), ('DF', 'Distrito Federal'), ('ES', 'Espírito Santo'), ('GO', 'Goiás'), ('MA', 'Maranhão'), ('MT', 'Mato Grosso'), ('MS', 'Mato Grosso do Sul'), ('MG', 'Minas Gerais'), ('PR', 'Paraná'), ('PB', 'Paraíba'), ('PA', 'Pará'), ('PE', 'Pernambuco'), ('PI', 'Piauí'), ('RJ', 'Rio de Janeiro'), ('RN', 'Rio Grande do Norte'), ('RS', 'Rio Grande do Sul'), ('RO', 'Rondônia'), ('RR', 'Roraima'), ('SC', 'Santa Catarina'), ('SE', 'Sergipe'), ('SP', 'São Paulo'), ('TO', 'Tocantins'), ('EX', 'Exterior')], max_length=100, verbose_name='UF')), + ('telefone', models.CharField(blank=True, max_length=100, verbose_name='Telefone')), + ('fax', models.CharField(blank=True, max_length=100, verbose_name='Fax')), + ('logotipo', models.ImageField(blank=True, upload_to=sapl.base.models.get_casa_media_path, verbose_name='Logotipo')), + ('endereco_web', models.URLField(blank=True, max_length=100, verbose_name='HomePage')), + ('email', models.EmailField(blank=True, max_length=100, verbose_name='E-mail')), + ('informacao_geral', models.TextField(blank=True, max_length=100, verbose_name='Informação Geral')), ], options={ - 'verbose_name_plural': 'Casas Legislativas', 'verbose_name': 'Casa Legislativa', + 'verbose_name_plural': 'Casa Legislativa', + }, + ), + migrations.CreateModel( + name='ProblemaMigracao', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('object_id', models.PositiveIntegerField(verbose_name='ID do Objeto')), + ('nome_campo', models.CharField(blank=True, max_length=100, verbose_name='Nome do(s) Campo(s)')), + ('problema', models.CharField(max_length=300, verbose_name='Problema')), + ('descricao', models.CharField(max_length=300, verbose_name='Descrição')), + ('eh_stub', models.BooleanField(verbose_name='É stub?')), + ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType', verbose_name='Tipo de Content')), + ], + options={ + 'verbose_name': 'Problema na Migração', + 'verbose_name_plural': 'Problemas na Migração', + }, + ), + migrations.CreateModel( + name='TipoAutor', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('descricao', models.CharField(max_length=50, verbose_name='Descrição')), + ('content_type', models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType', verbose_name='Modelagem no SAPL')), + ], + options={ + 'ordering': ['descricao'], + 'verbose_name': 'Tipo de Autor', + 'verbose_name_plural': 'Tipos de Autor', }, ), + migrations.AddField( + model_name='autor', + name='tipo', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='base.TipoAutor', verbose_name='Tipo do Autor'), + ), + migrations.AddField( + model_name='autor', + name='user', + field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL), + ), + migrations.AlterUniqueTogether( + name='autor', + unique_together=set([('content_type', 'object_id')]), + ), ] diff --git a/sapl/base/migrations/0002_casalegislativa_codigo.py b/sapl/base/migrations/0002_casalegislativa_codigo.py deleted file mode 100644 index 3275904b6..000000000 --- a/sapl/base/migrations/0002_casalegislativa_codigo.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='casalegislativa', - name='codigo', - field=models.CharField(verbose_name='Codigo', default=1, max_length=100), - preserve_default=False, - ), - ] diff --git a/sapl/base/migrations/0003_auto_20160107_1122.py b/sapl/base/migrations/0003_auto_20160107_1122.py deleted file mode 100644 index fb8dd51bd..000000000 --- a/sapl/base/migrations/0003_auto_20160107_1122.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -import sapl.base.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0002_casalegislativa_codigo'), - ] - - operations = [ - migrations.AlterField( - model_name='casalegislativa', - name='logotipo', - field=models.FileField( - null=True, upload_to=sapl.base.models.get_casa_media_path, verbose_name='Logotipo', blank=True), - ), - ] diff --git a/sapl/base/migrations/0004_auto_20160107_1158.py b/sapl/base/migrations/0004_auto_20160107_1158.py deleted file mode 100644 index af51d076f..000000000 --- a/sapl/base/migrations/0004_auto_20160107_1158.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0003_auto_20160107_1122'), - ] - - operations = [ - migrations.RemoveField( - model_name='casalegislativa', - name='cor_borda', - ), - migrations.RemoveField( - model_name='casalegislativa', - name='cor_fundo', - ), - migrations.RemoveField( - model_name='casalegislativa', - name='cor_principal', - ), - ] diff --git a/sapl/base/migrations/0005_auto_20160107_1244.py b/sapl/base/migrations/0005_auto_20160107_1244.py deleted file mode 100644 index f3b06f338..000000000 --- a/sapl/base/migrations/0005_auto_20160107_1244.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0004_auto_20160107_1158'), - ] - - operations = [ - migrations.AlterField( - model_name='casalegislativa', - name='email', - field=models.CharField(max_length=100, null=True, verbose_name='E-mail', blank=True), - ), - migrations.AlterField( - model_name='casalegislativa', - name='endereco_web', - field=models.CharField(max_length=100, null=True, verbose_name='HomePage', blank=True), - ), - migrations.AlterField( - model_name='casalegislativa', - name='fax', - field=models.CharField(max_length=100, null=True, verbose_name='Fax', blank=True), - ), - migrations.AlterField( - model_name='casalegislativa', - name='informacao_geral', - field=models.CharField(max_length=100, null=True, verbose_name='Informação Geral', blank=True), - ), - migrations.AlterField( - model_name='casalegislativa', - name='telefone', - field=models.CharField(max_length=100, null=True, verbose_name='Telefone', blank=True), - ), - ] diff --git a/sapl/base/migrations/0006_auto_20160107_1257.py b/sapl/base/migrations/0006_auto_20160107_1257.py deleted file mode 100644 index 4f0e69522..000000000 --- a/sapl/base/migrations/0006_auto_20160107_1257.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0005_auto_20160107_1244'), - ] - - operations = [ - migrations.AlterField( - model_name='casalegislativa', - name='informacao_geral', - field=models.CharField(verbose_name='Informação Geral', max_length=100, default=1), - preserve_default=False, - ), - ] diff --git a/sapl/base/migrations/0007_auto_20160107_1837.py b/sapl/base/migrations/0007_auto_20160107_1837.py deleted file mode 100644 index 58714badf..000000000 --- a/sapl/base/migrations/0007_auto_20160107_1837.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import sapl.base.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0006_auto_20160107_1257'), - ] - - operations = [ - migrations.AlterField( - model_name='casalegislativa', - name='informacao_geral', - field=models.CharField( - blank=True, max_length=100, verbose_name='Informação Geral', null=True), - ), - migrations.AlterField( - model_name='casalegislativa', - name='logotipo', - field=models.ImageField( - blank=True, upload_to=sapl.base.models.get_casa_media_path, verbose_name='Logotipo', null=True), - ), - ] diff --git a/sapl/base/migrations/0008_auto_20160216_1015.py b/sapl/base/migrations/0008_auto_20160216_1015.py deleted file mode 100644 index d969a82e0..000000000 --- a/sapl/base/migrations/0008_auto_20160216_1015.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import datetime - -from django.db import models, migrations -from django.utils.timezone import utc - -import sapl.base.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0007_auto_20160107_1837'), - ] - - operations = [ - migrations.AlterField( - model_name='casalegislativa', - name='email', - field=models.CharField(verbose_name='E-mail', max_length=100, default=datetime.datetime( - 2016, 2, 16, 12, 15, 30, 241941, tzinfo=utc), blank=True), - preserve_default=False, - ), - migrations.AlterField( - model_name='casalegislativa', - name='endereco_web', - field=models.CharField( - verbose_name='HomePage', max_length=100, blank=True), - ), - migrations.AlterField( - model_name='casalegislativa', - name='fax', - field=models.CharField( - verbose_name='Fax', max_length=100, blank=True), - ), - migrations.AlterField( - model_name='casalegislativa', - name='informacao_geral', - field=models.CharField( - verbose_name='Informação Geral', max_length=100, blank=True), - ), - migrations.AlterField( - model_name='casalegislativa', - name='logotipo', - field=models.ImageField( - verbose_name='Logotipo', upload_to=sapl.base.models.get_casa_media_path, blank=True), - ), - migrations.AlterField( - model_name='casalegislativa', - name='telefone', - field=models.CharField( - verbose_name='Telefone', max_length=100, blank=True), - ), - ] diff --git a/sapl/base/migrations/0009_auto_20160307_0905.py b/sapl/base/migrations/0009_auto_20160307_0905.py deleted file mode 100644 index adecc2ac3..000000000 --- a/sapl/base/migrations/0009_auto_20160307_0905.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-07 12:05 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0008_auto_20160216_1015'), - ] - - operations = [ - migrations.AlterField( - model_name='casalegislativa', - name='email', - field=models.EmailField(blank=True, max_length=100, verbose_name='E-mail'), - ), - migrations.AlterField( - model_name='casalegislativa', - name='endereco_web', - field=models.URLField(blank=True, max_length=100, verbose_name='HomePage'), - ), - ] diff --git a/sapl/base/migrations/0010_auto_20160309_1323.py b/sapl/base/migrations/0010_auto_20160309_1323.py deleted file mode 100644 index d0caee056..000000000 --- a/sapl/base/migrations/0010_auto_20160309_1323.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-09 16:23 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0009_auto_20160307_0905'), - ] - - operations = [ - migrations.AlterField( - model_name='casalegislativa', - name='informacao_geral', - field=models.TextField(blank=True, max_length=100, verbose_name='Informação Geral'), - ), - migrations.AlterField( - model_name='casalegislativa', - name='uf', - field=models.CharField(choices=[('AC', 'Acre'), ('AL', 'Alagoas'), ('AP', 'Amapá'), ('AM', 'Amazonas'), ('BA', 'Bahia'), ('CE', 'Ceará'), ('DF', 'Distrito Federal'), ('ES', 'Espírito Santo'), ('GO', 'Goiás'), ('MA', 'Maranhão'), ('MT', 'Mato Grosso'), ('MS', 'Mato Grosso do Sul'), ('MG', 'Minas Gerais'), ('PR', 'Paraná'), ('PB', 'Paraíba'), ('PA', 'Pará'), ('PE', 'Pernambuco'), ('PI', 'Piauí'), ('RJ', 'Rio de Janeiro'), ('RN', 'Rio Grande do Norte'), ('RS', 'Rio Grande do Sul'), ('RO', 'Rondônia'), ('RR', 'Roraima'), ('SC', 'Santa Catarina'), ('SE', 'Sergipe'), ('SP', 'São Paulo'), ('TO', 'Tocantins'), ('EX', 'Exterior')], max_length=100, verbose_name='UF'), - ), - ] diff --git a/sapl/base/migrations/0011_problemamigracao.py b/sapl/base/migrations/0011_problemamigracao.py deleted file mode 100644 index aa8eae5ce..000000000 --- a/sapl/base/migrations/0011_problemamigracao.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-04-19 16:02 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('contenttypes', '0002_remove_content_type_name'), - ('base', '0010_auto_20160309_1323'), - ] - - operations = [ - migrations.CreateModel( - name='ProblemaMigracao', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('object_id', models.PositiveIntegerField(verbose_name='ID do Objeto')), - ('problema', models.CharField(max_length=300, null=True, verbose_name='Problema')), - ('descricao', models.CharField(max_length=300, null=True, verbose_name='Descrição')), - ('endereco', models.URLField(null=True, verbose_name='Endereço')), - ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType', verbose_name='Tipo de Content')), - ], - options={ - 'verbose_name_plural': 'Problemas na Migração', - 'verbose_name': 'Problema na Migração', - }, - ), - ] diff --git a/sapl/base/migrations/0012_problemamigracao_eh_stub.py b/sapl/base/migrations/0012_problemamigracao_eh_stub.py deleted file mode 100644 index b145c3383..000000000 --- a/sapl/base/migrations/0012_problemamigracao_eh_stub.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-04-26 17:41 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0011_problemamigracao'), - ] - - operations = [ - migrations.AddField( - model_name='problemamigracao', - name='eh_stub', - field=models.BooleanField(default=False, verbose_name='É stub?'), - preserve_default=False, - ), - ] diff --git a/sapl/base/migrations/0013_remove_problemamigracao_endereco.py b/sapl/base/migrations/0013_remove_problemamigracao_endereco.py deleted file mode 100644 index 67526693d..000000000 --- a/sapl/base/migrations/0013_remove_problemamigracao_endereco.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-02 17:36 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0012_problemamigracao_eh_stub'), - ] - - operations = [ - migrations.RemoveField( - model_name='problemamigracao', - name='endereco', - ), - ] diff --git a/sapl/base/migrations/0014_auto_20160502_1635.py b/sapl/base/migrations/0014_auto_20160502_1635.py deleted file mode 100644 index 6fbae0bb9..000000000 --- a/sapl/base/migrations/0014_auto_20160502_1635.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-02 19:35 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0013_remove_problemamigracao_endereco'), - ] - - operations = [ - migrations.AlterField( - model_name='problemamigracao', - name='descricao', - field=models.CharField(default='', max_length=300, verbose_name='Descrição'), - preserve_default=False, - ), - migrations.AlterField( - model_name='problemamigracao', - name='problema', - field=models.CharField(default='', max_length=300, verbose_name='Problema'), - preserve_default=False, - ), - ] diff --git a/sapl/base/migrations/0015_problemamigracao_nome_campo.py b/sapl/base/migrations/0015_problemamigracao_nome_campo.py deleted file mode 100644 index 07be71fb1..000000000 --- a/sapl/base/migrations/0015_problemamigracao_nome_campo.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-10 20:34 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0014_auto_20160502_1635'), - ] - - operations = [ - migrations.AddField( - model_name='problemamigracao', - name='nome_campo', - field=models.CharField(blank=True, max_length=100, verbose_name='Nome do(s) Campo(s)'), - ), - ] diff --git a/sapl/base/migrations/0016_auto_20160701_0940.py b/sapl/base/migrations/0016_auto_20160701_0940.py deleted file mode 100644 index 0347cbd19..000000000 --- a/sapl/base/migrations/0016_auto_20160701_0940.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-07-01 12:40 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0015_problemamigracao_nome_campo'), - ] - - operations = [ - migrations.AlterModelOptions( - name='casalegislativa', - options={'verbose_name': 'Casa Legislativa', 'verbose_name_plural': 'Casa Legislativa'}, - ), - ] diff --git a/sapl/base/migrations/0017_appconfig.py b/sapl/base/migrations/0017_appconfig.py deleted file mode 100644 index d162248c8..000000000 --- a/sapl/base/migrations/0017_appconfig.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-15 18:19 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0016_auto_20160701_0940'), - ] - - operations = [ - migrations.CreateModel( - name='AppConfig', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('documentos_administrativos', models.CharField(blank=True, choices=[('O', 'Ostensivo'), ('R', 'Restritivo')], max_length=1, null=True, verbose_name='Ostensivo/Restritivo')), - ('sequencia_numeracao', models.CharField(blank=True, choices=[('A', 'Sequencial por ano'), ('U', 'Sequencial único')], max_length=1, null=True, verbose_name='Sequência de numeração')), - ('painel_aberto', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Painel aberto para usuário anônimo')), - ], - ), - ] diff --git a/sapl/base/migrations/0018_auto_20160919_1333.py b/sapl/base/migrations/0018_auto_20160919_1333.py deleted file mode 100644 index f21ba8131..000000000 --- a/sapl/base/migrations/0018_auto_20160919_1333.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-19 16:33 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0017_appconfig'), - ] - - operations = [ - migrations.AlterModelOptions( - name='appconfig', - options={'verbose_name': 'Configurações da Aplicação', 'verbose_name_plural': 'Configurações da Aplicação'}, - ), - migrations.AlterField( - model_name='appconfig', - name='documentos_administrativos', - field=models.CharField(choices=[('O', 'Ostensivo'), ('R', 'Restritivo')], default='O', max_length=1, verbose_name='Ostensivo/Restritivo'), - ), - migrations.AlterField( - model_name='appconfig', - name='painel_aberto', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Painel aberto para usuário anônimo'), - ), - migrations.AlterField( - model_name='appconfig', - name='sequencia_numeracao', - field=models.CharField(choices=[('A', 'Sequencial por ano'), ('U', 'Sequencial único')], default='A', max_length=1, verbose_name='Sequência de numeração'), - ), - ] diff --git a/sapl/base/migrations/0019_auto_20160928_1951.py b/sapl/base/migrations/0019_auto_20160928_1951.py deleted file mode 100644 index 9c61f7062..000000000 --- a/sapl/base/migrations/0019_auto_20160928_1951.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-28 22:51 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0018_auto_20160919_1333'), - ] - - operations = [ - migrations.AlterModelOptions( - name='appconfig', - options={'permissions': (('menu_sistemas', 'Renderizar Menu Sistemas'), ('view_tabelas_auxiliares', 'Visualizar Tabelas Auxiliares')), 'verbose_name': 'Configurações da Aplicação', 'verbose_name_plural': 'Configurações da Aplicação'}, - ), - ] diff --git a/sapl/base/migrations/0020_auto_20161006_0950.py b/sapl/base/migrations/0020_auto_20161006_0950.py deleted file mode 100644 index 71f9f9a6b..000000000 --- a/sapl/base/migrations/0020_auto_20161006_0950.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-06 12:50 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0019_auto_20160928_1951'), - ] - - operations = [ - migrations.AddField( - model_name='appconfig', - name='texto_articulado_materia', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Usar Textos Articulados para Matérias'), - ), - migrations.AddField( - model_name='appconfig', - name='texto_articulado_norma', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Usar Textos Articulados para Normas'), - ), - migrations.AddField( - model_name='appconfig', - name='texto_articulado_proposicao', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Usar Textos Articulados para Proposições'), - ), - ] diff --git a/sapl/base/migrations/0021_auto_20161006_1019.py b/sapl/base/migrations/0021_auto_20161006_1019.py deleted file mode 100644 index 107cca4d4..000000000 --- a/sapl/base/migrations/0021_auto_20161006_1019.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-06 13:19 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0020_auto_20161006_0950'), - ] - - operations = [ - migrations.AlterField( - model_name='appconfig', - name='texto_articulado_norma', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=True, verbose_name='Usar Textos Articulados para Normas'), - ), - ] diff --git a/sapl/base/migrations/0022_auto_20161009_1222.py b/sapl/base/migrations/0022_auto_20161009_1222.py deleted file mode 100644 index 37794c428..000000000 --- a/sapl/base/migrations/0022_auto_20161009_1222.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-09 15:22 -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 = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('contenttypes', '0002_remove_content_type_name'), - ('base', '0021_auto_20161006_1019'), - ] - - operations = [ - migrations.CreateModel( - name='Autor', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('object_id', models.PositiveIntegerField(blank=True, default=None, null=True)), - ('nome', models.CharField(blank=True, max_length=50, verbose_name='Autor')), - ('cargo', models.CharField(blank=True, max_length=50)), - ('content_type', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')), - ], - options={ - 'verbose_name': 'Autor', - 'verbose_name_plural': 'Autores', - }, - ), - migrations.CreateModel( - name='TipoAutor', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('descricao', models.CharField(max_length=50, verbose_name='Descrição')), - ('content_type', models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType', verbose_name='Modelo do Tipo de Autor')), - ], - options={ - 'verbose_name': 'Tipo de Autor', - 'verbose_name_plural': 'Tipos de Autor', - }, - ), - migrations.AddField( - model_name='autor', - name='tipo', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='base.TipoAutor', verbose_name='Tipo'), - ), - migrations.AddField( - model_name='autor', - name='user', - field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), - ), - ] diff --git a/sapl/base/migrations/0023_auto_20161009_1852.py b/sapl/base/migrations/0023_auto_20161009_1852.py deleted file mode 100644 index 79baef066..000000000 --- a/sapl/base/migrations/0023_auto_20161009_1852.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-09 21:52 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0022_auto_20161009_1222'), - ] - - operations = [ - migrations.AlterField( - model_name='tipoautor', - name='content_type', - field=models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType', verbose_name='Modelagem no SAPL'), - ), - migrations.AlterUniqueTogether( - name='autor', - unique_together=set([('content_type', 'object_id')]), - ), - ] diff --git a/sapl/base/migrations/0024_auto_20161010_1002.py b/sapl/base/migrations/0024_auto_20161010_1002.py deleted file mode 100644 index 0de18cad7..000000000 --- a/sapl/base/migrations/0024_auto_20161010_1002.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-10 13:02 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0023_auto_20161009_1852'), - ] - - operations = [ - migrations.AlterField( - model_name='autor', - name='nome', - field=models.CharField(blank=True, max_length=50, verbose_name='Nome do Autor'), - ), - migrations.AlterField( - model_name='autor', - name='tipo', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='base.TipoAutor', verbose_name='Tipo do Autor'), - ), - ] diff --git a/sapl/base/migrations/0025_tipoautor_cria_usuario.py b/sapl/base/migrations/0025_tipoautor_cria_usuario.py deleted file mode 100644 index ba36e092c..000000000 --- a/sapl/base/migrations/0025_tipoautor_cria_usuario.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-11 14:38 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0024_auto_20161010_1002'), - ] - - operations = [ - migrations.AddField( - model_name='tipoautor', - name='cria_usuario', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, help_text='Criação de Usuários víncula e libera o acesso de Autores ao sistema. Vincular um Autor a um tipo que esta opção está marcada como "Não", o Autor não terá username associado.', verbose_name='Criação de Usuários'), - ), - ] diff --git a/sapl/base/migrations/0026_remove_tipoautor_cria_usuario.py b/sapl/base/migrations/0026_remove_tipoautor_cria_usuario.py deleted file mode 100644 index 948427836..000000000 --- a/sapl/base/migrations/0026_remove_tipoautor_cria_usuario.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-11 18:08 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0025_tipoautor_cria_usuario'), - ] - - operations = [ - migrations.RemoveField( - model_name='tipoautor', - name='cria_usuario', - ), - ] diff --git a/sapl/base/migrations/0027_auto_20161011_1624.py b/sapl/base/migrations/0027_auto_20161011_1624.py deleted file mode 100644 index ff6eae09d..000000000 --- a/sapl/base/migrations/0027_auto_20161011_1624.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-11 19:24 -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 = [ - ('base', '0026_remove_tipoautor_cria_usuario'), - ] - - operations = [ - migrations.AlterField( - model_name='autor', - name='user', - field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL), - ), - ] diff --git a/sapl/base/migrations/0028_appconfig_proposicao_incorporacao_obrigatoria.py b/sapl/base/migrations/0028_appconfig_proposicao_incorporacao_obrigatoria.py deleted file mode 100644 index 131aa99a7..000000000 --- a/sapl/base/migrations/0028_appconfig_proposicao_incorporacao_obrigatoria.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-21 14:24 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0027_auto_20161011_1624'), - ] - - operations = [ - migrations.AddField( - model_name='appconfig', - name='proposicao_incorporacao_obrigatoria', - field=models.BooleanField(choices=[('O', 'Sempre Gerar Protocolo.'), ('C', 'Perguntar se é pra gerar protocolo ao incorporar.'), ('N', 'Nunca Protocolar ao incorporar uma proposição.')], default='O', verbose_name='Regra de incorporação e protocolo'), - ), - ] diff --git a/sapl/base/migrations/0029_auto_20161021_1445.py b/sapl/base/migrations/0029_auto_20161021_1445.py deleted file mode 100644 index 4f01852f1..000000000 --- a/sapl/base/migrations/0029_auto_20161021_1445.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-21 14:45 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0028_appconfig_proposicao_incorporacao_obrigatoria'), - ] - - operations = [ - migrations.AlterField( - model_name='appconfig', - name='proposicao_incorporacao_obrigatoria', - field=models.BooleanField(choices=[('O', 'Sempre Gerar Protocolo'), ('C', 'Perguntar se é pra gerar protocolo ao incorporar'), ('N', 'Nunca Protocolar ao incorporar uma proposição')], default='O', verbose_name='Regra de incorporação de proposições e protocolo'), - ), - ] diff --git a/sapl/base/migrations/0030_auto_20161021_2017.py b/sapl/base/migrations/0030_auto_20161021_2017.py deleted file mode 100644 index 1aa346a40..000000000 --- a/sapl/base/migrations/0030_auto_20161021_2017.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-21 20:17 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0029_auto_20161021_1445'), - ] - - operations = [ - migrations.AlterField( - model_name='appconfig', - name='proposicao_incorporacao_obrigatoria', - field=models.CharField(choices=[('O', 'Sempre Gerar Protocolo'), ('C', 'Perguntar se é pra gerar protocolo ao incorporar'), ('N', 'Nunca Protocolar ao incorporar uma proposição')], default='O', max_length=1, verbose_name='Regra de incorporação de proposições e protocolo'), - ), - ] diff --git a/sapl/base/migrations/0031_auto_20170203_1019.py b/sapl/base/migrations/0031_auto_20170203_1019.py deleted file mode 100644 index b992ed44f..000000000 --- a/sapl/base/migrations/0031_auto_20170203_1019.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-02-03 10:19 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0030_auto_20161021_2017'), - ] - - operations = [ - migrations.AlterModelOptions( - name='tipoautor', - options={'ordering': ['descricao'], 'verbose_name': 'Tipo de Autor', 'verbose_name_plural': 'Tipos de Autor'}, - ), - ] diff --git a/sapl/base/migrations/0032_auto_20170308_1006.py b/sapl/base/migrations/0032_auto_20170308_1006.py deleted file mode 100644 index 61172bbda..000000000 --- a/sapl/base/migrations/0032_auto_20170308_1006.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-03-08 10:06 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0031_auto_20170203_1019'), - ] - - operations = [ - migrations.AddField( - model_name='appconfig', - name='cronometro_aparte', - field=models.TimeField(blank=True, null=True, verbose_name='Cronômetro do Aparte'), - ), - migrations.AddField( - model_name='appconfig', - name='cronometro_discurso', - field=models.TimeField(blank=True, null=True, verbose_name='Cronômetro do Discurso'), - ), - migrations.AddField( - model_name='appconfig', - name='cronometro_ordem', - field=models.TimeField(blank=True, null=True, verbose_name='Cronômetro da Ordem'), - ), - ] diff --git a/sapl/comissoes/migrations/0001_initial.py b/sapl/comissoes/migrations/0001_initial.py index 42cd116fa..584ef5131 100644 --- a/sapl/comissoes/migrations/0001_initial.py +++ b/sapl/comissoes/migrations/0001_initial.py @@ -1,11 +1,15 @@ # -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 11:14 from __future__ import unicode_literals from django.db import migrations, models +import django.db.models.deletion class Migration(migrations.Migration): + initial = True + dependencies = [ ('parlamentares', '0001_initial'), ] @@ -14,107 +18,108 @@ class Migration(migrations.Migration): migrations.CreateModel( name='CargoComissao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nome', models.CharField(max_length=50, verbose_name='Cargo')), - ('unico', models.BooleanField(verbose_name='Único')), + ('unico', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Único')), ], options={ - 'verbose_name_plural': 'Cargos de Comissão', 'verbose_name': 'Cargo de Comissão', + 'verbose_name_plural': 'Cargos de Comissão', }, ), migrations.CreateModel( name='Comissao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nome', models.CharField(max_length=60, verbose_name='Nome')), ('sigla', models.CharField(max_length=10, verbose_name='Sigla')), ('data_criacao', models.DateField(verbose_name='Data de Criação')), ('data_extincao', models.DateField(blank=True, null=True, verbose_name='Data de Extinção')), - ('apelido_temp', models.CharField(blank=True, max_length=100, null=True, verbose_name='Apelido')), + ('apelido_temp', models.CharField(blank=True, max_length=100, verbose_name='Apelido')), ('data_instalacao_temp', models.DateField(blank=True, null=True, verbose_name='Data Instalação')), ('data_final_prevista_temp', models.DateField(blank=True, null=True, verbose_name='Data Prevista Término')), ('data_prorrogada_temp', models.DateField(blank=True, null=True, verbose_name='Novo Prazo')), ('data_fim_comissao', models.DateField(blank=True, null=True, verbose_name='Data Término')), - ('secretario', models.CharField(blank=True, max_length=30, null=True, verbose_name='Secretário')), - ('telefone_reuniao', models.CharField(blank=True, max_length=15, null=True, verbose_name='Tel. Sala Reunião')), - ('endereco_secretaria', models.CharField(blank=True, max_length=100, null=True, verbose_name='Endereço Secretaria')), - ('telefone_secretaria', models.CharField(blank=True, max_length=15, null=True, verbose_name='Tel. Secretaria')), - ('fax_secretaria', models.CharField(blank=True, max_length=15, null=True, verbose_name='Fax Secretaria')), - ('agenda_reuniao', models.CharField(blank=True, max_length=100, null=True, verbose_name='Data/Hora Reunião')), - ('local_reuniao', models.CharField(blank=True, max_length=100, null=True, verbose_name='Local Reunião')), - ('finalidade', models.TextField(blank=True, null=True, verbose_name='Finalidade')), - ('email', models.CharField(blank=True, max_length=100, null=True, verbose_name='E-mail')), - ('unidade_deliberativa', models.BooleanField(verbose_name='Unidade Deliberativa', choices=[(True, 'Sim'), (False, 'Não')])), + ('secretario', models.CharField(blank=True, max_length=30, verbose_name='Secretário')), + ('telefone_reuniao', models.CharField(blank=True, max_length=15, verbose_name='Tel. Sala Reunião')), + ('endereco_secretaria', models.CharField(blank=True, max_length=100, verbose_name='Endereço Secretaria')), + ('telefone_secretaria', models.CharField(blank=True, max_length=15, verbose_name='Tel. Secretaria')), + ('fax_secretaria', models.CharField(blank=True, max_length=15, verbose_name='Fax Secretaria')), + ('agenda_reuniao', models.CharField(blank=True, max_length=100, verbose_name='Data/Hora Reunião')), + ('local_reuniao', models.CharField(blank=True, max_length=100, verbose_name='Local Reunião')), + ('finalidade', models.TextField(blank=True, verbose_name='Finalidade')), + ('email', models.EmailField(blank=True, max_length=100, verbose_name='E-mail')), + ('unidade_deliberativa', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Unidade Deliberativa')), + ('ativa', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Comissão Ativa?')), ], options={ - 'verbose_name_plural': 'Comissões', 'verbose_name': 'Comissão', + 'verbose_name_plural': 'Comissões', }, ), migrations.CreateModel( name='Composicao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('comissao', models.ForeignKey(to='comissoes.Comissao', verbose_name='Comissão')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('comissao', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.Comissao', verbose_name='Comissão')), ], options={ - 'verbose_name_plural': 'Composições de Comissão', 'verbose_name': 'Composição de Comissão', + 'verbose_name_plural': 'Composições de Comissão', }, ), migrations.CreateModel( name='Participacao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('titular', models.BooleanField(verbose_name='Titular')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('titular', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Titular')), ('data_designacao', models.DateField(verbose_name='Data Designação')), ('data_desligamento', models.DateField(blank=True, null=True, verbose_name='Data Desligamento')), - ('motivo_desligamento', models.CharField(blank=True, max_length=150, null=True, verbose_name='Motivo Desligamento')), - ('observacao', models.CharField(blank=True, max_length=150, null=True, verbose_name='Observação')), - ('cargo', models.ForeignKey(to='comissoes.CargoComissao')), - ('composicao', models.ForeignKey(to='comissoes.Composicao')), - ('parlamentar', models.ForeignKey(to='parlamentares.Parlamentar')), + ('motivo_desligamento', models.CharField(blank=True, max_length=150, verbose_name='Motivo Desligamento')), + ('observacao', models.CharField(blank=True, max_length=150, verbose_name='Observação')), + ('cargo', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.CargoComissao')), + ('composicao', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='participacao_set', to='comissoes.Composicao')), + ('parlamentar', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar')), ], options={ - 'verbose_name_plural': 'Participações em Comissão', 'verbose_name': 'Participação em Comissão', + 'verbose_name_plural': 'Participações em Comissão', }, ), migrations.CreateModel( name='Periodo', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('data_inicio', models.DateField(verbose_name='Data Início')), ('data_fim', models.DateField(blank=True, null=True, verbose_name='Data Fim')), ], options={ - 'verbose_name_plural': 'Períodos de composição de Comissão', 'verbose_name': 'Período de composição de Comissão', + 'verbose_name_plural': 'Períodos de composição de Comissão', }, ), migrations.CreateModel( name='TipoComissao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nome', models.CharField(max_length=50, verbose_name='Nome')), ('natureza', models.CharField(choices=[('T', 'Temporária'), ('P', 'Permanente')], max_length=1, verbose_name='Natureza')), ('sigla', models.CharField(max_length=10, verbose_name='Sigla')), - ('dispositivo_regimental', models.CharField(blank=True, max_length=50, null=True, verbose_name='Dispositivo Regimental')), + ('dispositivo_regimental', models.CharField(blank=True, max_length=50, verbose_name='Dispositivo Regimental')), ], options={ - 'verbose_name_plural': 'Tipos de Comissão', 'verbose_name': 'Tipo de Comissão', + 'verbose_name_plural': 'Tipos de Comissão', }, ), migrations.AddField( model_name='composicao', name='periodo', - field=models.ForeignKey(to='comissoes.Periodo', verbose_name='Período'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.Periodo', verbose_name='Período'), ), migrations.AddField( model_name='comissao', name='tipo', - field=models.ForeignKey(to='comissoes.TipoComissao', verbose_name='Tipo'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.TipoComissao', verbose_name='Tipo'), ), ] diff --git a/sapl/comissoes/migrations/0002_auto_20150729_1310.py b/sapl/comissoes/migrations/0002_auto_20150729_1310.py deleted file mode 100644 index eef2e558e..000000000 --- a/sapl/comissoes/migrations/0002_auto_20150729_1310.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('comissoes', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='cargocomissao', - name='unico', - field=models.BooleanField(verbose_name='Único', choices=[(True, 'Sim'), (False, 'Não')]), - ), - ] diff --git a/sapl/comissoes/migrations/0003_auto_20160216_1015.py b/sapl/comissoes/migrations/0003_auto_20160216_1015.py deleted file mode 100644 index b4108ae12..000000000 --- a/sapl/comissoes/migrations/0003_auto_20160216_1015.py +++ /dev/null @@ -1,79 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('comissoes', '0002_auto_20150729_1310'), - ] - - operations = [ - migrations.AlterField( - model_name='comissao', - name='agenda_reuniao', - field=models.CharField(verbose_name='Data/Hora Reunião', max_length=100, blank=True), - ), - migrations.AlterField( - model_name='comissao', - name='apelido_temp', - field=models.CharField(verbose_name='Apelido', max_length=100, blank=True), - ), - migrations.AlterField( - model_name='comissao', - name='email', - field=models.CharField(verbose_name='E-mail', max_length=100, blank=True), - ), - migrations.AlterField( - model_name='comissao', - name='endereco_secretaria', - field=models.CharField(verbose_name='Endereço Secretaria', max_length=100, blank=True), - ), - migrations.AlterField( - model_name='comissao', - name='fax_secretaria', - field=models.CharField(verbose_name='Fax Secretaria', max_length=15, blank=True), - ), - migrations.AlterField( - model_name='comissao', - name='finalidade', - field=models.TextField(verbose_name='Finalidade', blank=True), - ), - migrations.AlterField( - model_name='comissao', - name='local_reuniao', - field=models.CharField(verbose_name='Local Reunião', max_length=100, blank=True), - ), - migrations.AlterField( - model_name='comissao', - name='secretario', - field=models.CharField(verbose_name='Secretário', max_length=30, blank=True), - ), - migrations.AlterField( - model_name='comissao', - name='telefone_reuniao', - field=models.CharField(verbose_name='Tel. Sala Reunião', max_length=15, blank=True), - ), - migrations.AlterField( - model_name='comissao', - name='telefone_secretaria', - field=models.CharField(verbose_name='Tel. Secretaria', max_length=15, blank=True), - ), - migrations.AlterField( - model_name='participacao', - name='motivo_desligamento', - field=models.CharField(verbose_name='Motivo Desligamento', max_length=150, blank=True), - ), - migrations.AlterField( - model_name='participacao', - name='observacao', - field=models.CharField(verbose_name='Observação', max_length=150, blank=True), - ), - migrations.AlterField( - model_name='tipocomissao', - name='dispositivo_regimental', - field=models.CharField(verbose_name='Dispositivo Regimental', max_length=50, blank=True), - ), - ] diff --git a/sapl/comissoes/migrations/0004_auto_20160307_0905.py b/sapl/comissoes/migrations/0004_auto_20160307_0905.py deleted file mode 100644 index 0cad7d62e..000000000 --- a/sapl/comissoes/migrations/0004_auto_20160307_0905.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-07 12:05 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('comissoes', '0003_auto_20160216_1015'), - ] - - operations = [ - migrations.AlterField( - model_name='comissao', - name='email', - field=models.EmailField(blank=True, max_length=100, verbose_name='E-mail'), - ), - ] diff --git a/sapl/comissoes/migrations/0005_comissao_ativa.py b/sapl/comissoes/migrations/0005_comissao_ativa.py deleted file mode 100644 index 930bf276c..000000000 --- a/sapl/comissoes/migrations/0005_comissao_ativa.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-08-05 18:36 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('comissoes', '0004_auto_20160307_0905'), - ] - - operations = [ - migrations.AddField( - model_name='comissao', - name='ativa', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=True, verbose_name='Comissão Ativa?'), - preserve_default=False, - ), - ] diff --git a/sapl/comissoes/migrations/0006_auto_20160825_1335.py b/sapl/comissoes/migrations/0006_auto_20160825_1335.py deleted file mode 100644 index f165a94ea..000000000 --- a/sapl/comissoes/migrations/0006_auto_20160825_1335.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- 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/migrations/0006_auto_20160916_1243.py b/sapl/comissoes/migrations/0006_auto_20160916_1243.py deleted file mode 100644 index 1c5fcaa9c..000000000 --- a/sapl/comissoes/migrations/0006_auto_20160916_1243.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-16 15:43 -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=True, verbose_name='Comissão Ativa?'), - ), - ] diff --git a/sapl/comissoes/migrations/0007_merge.py b/sapl/comissoes/migrations/0007_merge.py deleted file mode 100644 index d2ed51932..000000000 --- a/sapl/comissoes/migrations/0007_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-19 15:48 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('comissoes', '0006_auto_20160916_1243'), - ('comissoes', '0006_auto_20160825_1335'), - ] - - operations = [ - ] diff --git a/sapl/comissoes/migrations/0008_auto_20160929_1611.py b/sapl/comissoes/migrations/0008_auto_20160929_1611.py deleted file mode 100644 index 5e90c95b4..000000000 --- a/sapl/comissoes/migrations/0008_auto_20160929_1611.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-29 19:11 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('comissoes', '0007_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='participacao', - name='composicao', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='participacao_set', to='comissoes.Composicao'), - ), - ] diff --git a/sapl/comissoes/migrations/0009_auto_20161011_0843.py b/sapl/comissoes/migrations/0009_auto_20161011_0843.py deleted file mode 100644 index 4fb4fde79..000000000 --- a/sapl/comissoes/migrations/0009_auto_20161011_0843.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-11 11:43 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('comissoes', '0008_auto_20160929_1611'), - ] - - operations = [ - migrations.AlterField( - model_name='participacao', - name='titular', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Titular'), - ), - ] diff --git a/sapl/comissoes/migrations/0010_auto_20170325_1052.py b/sapl/comissoes/migrations/0010_auto_20170325_1052.py deleted file mode 100644 index a1d7d5788..000000000 --- a/sapl/comissoes/migrations/0010_auto_20170325_1052.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.12 on 2017-03-25 10:52 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('comissoes', '0009_auto_20161011_0843'), - ] - - operations = [ - migrations.AlterField( - model_name='comissao', - name='tipo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.TipoComissao', verbose_name='Tipo'), - ), - migrations.AlterField( - model_name='composicao', - name='comissao', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.Comissao', verbose_name='Comissão'), - ), - migrations.AlterField( - model_name='composicao', - name='periodo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.Periodo', verbose_name='Período'), - ), - migrations.AlterField( - model_name='participacao', - name='cargo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.CargoComissao'), - ), - migrations.AlterField( - model_name='participacao', - name='composicao', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='participacao_set', to='comissoes.Composicao'), - ), - migrations.AlterField( - model_name='participacao', - name='parlamentar', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), - ), - ] diff --git a/sapl/compilacao/migrations/0001_initial.py b/sapl/compilacao/migrations/0001_initial.py index fe763b7f0..8d504bf15 100644 --- a/sapl/compilacao/migrations/0001_initial.py +++ b/sapl/compilacao/migrations/0001_initial.py @@ -1,50 +1,57 @@ # -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 11:14 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): + initial = True + dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('norma', '0003_auto_20150906_0239'), + ('contenttypes', '0002_remove_content_type_name'), ] operations = [ migrations.CreateModel( name='Dispositivo', fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('ordem', models.PositiveIntegerField(verbose_name='Ordem de Renderização', default=0)), - ('ordem_bloco_atualizador', models.PositiveIntegerField(verbose_name='Ordem de Renderização no Bloco Atualizador', default=0)), - ('nivel', models.PositiveIntegerField(blank=True, null=True, verbose_name='Nível Estrutural', default=0)), - ('dispositivo0', models.PositiveIntegerField(verbose_name='Número do Dispositivo', default=0)), - ('dispositivo1', models.PositiveIntegerField(blank=True, null=True, verbose_name='Primeiro Nível de Variação', default=0)), - ('dispositivo2', models.PositiveIntegerField(blank=True, null=True, verbose_name='Segundo Nível de Variação', default=0)), - ('dispositivo3', models.PositiveIntegerField(blank=True, null=True, verbose_name='Terceiro Nível de Variação', default=0)), - ('dispositivo4', models.PositiveIntegerField(blank=True, null=True, verbose_name='Quarto Nível de Variação', default=0)), - ('dispositivo5', models.PositiveIntegerField(blank=True, null=True, verbose_name='Quinto Nível de Variação', default=0)), - ('rotulo', models.CharField(blank=True, max_length=50, verbose_name='Rótulo', default='')), - ('texto', models.TextField(blank=True, verbose_name='Texto', default='')), - ('texto_atualizador', models.TextField(blank=True, verbose_name='Texto no Dispositivo Atualizador', default='')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created', models.DateTimeField(auto_now_add=True, verbose_name='created')), + ('modified', models.DateTimeField(auto_now=True, verbose_name='modified')), + ('ordem', models.PositiveIntegerField(default=0, verbose_name='Ordem de Renderização')), + ('ordem_bloco_atualizador', models.PositiveIntegerField(default=0, verbose_name='Ordem de Renderização no Bloco Atualizador')), + ('nivel', models.PositiveIntegerField(blank=True, default=0, null=True, verbose_name='Nível Estrutural')), + ('dispositivo0', models.PositiveIntegerField(default=0, verbose_name='Número do Dispositivo')), + ('dispositivo1', models.PositiveIntegerField(blank=True, default=0, null=True, verbose_name='Primeiro Nível de Variação')), + ('dispositivo2', models.PositiveIntegerField(blank=True, default=0, null=True, verbose_name='Segundo Nível de Variação')), + ('dispositivo3', models.PositiveIntegerField(blank=True, default=0, null=True, verbose_name='Terceiro Nível de Variação')), + ('dispositivo4', models.PositiveIntegerField(blank=True, default=0, null=True, verbose_name='Quarto Nível de Variação')), + ('dispositivo5', models.PositiveIntegerField(blank=True, default=0, null=True, verbose_name='Quinto Nível de Variação')), + ('rotulo', models.CharField(blank=True, default='', max_length=50, verbose_name='Rótulo')), + ('texto', models.TextField(blank=True, default='', verbose_name='Texto do Dispositivo')), + ('texto_atualizador', models.TextField(blank=True, default='', verbose_name='Texto do Dispositivo no Dispositivo Atualizador')), ('inicio_vigencia', models.DateField(verbose_name='Início de Vigência')), ('fim_vigencia', models.DateField(blank=True, null=True, verbose_name='Fim de Vigência')), ('inicio_eficacia', models.DateField(verbose_name='Início de Eficácia')), ('fim_eficacia', models.DateField(blank=True, null=True, verbose_name='Fim de Eficácia')), - ('inconstitucionalidade', models.BooleanField(verbose_name='Inconstitucionalidade', default=False, choices=[(True, 'Sim'), (False, 'Não')])), - ('visibilidade', models.BooleanField(verbose_name='Visibilidade na Norma Publicada', default=False, choices=[(True, 'Sim'), (False, 'Não')])), - ('timestamp', models.DateTimeField()), - ('dispositivo_atualizador', models.ForeignKey(blank=True, null=True, to='compilacao.Dispositivo', verbose_name='Dispositivo Atualizador', default=None, related_name='dispositivo_dispositivo_atualizador')), - ('dispositivo_pai', models.ForeignKey(blank=True, null=True, to='compilacao.Dispositivo', verbose_name='Dispositivo Pai', default=None, related_name='dispositivo_dispositivo_pai')), - ('dispositivo_subsequente', models.ForeignKey(blank=True, null=True, to='compilacao.Dispositivo', verbose_name='Dispositivo Subsequente', default=None, related_name='dispositivo_dispositivo_subsequente')), - ('dispositivo_substituido', models.ForeignKey(blank=True, null=True, to='compilacao.Dispositivo', verbose_name='Dispositivo Substituido', default=None, related_name='dispositivo_dispositivo_substituido')), - ('dispositivo_vigencia', models.ForeignKey(blank=True, null=True, to='compilacao.Dispositivo', verbose_name='Dispositivo de Vigência', default=None, related_name='dispositivo_dispositivo_vigencia')), - ('norma', models.ForeignKey(to='norma.NormaJuridica', verbose_name='Norma Jurídica')), - ('norma_publicada', models.ForeignKey(blank=True, null=True, to='norma.NormaJuridica', verbose_name='Norma Jurídica Publicada', default=None, related_name='dispositivo_norma_publicada')), + ('inconstitucionalidade', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Declarado Inconstitucional')), + ('auto_inserido', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Auto Inserido')), + ('visibilidade', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Visibilidade no Texto Articulado Publicado')), + ('dispositivo_de_revogacao', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Dispositivo de Revogação')), + ('dispositivo_atualizador', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='dispositivos_alterados_set', to='compilacao.Dispositivo', verbose_name='Dispositivo Atualizador')), + ('dispositivo_pai', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='dispositivos_filhos_set', to='compilacao.Dispositivo', verbose_name='Dispositivo Pai')), + ('dispositivo_subsequente', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dispositivo_subsequente_set', to='compilacao.Dispositivo', verbose_name='Dispositivo Subsequente')), + ('dispositivo_substituido', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dispositivo_substituido_set', to='compilacao.Dispositivo', verbose_name='Dispositivo Substituido')), + ('dispositivo_vigencia', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dispositivos_vigencias_set', to='compilacao.Dispositivo', verbose_name='Dispositivo de Vigência')), ], options={ + 'permissions': (('change_dispositivo_edicao_dinamica', 'Permissão de edição de dispositivos originais via editor dinâmico.'), ('change_your_dispositivo_edicao_dinamica', 'Permissão de edição de dispositivos originais via editor dinâmico desde que seja dono.'), ('change_dispositivo_edicao_avancada', 'Permissão de edição de dispositivos originais via formulários de edição avançada.'), ('change_dispositivo_registros_compilacao', 'Permissão de registro de compilação via editor dinâmico.'), ('view_dispositivo_notificacoes', 'Permissão de acesso às notificações de pendências.'), ('change_dispositivo_de_vigencia_global', 'Permissão alteração global do dispositivo de vigência')), + 'ordering': ['ta', 'ordem'], 'verbose_name': 'Dispositivo', 'verbose_name_plural': 'Dispositivos', }, @@ -52,70 +59,143 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Nota', fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('texto', models.TextField(verbose_name='Texto da Nota')), - ('url_externa', models.CharField(blank=True, max_length=1024, verbose_name='Url externa')), - ('data_criacao', models.DateTimeField(verbose_name='Data de Criação')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created', models.DateTimeField(auto_now_add=True, verbose_name='created')), + ('modified', models.DateTimeField(auto_now=True, verbose_name='modified')), + ('titulo', models.CharField(blank=True, default='', max_length=100, verbose_name='Título')), + ('texto', models.TextField(verbose_name='Texto')), + ('url_externa', models.URLField(blank=True, max_length=1024, verbose_name='Url externa')), ('publicacao', models.DateTimeField(verbose_name='Data de Publicação')), - ('efetifidade', models.DateTimeField(verbose_name='Data de Efeito')), - ('publicidade', models.PositiveSmallIntegerField(verbose_name='Nível de Publicidade', choices=[(1, 'Nota Privada'), (2, 'Nota Setorial'), (3, 'Nota Institucional'), (4, 'Nota Pública')])), - ('dispositivo', models.ForeignKey(to='compilacao.Dispositivo', verbose_name='Dispositivo da Nota')), - ('owner', models.ForeignKey(to=settings.AUTH_USER_MODEL, verbose_name='Dono da Nota')), + ('efetividade', models.DateTimeField(verbose_name='Data de Efeito')), + ('publicidade', models.PositiveSmallIntegerField(choices=[(1, 'Nota Privada'), (2, 'Nota Institucional'), (3, 'Nota Pública')], verbose_name='Nível de Publicidade')), + ('dispositivo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dispositivo_nota_set', to='compilacao.Dispositivo', verbose_name='Dispositivo da Nota')), + ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Dono da Nota')), ], options={ + 'ordering': ['-publicacao', '-modified'], 'verbose_name': 'Nota', 'verbose_name_plural': 'Notas', }, ), + migrations.CreateModel( + name='PerfilEstruturalTextoArticulado', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sigla', models.CharField(max_length=10, unique=True, verbose_name='Sigla')), + ('nome', models.CharField(max_length=50, verbose_name='Nome')), + ('padrao', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Padrão')), + ('parent', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='perfil_parent_set', to='compilacao.PerfilEstruturalTextoArticulado', verbose_name='Perfil Herdado')), + ], + options={ + 'ordering': ['-padrao', 'sigla'], + 'verbose_name': 'Perfil Estrutural de Texto Articulado', + 'verbose_name_plural': 'Perfis Estruturais de Textos Articulados', + }, + ), migrations.CreateModel( name='Publicacao', fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('publicacao', models.DateTimeField(verbose_name='Data de Publicação')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created', models.DateTimeField(auto_now_add=True, verbose_name='created')), + ('modified', models.DateTimeField(auto_now=True, verbose_name='modified')), + ('data', models.DateField(verbose_name='Data de Publicação')), + ('hora', models.TimeField(blank=True, null=True, verbose_name='Horário de Publicação')), + ('numero', models.PositiveIntegerField(blank=True, null=True, verbose_name='Número')), + ('ano', models.PositiveIntegerField(blank=True, null=True, verbose_name='Ano')), + ('edicao', models.PositiveIntegerField(blank=True, null=True, verbose_name='Edição')), + ('url_externa', models.URLField(blank=True, max_length=1024, verbose_name='Link para Versão Eletrônica')), ('pagina_inicio', models.PositiveIntegerField(blank=True, null=True, verbose_name='Pg. Início')), ('pagina_fim', models.PositiveIntegerField(blank=True, null=True, verbose_name='Pg. Fim')), - ('timestamp', models.DateTimeField()), - ('norma', models.ForeignKey(to='norma.NormaJuridica', verbose_name='Norma Jurídica')), ], options={ 'verbose_name': 'Publicação', 'verbose_name_plural': 'Publicações', }, ), + migrations.CreateModel( + name='TextoArticulado', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created', models.DateTimeField(auto_now_add=True, verbose_name='created')), + ('modified', models.DateTimeField(auto_now=True, verbose_name='modified')), + ('data', models.DateField(blank=True, null=True, verbose_name='Data')), + ('ementa', models.TextField(verbose_name='Ementa')), + ('observacao', models.TextField(blank=True, verbose_name='Observação')), + ('numero', models.PositiveIntegerField(verbose_name='Número')), + ('ano', models.PositiveSmallIntegerField(verbose_name='Ano')), + ('participacao_social', models.NullBooleanField(choices=[(None, 'Padrão definido no Tipo'), (True, 'Sim'), (False, 'Não')], default=None, verbose_name='Participação Social')), + ('object_id', models.PositiveIntegerField(blank=True, default=None, null=True)), + ('editable_only_by_owners', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=True, verbose_name='Editável apenas pelos donos do Texto Articulado')), + ('editing_locked', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=True, verbose_name='Texto Articulado em Edição')), + ('privacidade', models.IntegerField(choices=[(99, 'Privado'), (79, 'Imotável Restrito'), (69, 'Imutável Público'), (89, 'Em Edição'), (0, 'Público')], default=99, verbose_name='Privacidade')), + ('content_type', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')), + ('owners', models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL, verbose_name='Donos do Texto Articulado')), + ], + options={ + 'permissions': (('view_restricted_textoarticulado', 'Pode ver qualquer Texto Articulado'), ('lock_unlock_textoarticulado', 'Pode bloquear/desbloquear edição de Texto Articulado')), + 'ordering': ['-data', '-numero'], + 'verbose_name': 'Texto Articulado', + 'verbose_name_plural': 'Textos Articulados', + }, + ), migrations.CreateModel( name='TipoDispositivo', fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('nome', models.CharField(max_length=50, verbose_name='Nome', unique=True)), - ('class_css', models.CharField(max_length=20, verbose_name='Classe CSS')), - ('rotulo_prefixo_html', models.CharField(blank=True, max_length=100, verbose_name='Prefixo html do rótulo')), - ('rotulo_prefixo_texto', models.CharField(blank=True, max_length=30, verbose_name='Prefixo de construção do rótulo')), - ('rotulo_ordinal', models.IntegerField(verbose_name='Tipo de número do rótulo')), - ('rotulo_separadores_variacao', models.CharField(blank=True, max_length=5, verbose_name='Separadores das Variações')), - ('rotulo_sufixo_texto', models.CharField(blank=True, max_length=30, verbose_name='Sufixo de construção do rótulo')), - ('rotulo_sufixo_html', models.CharField(blank=True, max_length=100, verbose_name='Sufixo html do rótulo')), - ('texto_prefixo_html', models.CharField(blank=True, max_length=100, verbose_name='Prefixo html do texto')), - ('texto_sufixo_html', models.CharField(blank=True, max_length=100, verbose_name='Sufixo html do texto')), - ('nota_automatica_prefixo_html', models.CharField(blank=True, max_length=100, verbose_name='Prefixo html da nota automática')), - ('nota_automatica_sufixo_html', models.CharField(blank=True, max_length=100, verbose_name='Sufixo html da nota automática')), - ('contagem_continua', models.BooleanField(verbose_name='Contagem contínua', choices=[(True, 'Sim'), (False, 'Não')])), - ('formato_variacao0', models.CharField(max_length=1, verbose_name='Formato da Numeração', default='1', choices=[('1', '(1) Numérico'), ('I', '(I) Romano Maiúsculo'), ('i', '(i) Romano Minúsculo'), ('A', '(A) Alfabético Maiúsculo'), ('a', '(a) Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')])), - ('formato_variacao1', models.CharField(max_length=1, verbose_name='Formato da Variação 1', default='1', choices=[('1', '(1) Numérico'), ('I', '(I) Romano Maiúsculo'), ('i', '(i) Romano Minúsculo'), ('A', '(A) Alfabético Maiúsculo'), ('a', '(a) Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')])), - ('formato_variacao2', models.CharField(max_length=1, verbose_name='Formato da Variação 2', default='1', choices=[('1', '(1) Numérico'), ('I', '(I) Romano Maiúsculo'), ('i', '(i) Romano Minúsculo'), ('A', '(A) Alfabético Maiúsculo'), ('a', '(a) Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')])), - ('formato_variacao3', models.CharField(max_length=1, verbose_name='Formato da Variação 3', default='1', choices=[('1', '(1) Numérico'), ('I', '(I) Romano Maiúsculo'), ('i', '(i) Romano Minúsculo'), ('A', '(A) Alfabético Maiúsculo'), ('a', '(a) Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')])), - ('formato_variacao4', models.CharField(max_length=1, verbose_name='Formato da Variação 4', default='1', choices=[('1', '(1) Numérico'), ('I', '(I) Romano Maiúsculo'), ('i', '(i) Romano Minúsculo'), ('A', '(A) Alfabético Maiúsculo'), ('a', '(a) Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')])), - ('formato_variacao5', models.CharField(max_length=1, verbose_name='Formato da Variação 5', default='1', choices=[('1', '(1) Numérico'), ('I', '(I) Romano Maiúsculo'), ('i', '(i) Romano Minúsculo'), ('A', '(A) Alfabético Maiúsculo'), ('a', '(a) Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')])), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('nome', models.CharField(max_length=50, unique=True, verbose_name='Nome')), + ('class_css', models.CharField(blank=True, max_length=20, verbose_name='Classe CSS')), + ('rotulo_prefixo_html', models.TextField(blank=True, verbose_name='Prefixo html do rótulo')), + ('rotulo_prefixo_texto', models.TextField(blank=True, verbose_name='Prefixo de Edição do rótulo')), + ('rotulo_ordinal', models.IntegerField(choices=[(0, 'Numeração Cardinal.'), (-1, 'Numeração Ordinal.'), (9, 'Numeração Ordinal até o item nove.')], verbose_name='Tipo de número do rótulo')), + ('rotulo_separador_variacao01', models.CharField(default='-', max_length=1, verbose_name='Separador entre Numeração e Variação 1')), + ('rotulo_separador_variacao12', models.CharField(default='-', max_length=1, verbose_name='Separador entre Variação 1 e Variação 2')), + ('rotulo_separador_variacao23', models.CharField(default='-', max_length=1, verbose_name='Separador entre Variação 2 e Variação 3')), + ('rotulo_separador_variacao34', models.CharField(default='-', max_length=1, verbose_name='Separador entre Variação 3 e Variação 4')), + ('rotulo_separador_variacao45', models.CharField(default='-', max_length=1, verbose_name='Separador entre Variação 4 e Variação 5')), + ('rotulo_sufixo_texto', models.TextField(blank=True, verbose_name='Sufixo de Edição do rótulo')), + ('rotulo_sufixo_html', models.TextField(blank=True, verbose_name='Sufixo html do rótulo')), + ('texto_prefixo_html', models.TextField(blank=True, verbose_name='Prefixo html do texto')), + ('texto_sufixo_html', models.TextField(blank=True, verbose_name='Sufixo html do texto')), + ('nota_automatica_prefixo_html', models.TextField(blank=True, verbose_name='Prefixo html da nota automática')), + ('nota_automatica_sufixo_html', models.TextField(blank=True, verbose_name='Sufixo html da nota automática')), + ('contagem_continua', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Contagem contínua')), + ('dispositivo_de_articulacao', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Dispositivo de Articulação (Sem Texto)')), + ('dispositivo_de_alteracao', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Dispositivo de Alteração')), + ('formato_variacao0', models.CharField(choices=[('1', '1-Numérico'), ('I', 'I-Romano Maiúsculo'), ('i', 'i-Romano Minúsculo'), ('A', 'A-Alfabético Maiúsculo'), ('a', 'a-Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')], default='1', max_length=1, verbose_name='Formato da Numeração')), + ('formato_variacao1', models.CharField(choices=[('1', '1-Numérico'), ('I', 'I-Romano Maiúsculo'), ('i', 'i-Romano Minúsculo'), ('A', 'A-Alfabético Maiúsculo'), ('a', 'a-Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')], default='1', max_length=1, verbose_name='Formato da Variação 1')), + ('formato_variacao2', models.CharField(choices=[('1', '1-Numérico'), ('I', 'I-Romano Maiúsculo'), ('i', 'i-Romano Minúsculo'), ('A', 'A-Alfabético Maiúsculo'), ('a', 'a-Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')], default='1', max_length=1, verbose_name='Formato da Variação 2')), + ('formato_variacao3', models.CharField(choices=[('1', '1-Numérico'), ('I', 'I-Romano Maiúsculo'), ('i', 'i-Romano Minúsculo'), ('A', 'A-Alfabético Maiúsculo'), ('a', 'a-Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')], default='1', max_length=1, verbose_name='Formato da Variação 3')), + ('formato_variacao4', models.CharField(choices=[('1', '1-Numérico'), ('I', 'I-Romano Maiúsculo'), ('i', 'i-Romano Minúsculo'), ('A', 'A-Alfabético Maiúsculo'), ('a', 'a-Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')], default='1', max_length=1, verbose_name='Formato da Variação 4')), + ('formato_variacao5', models.CharField(choices=[('1', '1-Numérico'), ('I', 'I-Romano Maiúsculo'), ('i', 'i-Romano Minúsculo'), ('A', 'A-Alfabético Maiúsculo'), ('a', 'a-Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')], default='1', max_length=1, verbose_name='Formato da Variação 5')), ], options={ + 'ordering': ['id'], 'verbose_name': 'Tipo de Dispositivo', 'verbose_name_plural': 'Tipos de Dispositivo', }, ), + migrations.CreateModel( + name='TipoDispositivoRelationship', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('filho_de_insercao_automatica', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Filho de Inserção Automática')), + ('permitir_variacao', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=True, verbose_name='Permitir Variação Numérica')), + ('quantidade_permitida', models.IntegerField(default=-1, verbose_name='Quantidade permitida nesta relação')), + ('filho_permitido', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='possiveis_pais', to='compilacao.TipoDispositivo')), + ('pai', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='filhos_permitidos', to='compilacao.TipoDispositivo')), + ('perfil', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='compilacao.PerfilEstruturalTextoArticulado')), + ], + options={ + 'ordering': ['pai', 'filho_permitido'], + 'verbose_name': 'Relação Direta Permitida', + 'verbose_name_plural': 'Relaçõe Diretas Permitidas', + }, + ), migrations.CreateModel( name='TipoNota', fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('sigla', models.CharField(max_length=10, verbose_name='Sigla', unique=True)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sigla', models.CharField(max_length=10, unique=True, verbose_name='Sigla')), ('nome', models.CharField(max_length=50, verbose_name='Nome')), ('modelo', models.TextField(blank=True, verbose_name='Modelo')), ], @@ -127,8 +207,8 @@ class Migration(migrations.Migration): migrations.CreateModel( name='TipoPublicacao', fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('sigla', models.CharField(max_length=10, verbose_name='Sigla', unique=True)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sigla', models.CharField(max_length=10, unique=True, verbose_name='Sigla')), ('nome', models.CharField(max_length=50, verbose_name='Nome')), ], options={ @@ -136,11 +216,27 @@ class Migration(migrations.Migration): 'verbose_name_plural': 'Tipos de Publicação', }, ), + migrations.CreateModel( + name='TipoTextoArticulado', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sigla', models.CharField(max_length=3, verbose_name='Sigla')), + ('descricao', models.CharField(max_length=50, verbose_name='Descrição')), + ('participacao_social', models.NullBooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Participação Social')), + ('publicacao_func', models.NullBooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Histórico de Publicação')), + ('content_type', models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType', verbose_name='Modelo Integrado')), + ('perfis', models.ManyToManyField(blank=True, help_text='\n Apenas os perfis selecionados aqui estarão disponíveis\n para o editor de Textos Articulados cujo Tipo seja este\n em edição.\n ', to='compilacao.PerfilEstruturalTextoArticulado', verbose_name='Perfis Estruturais de Textos Articulados')), + ], + options={ + 'verbose_name': 'Tipo de Texto Articulado', + 'verbose_name_plural': 'Tipos de Texto Articulados', + }, + ), migrations.CreateModel( name='TipoVide', fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('sigla', models.CharField(max_length=10, verbose_name='Sigla', unique=True)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sigla', models.CharField(max_length=10, unique=True, verbose_name='Sigla')), ('nome', models.CharField(max_length=50, verbose_name='Nome')), ], options={ @@ -151,8 +247,8 @@ class Migration(migrations.Migration): migrations.CreateModel( name='VeiculoPublicacao', fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('sigla', models.CharField(max_length=10, verbose_name='Sigla', unique=True)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sigla', models.CharField(max_length=10, unique=True, verbose_name='Sigla')), ('nome', models.CharField(max_length=60, verbose_name='Nome')), ], options={ @@ -163,45 +259,79 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Vide', fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('data_criacao', models.DateTimeField(verbose_name='Data de Criação')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created', models.DateTimeField(auto_now_add=True, verbose_name='created')), + ('modified', models.DateTimeField(auto_now=True, verbose_name='modified')), ('texto', models.TextField(verbose_name='Texto do Vide')), - ('dispositivo_base', models.ForeignKey(to='compilacao.Dispositivo', verbose_name='Dispositivo Base', related_name='vide_dispositivo_base')), - ('dispositivo_ref', models.ForeignKey(to='compilacao.Dispositivo', verbose_name='Dispositivo Referido', related_name='vide_dispositivo_ref')), - ('tipo', models.ForeignKey(to='compilacao.TipoVide', verbose_name='Tipo do Vide')), + ('dispositivo_base', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dispositivo_base_set', to='compilacao.Dispositivo', verbose_name='Dispositivo Base')), + ('dispositivo_ref', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dispositivo_citado_set', to='compilacao.Dispositivo', verbose_name='Dispositivo Referido')), + ('tipo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='compilacao.TipoVide', verbose_name='Tipo do Vide')), ], options={ 'verbose_name': 'Vide', 'verbose_name_plural': 'Vides', }, ), + migrations.AddField( + model_name='tipodispositivo', + name='relacoes_diretas_pai_filho', + field=models.ManyToManyField(related_name='relacaoes_pai_filho', through='compilacao.TipoDispositivoRelationship', to='compilacao.TipoDispositivo'), + ), + migrations.AddField( + model_name='textoarticulado', + name='tipo_ta', + field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='compilacao.TipoTextoArticulado', verbose_name='Tipo de Texto Articulado'), + ), + migrations.AddField( + model_name='publicacao', + name='ta', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='compilacao.TextoArticulado', verbose_name='Texto Articulado'), + ), migrations.AddField( model_name='publicacao', name='tipo_publicacao', - field=models.ForeignKey(to='compilacao.TipoPublicacao', verbose_name='Tipo de Publicação'), + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='compilacao.TipoPublicacao', verbose_name='Tipo de Publicação'), ), migrations.AddField( model_name='publicacao', name='veiculo_publicacao', - field=models.ForeignKey(to='compilacao.VeiculoPublicacao', verbose_name='Veículo de Publicação'), + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='compilacao.VeiculoPublicacao', verbose_name='Veículo de Publicação'), ), migrations.AddField( model_name='nota', name='tipo', - field=models.ForeignKey(to='compilacao.TipoNota', verbose_name='Tipo da Nota'), + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='compilacao.TipoNota', verbose_name='Tipo da Nota'), ), migrations.AddField( model_name='dispositivo', name='publicacao', - field=models.ForeignKey(blank=True, null=True, to='compilacao.Publicacao', verbose_name='Publicação', default=None), + field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='compilacao.Publicacao', verbose_name='Publicação'), + ), + migrations.AddField( + model_name='dispositivo', + name='ta', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dispositivos_set', to='compilacao.TextoArticulado', verbose_name='Texto Articulado'), + ), + migrations.AddField( + model_name='dispositivo', + name='ta_publicado', + field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='dispositivos_alterados_pelo_ta_set', to='compilacao.TextoArticulado', verbose_name='Texto Articulado Publicado'), ), migrations.AddField( model_name='dispositivo', name='tipo_dispositivo', - field=models.ForeignKey(to='compilacao.TipoDispositivo', verbose_name='Tipo do Dispositivo'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='dispositivos_do_tipo_set', to='compilacao.TipoDispositivo', verbose_name='Tipo do Dispositivo'), + ), + migrations.AlterUniqueTogether( + name='vide', + unique_together=set([('dispositivo_base', 'dispositivo_ref', 'tipo')]), + ), + migrations.AlterUniqueTogether( + name='tipodispositivorelationship', + unique_together=set([('pai', 'filho_permitido', 'perfil')]), ), migrations.AlterUniqueTogether( name='dispositivo', - unique_together=set([('norma', 'dispositivo0', 'dispositivo1', 'dispositivo2', 'dispositivo3', 'dispositivo4', 'dispositivo5', 'tipo_dispositivo', 'dispositivo_pai', 'publicacao'), ('norma', 'ordem')]), + unique_together=set([('ta', 'dispositivo0', 'dispositivo1', 'dispositivo2', 'dispositivo3', 'dispositivo4', 'dispositivo5', 'tipo_dispositivo', 'dispositivo_pai', 'dispositivo_atualizador', 'ta_publicado', 'publicacao'), ('ta', 'ordem')]), ), ] diff --git a/sapl/compilacao/migrations/0002_auto_20150907_2334.py b/sapl/compilacao/migrations/0002_auto_20150907_2334.py deleted file mode 100644 index da10519c5..000000000 --- a/sapl/compilacao/migrations/0002_auto_20150907_2334.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0001_initial'), - ] - - operations = [ - migrations.AlterModelOptions( - name='dispositivo', - options={'ordering': ['norma', 'ordem'], 'verbose_name_plural': 'Dispositivos', 'verbose_name': 'Dispositivo'}, - ), - migrations.AlterField( - model_name='dispositivo', - name='dispositivo_atualizador', - field=models.ForeignKey(related_name='dispositivos_alterados_set', to='compilacao.Dispositivo', null=True, verbose_name='Dispositivo Atualizador', default=None, blank=True), - ), - migrations.AlterField( - model_name='dispositivo', - name='dispositivo_pai', - field=models.ForeignKey(related_name='+', to='compilacao.Dispositivo', null=True, verbose_name='Dispositivo Pai', default=None, blank=True), - ), - migrations.AlterField( - model_name='dispositivo', - name='dispositivo_subsequente', - field=models.ForeignKey(related_name='+', to='compilacao.Dispositivo', null=True, verbose_name='Dispositivo Subsequente', default=None, blank=True), - ), - migrations.AlterField( - model_name='dispositivo', - name='dispositivo_substituido', - field=models.ForeignKey(related_name='+', to='compilacao.Dispositivo', null=True, verbose_name='Dispositivo Substituido', default=None, blank=True), - ), - migrations.AlterField( - model_name='dispositivo', - name='dispositivo_vigencia', - field=models.ForeignKey(related_name='+', to='compilacao.Dispositivo', null=True, verbose_name='Dispositivo de Vigência', default=None, blank=True), - ), - migrations.AlterField( - model_name='dispositivo', - name='norma_publicada', - field=models.ForeignKey(related_name='dispositivos_alterados_set', to='norma.NormaJuridica', null=True, verbose_name='Norma Jurídica Publicada', default=None, blank=True), - ), - ] diff --git a/sapl/compilacao/migrations/0003_auto_20150911_1735.py b/sapl/compilacao/migrations/0003_auto_20150911_1735.py deleted file mode 100644 index 67ae645a6..000000000 --- a/sapl/compilacao/migrations/0003_auto_20150911_1735.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0002_auto_20150907_2334'), - ] - - operations = [ - migrations.AlterField( - model_name='dispositivo', - name='dispositivo_pai', - field=models.ForeignKey(blank=True, null=True, verbose_name='Dispositivo Pai', to='compilacao.Dispositivo', related_name='filhos', default=None), - ), - ] diff --git a/sapl/compilacao/migrations/0004_auto_20150914_0842.py b/sapl/compilacao/migrations/0004_auto_20150914_0842.py deleted file mode 100644 index a871bcc07..000000000 --- a/sapl/compilacao/migrations/0004_auto_20150914_0842.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0003_auto_20150911_1735'), - ] - - operations = [ - migrations.AlterField( - model_name='dispositivo', - name='dispositivo_pai', - field=models.ForeignKey(to='compilacao.Dispositivo', verbose_name='Dispositivo Pai', blank=True, related_name='dispositivos_filhos_set', null=True, default=None), - ), - migrations.AlterField( - model_name='dispositivo', - name='norma', - field=models.ForeignKey(related_name='dispositivos_set', to='norma.NormaJuridica', verbose_name='Norma Jurídica'), - ), - migrations.AlterField( - model_name='dispositivo', - name='norma_publicada', - field=models.ForeignKey(to='norma.NormaJuridica', verbose_name='Norma Jurídica Publicada', blank=True, related_name='dispositivos_alterados_pela_norma_set', null=True, default=None), - ), - migrations.AlterField( - model_name='dispositivo', - name='tipo_dispositivo', - field=models.ForeignKey(related_name='dispositivos_do_tipo_set', to='compilacao.TipoDispositivo', verbose_name='Tipo do Dispositivo'), - ), - ] diff --git a/sapl/compilacao/migrations/0005_auto_20150924_1012.py b/sapl/compilacao/migrations/0005_auto_20150924_1012.py deleted file mode 100644 index 3e4dbe625..000000000 --- a/sapl/compilacao/migrations/0005_auto_20150924_1012.py +++ /dev/null @@ -1,77 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0004_auto_20150914_0842'), - ] - - operations = [ - migrations.AlterModelOptions( - name='tipodispositivo', - options={'verbose_name_plural': 'Tipos de Dispositivo', 'verbose_name': 'Tipo de Dispositivo', 'ordering': ['id']}, - ), - migrations.RemoveField( - model_name='tipodispositivo', - name='rotulo_separadores_variacao', - ), - migrations.AddField( - model_name='tipodispositivo', - name='rotulo_separador_variacao01', - field=models.CharField(max_length=1, default='-', verbose_name='Separadores entre Numeração e Variação 1', blank=True), - ), - migrations.AddField( - model_name='tipodispositivo', - name='rotulo_separador_variacao12', - field=models.CharField(max_length=1, default='-', verbose_name='Separadores entre Variação 1 e Variação 2', blank=True), - ), - migrations.AddField( - model_name='tipodispositivo', - name='rotulo_separador_variacao23', - field=models.CharField(max_length=1, default='-', verbose_name='Separadores entre Variação 2 e Variação 3', blank=True), - ), - migrations.AddField( - model_name='tipodispositivo', - name='rotulo_separador_variacao34', - field=models.CharField(max_length=1, default='-', verbose_name='Separadores entre Variação 3 e Variação 4', blank=True), - ), - migrations.AddField( - model_name='tipodispositivo', - name='rotulo_separador_variacao45', - field=models.CharField(max_length=1, default='-', verbose_name='Separadores entre Variação 4 e Variação 5', blank=True), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='formato_variacao0', - field=models.CharField(max_length=1, default='1', choices=[('1', '1-Numérico'), ('I', 'I-Romano Maiúsculo'), ('i', 'i-Romano Minúsculo'), ('A', 'A-Alfabético Maiúsculo'), ('a', 'a-Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')], verbose_name='Formato da Numeração'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='formato_variacao1', - field=models.CharField(max_length=1, default='1', choices=[('1', '1-Numérico'), ('I', 'I-Romano Maiúsculo'), ('i', 'i-Romano Minúsculo'), ('A', 'A-Alfabético Maiúsculo'), ('a', 'a-Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')], verbose_name='Formato da Variação 1'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='formato_variacao2', - field=models.CharField(max_length=1, default='1', choices=[('1', '1-Numérico'), ('I', 'I-Romano Maiúsculo'), ('i', 'i-Romano Minúsculo'), ('A', 'A-Alfabético Maiúsculo'), ('a', 'a-Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')], verbose_name='Formato da Variação 2'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='formato_variacao3', - field=models.CharField(max_length=1, default='1', choices=[('1', '1-Numérico'), ('I', 'I-Romano Maiúsculo'), ('i', 'i-Romano Minúsculo'), ('A', 'A-Alfabético Maiúsculo'), ('a', 'a-Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')], verbose_name='Formato da Variação 3'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='formato_variacao4', - field=models.CharField(max_length=1, default='1', choices=[('1', '1-Numérico'), ('I', 'I-Romano Maiúsculo'), ('i', 'i-Romano Minúsculo'), ('A', 'A-Alfabético Maiúsculo'), ('a', 'a-Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')], verbose_name='Formato da Variação 4'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='formato_variacao5', - field=models.CharField(max_length=1, default='1', choices=[('1', '1-Numérico'), ('I', 'I-Romano Maiúsculo'), ('i', 'i-Romano Minúsculo'), ('A', 'A-Alfabético Maiúsculo'), ('a', 'a-Alfabético Minúsculo'), ('*', 'Tópico - Sem contagem'), ('N', 'Sem renderização')], verbose_name='Formato da Variação 5'), - ), - ] diff --git a/sapl/compilacao/migrations/0006_auto_20150924_1121.py b/sapl/compilacao/migrations/0006_auto_20150924_1121.py deleted file mode 100644 index a27cddf2b..000000000 --- a/sapl/compilacao/migrations/0006_auto_20150924_1121.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0005_auto_20150924_1012'), - ] - - operations = [ - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_ordinal', - field=models.IntegerField(choices=[(-1, 'Numeração Cardinal.'), (0, 'Numeração Ordinal.'), (9, 'Numeração Ordinal até o item nove.')], verbose_name='Tipo de número do rótulo'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_prefixo_texto', - field=models.CharField(blank=True, max_length=30, verbose_name='Prefixo de Edição do rótulo'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_separador_variacao01', - field=models.CharField(blank=True, default='-', max_length=1, verbose_name='Separador entre Numeração e Variação 1'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_separador_variacao12', - field=models.CharField(blank=True, default='-', max_length=1, verbose_name='Separador entre Variação 1 e Variação 2'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_separador_variacao23', - field=models.CharField(blank=True, default='-', max_length=1, verbose_name='Separador entre Variação 2 e Variação 3'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_separador_variacao34', - field=models.CharField(blank=True, default='-', max_length=1, verbose_name='Separador entre Variação 3 e Variação 4'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_separador_variacao45', - field=models.CharField(blank=True, default='-', max_length=1, verbose_name='Separador entre Variação 4 e Variação 5'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_sufixo_texto', - field=models.CharField(blank=True, max_length=30, verbose_name='Sufixo de Edição do rótulo'), - ), - ] diff --git a/sapl/compilacao/migrations/0007_auto_20150924_1131.py b/sapl/compilacao/migrations/0007_auto_20150924_1131.py deleted file mode 100644 index 56d0bcc25..000000000 --- a/sapl/compilacao/migrations/0007_auto_20150924_1131.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0006_auto_20150924_1121'), - ] - - operations = [ - migrations.AlterField( - model_name='tipodispositivo', - name='class_css', - field=models.CharField(max_length=20, blank=True, verbose_name='Classe CSS'), - ), - ] diff --git a/sapl/compilacao/migrations/0008_auto_20151005_1023.py b/sapl/compilacao/migrations/0008_auto_20151005_1023.py deleted file mode 100644 index 995d4d9e1..000000000 --- a/sapl/compilacao/migrations/0008_auto_20151005_1023.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0007_auto_20150924_1131'), - ] - - operations = [ - migrations.AddField( - model_name='tipodispositivo', - name='dispositivo_de_articulacao', - field=models.BooleanField(verbose_name='Dispositivo de Articulação (Sem Texto)', default=False, choices=[ - (True, 'Sim'), (False, 'Não')]), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_separador_variacao01', - field=models.CharField( - verbose_name='Separador entre Numeração e Variação 1', default='-', max_length=1), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_separador_variacao12', - field=models.CharField( - verbose_name='Separador entre Variação 1 e Variação 2', default='-', max_length=1), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_separador_variacao23', - field=models.CharField( - verbose_name='Separador entre Variação 2 e Variação 3', default='-', max_length=1), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_separador_variacao34', - field=models.CharField( - verbose_name='Separador entre Variação 3 e Variação 4', default='-', max_length=1), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_separador_variacao45', - field=models.CharField( - verbose_name='Separador entre Variação 4 e Variação 5', default='-', max_length=1), - ), - ] diff --git a/sapl/compilacao/migrations/0009_auto_20151007_1635.py b/sapl/compilacao/migrations/0009_auto_20151007_1635.py deleted file mode 100644 index 1fbc966c8..000000000 --- a/sapl/compilacao/migrations/0009_auto_20151007_1635.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0008_auto_20151005_1023'), - ] - - operations = [ - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_ordinal', - field=models.IntegerField(choices=[(0, 'Numeração Cardinal.'), (-1, 'Numeração Ordinal.'), (9, 'Numeração Ordinal até o item nove.')], verbose_name='Tipo de número do rótulo'), - ), - migrations.AlterUniqueTogether( - name='dispositivo', - unique_together=set([('norma', 'ordem'), ('norma', 'dispositivo0', 'dispositivo1', 'dispositivo2', 'dispositivo3', 'dispositivo4', 'dispositivo5', 'tipo_dispositivo', 'dispositivo_pai', 'norma_publicada', 'publicacao')]), - ), - ] diff --git a/sapl/compilacao/migrations/0010_auto_20151105_1532.py b/sapl/compilacao/migrations/0010_auto_20151105_1532.py deleted file mode 100644 index 3a84ae475..000000000 --- a/sapl/compilacao/migrations/0010_auto_20151105_1532.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0009_auto_20151007_1635'), - ] - - operations = [ - migrations.CreateModel( - name='TipoDispositivoRelationship', - fields=[ - ('id', models.AutoField(verbose_name='ID', auto_created=True, primary_key=True, serialize=False)), - ('filho_permitido', models.ForeignKey(related_name='filho_permitido', to='compilacao.TipoDispositivo')), - ('pai', models.ForeignKey(related_name='pai', to='compilacao.TipoDispositivo')), - ], - options={ - 'abstract': False, - }, - ), - migrations.AddField( - model_name='tipodispositivo', - name='relacoes_diretas_pai_filho', - field=models.ManyToManyField(related_name='filhos_permitidos', through='compilacao.TipoDispositivoRelationship', to='compilacao.TipoDispositivo'), - ), - ] diff --git a/sapl/compilacao/migrations/0011_auto_20151105_1540.py b/sapl/compilacao/migrations/0011_auto_20151105_1540.py deleted file mode 100644 index 4c4e0f0f3..000000000 --- a/sapl/compilacao/migrations/0011_auto_20151105_1540.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0010_auto_20151105_1532'), - ] - - operations = [ - migrations.AlterModelOptions( - name='tipodispositivorelationship', - options={'verbose_name': 'Relação Direta Permitida', 'verbose_name_plural': 'Relaçõe Diretas Permitidas', 'ordering': ['pai', 'filho_permitido']}, - ), - migrations.AlterField( - model_name='tipodispositivorelationship', - name='filho_permitido', - field=models.ForeignKey(null=True, to='compilacao.TipoDispositivo', blank=True, default=None, related_name='filho_permitido'), - ), - migrations.AlterUniqueTogether( - name='tipodispositivorelationship', - unique_together=set([('pai', 'filho_permitido')]), - ), - ] diff --git a/sapl/compilacao/migrations/0012_auto_20151105_1658.py b/sapl/compilacao/migrations/0012_auto_20151105_1658.py deleted file mode 100644 index 5ac6c1788..000000000 --- a/sapl/compilacao/migrations/0012_auto_20151105_1658.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0011_auto_20151105_1540'), - ] - - operations = [ - migrations.AddField( - model_name='tipodispositivorelationship', - name='filho_de_insercao_automatica', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Filho de Inserção Automática'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='relacoes_diretas_pai_filho', - field=models.ManyToManyField(to='compilacao.TipoDispositivo', related_name='possiveis_pais', through='compilacao.TipoDispositivoRelationship'), - ), - migrations.AlterField( - model_name='tipodispositivorelationship', - name='filho_permitido', - field=models.ForeignKey(blank=True, default=None, null=True, related_name='pais', to='compilacao.TipoDispositivo'), - ), - migrations.AlterField( - model_name='tipodispositivorelationship', - name='pai', - field=models.ForeignKey(to='compilacao.TipoDispositivo', related_name='filhos_permitidos'), - ), - ] diff --git a/sapl/compilacao/migrations/0013_auto_20151106_1843.py b/sapl/compilacao/migrations/0013_auto_20151106_1843.py deleted file mode 100644 index 5786877e7..000000000 --- a/sapl/compilacao/migrations/0013_auto_20151106_1843.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0012_auto_20151105_1658'), - ] - - operations = [ - migrations.AlterField( - model_name='tipodispositivo', - name='relacoes_diretas_pai_filho', - field=models.ManyToManyField(to='compilacao.TipoDispositivo', related_name='_relacoes_diretas_pai_filho_+', through='compilacao.TipoDispositivoRelationship'), - ), - migrations.AlterField( - model_name='tipodispositivorelationship', - name='filho_permitido', - field=models.ForeignKey(null=True, blank=True, related_name='possiveis_pais', to='compilacao.TipoDispositivo', default=None), - ), - ] diff --git a/sapl/compilacao/migrations/0014_auto_20151107_1836.py b/sapl/compilacao/migrations/0014_auto_20151107_1836.py deleted file mode 100644 index 1e1cf3138..000000000 --- a/sapl/compilacao/migrations/0014_auto_20151107_1836.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0013_auto_20151106_1843'), - ] - - operations = [ - migrations.AddField( - model_name='tipodispositivo', - name='quantidade_permitida', - field=models.IntegerField(default=-1, verbose_name='Quantidade permitida dentro de uma Norma'), - ), - ] diff --git a/sapl/compilacao/migrations/0015_auto_20151115_2310.py b/sapl/compilacao/migrations/0015_auto_20151115_2310.py deleted file mode 100644 index e0ec8b9e6..000000000 --- a/sapl/compilacao/migrations/0015_auto_20151115_2310.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0014_auto_20151107_1836'), - ] - - operations = [ - migrations.AddField( - model_name='tipodispositivo', - name='dispositivo_de_alteracao', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Dispositivo de Alteração'), - ), - migrations.AlterField( - model_name='tipodispositivorelationship', - name='filho_permitido', - field=models.ForeignKey(related_name='possiveis_pais', to='compilacao.TipoDispositivo'), - ), - ] diff --git a/sapl/compilacao/migrations/0016_auto_20151119_0950.py b/sapl/compilacao/migrations/0016_auto_20151119_0950.py deleted file mode 100644 index 807940b86..000000000 --- a/sapl/compilacao/migrations/0016_auto_20151119_0950.py +++ /dev/null @@ -1,49 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import datetime - -from django.db import migrations, models -from django.utils.timezone import utc - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0015_auto_20151115_2310'), - ] - - operations = [ - migrations.CreateModel( - name='PerfilEstruturalTextosNormativos', - fields=[ - ('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')), - ('nome', models.CharField(max_length=50, verbose_name='Nome')), - ], - options={ - 'verbose_name_plural': 'Perfis Estruturais de Textos Normativos', - 'verbose_name': 'Perfil Estrutural de Textos Normativos', - }, - ), - migrations.RemoveField( - model_name='dispositivo', - name='timestamp', - ), - migrations.AddField( - model_name='dispositivo', - name='created', - field=models.DateTimeField(default=datetime.datetime(2015, 11, 19, 11, 49, 55, 455058, tzinfo=utc), auto_now_add=True, verbose_name='created'), - preserve_default=False, - ), - migrations.AddField( - model_name='dispositivo', - name='modified', - field=models.DateTimeField(auto_now=True, default=datetime.datetime(2015, 11, 19, 11, 50, 5, 86839, tzinfo=utc), verbose_name='modified'), - preserve_default=False, - ), - migrations.AddField( - model_name='tipodispositivorelationship', - name='perfil', - field=models.ForeignKey(blank=True, related_name='+', null=True, default=None, to='compilacao.PerfilEstruturalTextosNormativos'), - ), - ] diff --git a/sapl/compilacao/migrations/0017_auto_20151119_1035.py b/sapl/compilacao/migrations/0017_auto_20151119_1035.py deleted file mode 100644 index 8a902b838..000000000 --- a/sapl/compilacao/migrations/0017_auto_20151119_1035.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0016_auto_20151119_0950'), - ] - - operations = [ - migrations.AddField( - model_name='perfilestruturaltextosnormativos', - name='padrao', - field=models.BooleanField(verbose_name='Padrão', choices=[(True, 'Sim'), (False, 'Não')], default=False), - ), - migrations.AlterField( - model_name='tipodispositivorelationship', - name='perfil', - field=models.ForeignKey(to='compilacao.PerfilEstruturalTextosNormativos'), - ), - migrations.AlterUniqueTogether( - name='tipodispositivorelationship', - unique_together=set([('pai', 'filho_permitido', 'perfil')]), - ), - ] diff --git a/sapl/compilacao/migrations/0018_auto_20151119_1052.py b/sapl/compilacao/migrations/0018_auto_20151119_1052.py deleted file mode 100644 index 00e78daef..000000000 --- a/sapl/compilacao/migrations/0018_auto_20151119_1052.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0017_auto_20151119_1035'), - ] - - operations = [ - migrations.RemoveField( - model_name='tipodispositivo', - name='quantidade_permitida', - ), - migrations.AddField( - model_name='tipodispositivorelationship', - name='quantidade_permitida', - field=models.IntegerField(default=-1, verbose_name='Quantidade permitida nesta relação'), - ), - ] diff --git a/sapl/compilacao/migrations/0019_auto_20151119_1120.py b/sapl/compilacao/migrations/0019_auto_20151119_1120.py deleted file mode 100644 index f5a461faf..000000000 --- a/sapl/compilacao/migrations/0019_auto_20151119_1120.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0018_auto_20151119_1052'), - ] - - operations = [ - migrations.AddField( - model_name='perfilestruturaltextosnormativos', - name='sigla', - field=models.CharField(max_length=10, verbose_name='Sigla', default='LC95'), - preserve_default=False, - ), - ] diff --git a/sapl/compilacao/migrations/0020_auto_20151119_1126.py b/sapl/compilacao/migrations/0020_auto_20151119_1126.py deleted file mode 100644 index d63e4c8d2..000000000 --- a/sapl/compilacao/migrations/0020_auto_20151119_1126.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0019_auto_20151119_1120'), - ] - - operations = [ - migrations.AlterField( - model_name='perfilestruturaltextosnormativos', - name='sigla', - field=models.CharField( - max_length=10, verbose_name='Sigla', unique=True), - ), - ] diff --git a/sapl/compilacao/migrations/0021_auto_20151119_1617.py b/sapl/compilacao/migrations/0021_auto_20151119_1617.py deleted file mode 100644 index e378f4a60..000000000 --- a/sapl/compilacao/migrations/0021_auto_20151119_1617.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0020_auto_20151119_1126'), - ] - - operations = [ - migrations.AlterModelOptions( - name='perfilestruturaltextosnormativos', - options={'verbose_name': 'Perfil Estrutural de Textos Normativos', 'verbose_name_plural': 'Perfis Estruturais de Textos Normativos', 'ordering': ['-padrao', 'sigla']}, - ), - migrations.AddField( - model_name='tipodispositivorelationship', - name='permitir_variacao', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Permitir Variação Numérica', default=True), - ), - ] diff --git a/sapl/compilacao/migrations/0022_auto_20151120_1503.py b/sapl/compilacao/migrations/0022_auto_20151120_1503.py deleted file mode 100644 index 15eee6015..000000000 --- a/sapl/compilacao/migrations/0022_auto_20151120_1503.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import datetime - -from django.db import migrations, models -from django.utils.timezone import utc - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0021_auto_20151119_1617'), - ] - - operations = [ - migrations.RemoveField( - model_name='publicacao', - name='timestamp', - ), - migrations.AddField( - model_name='publicacao', - name='created', - field=models.DateTimeField(verbose_name='created', auto_now_add=True, default=datetime.datetime(2015, 11, 20, 17, 3, 45, 347063, tzinfo=utc)), - preserve_default=False, - ), - migrations.AddField( - model_name='publicacao', - name='modified', - field=models.DateTimeField(verbose_name='modified', default=datetime.datetime(2015, 11, 20, 17, 3, 51, 67108, tzinfo=utc), auto_now=True), - preserve_default=False, - ), - ] diff --git a/sapl/compilacao/migrations/0023_auto_20151120_1529.py b/sapl/compilacao/migrations/0023_auto_20151120_1529.py deleted file mode 100644 index 1a78f7212..000000000 --- a/sapl/compilacao/migrations/0023_auto_20151120_1529.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import datetime - -from django.db import migrations, models -from django.utils.timezone import utc - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0022_auto_20151120_1503'), - ] - - operations = [ - migrations.AddField( - model_name='vide', - name='created', - field=models.DateTimeField(verbose_name='created', auto_now_add=True, default=datetime.datetime(2015, 11, 20, 17, 29, 27, 32283, tzinfo=utc)), - preserve_default=False, - ), - migrations.AddField( - model_name='vide', - name='modified', - field=models.DateTimeField(verbose_name='modified', auto_now=True, default=datetime.datetime(2015, 11, 20, 17, 29, 31, 856683, tzinfo=utc)), - preserve_default=False, - ), - ] diff --git a/sapl/compilacao/migrations/0024_auto_20151120_1814.py b/sapl/compilacao/migrations/0024_auto_20151120_1814.py deleted file mode 100644 index 47d696f33..000000000 --- a/sapl/compilacao/migrations/0024_auto_20151120_1814.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import datetime - -from django.db import migrations, models -from django.utils.timezone import utc - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0023_auto_20151120_1529'), - ] - - operations = [ - migrations.RemoveField( - model_name='nota', - name='data_criacao', - ), - migrations.RemoveField( - model_name='vide', - name='data_criacao', - ), - migrations.AddField( - model_name='nota', - name='created', - field=models.DateTimeField(auto_now_add=True, default=datetime.datetime(2015, 11, 20, 20, 13, 57, 385520, tzinfo=utc), verbose_name='created'), - preserve_default=False, - ), - migrations.AddField( - model_name='nota', - name='modified', - field=models.DateTimeField(auto_now=True, default=datetime.datetime(2015, 11, 20, 20, 14, 3, 360297, tzinfo=utc), verbose_name='modified'), - preserve_default=False, - ), - ] diff --git a/sapl/compilacao/migrations/0025_auto_20151122_1744.py b/sapl/compilacao/migrations/0025_auto_20151122_1744.py deleted file mode 100644 index 1b69eb301..000000000 --- a/sapl/compilacao/migrations/0025_auto_20151122_1744.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0024_auto_20151120_1814'), - ] - - operations = [ - migrations.RenameField( - model_name='nota', - old_name='efetifidade', - new_name='efetividade', - ), - migrations.AlterField( - model_name='nota', - name='dispositivo', - field=models.ForeignKey(to='compilacao.Dispositivo', related_name='notas', verbose_name='Dispositivo da Nota'), - ), - ] diff --git a/sapl/compilacao/migrations/0026_auto_20151122_1756.py b/sapl/compilacao/migrations/0026_auto_20151122_1756.py deleted file mode 100644 index 9d75c3f91..000000000 --- a/sapl/compilacao/migrations/0026_auto_20151122_1756.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0025_auto_20151122_1744'), - ] - - operations = [ - migrations.AlterModelOptions( - name='nota', - options={'verbose_name': 'Nota', 'ordering': ['publicacao'], 'verbose_name_plural': 'Notas'}, - ), - migrations.AddField( - model_name='nota', - name='titulo', - field=models.CharField(verbose_name='Título', max_length=100, default=''), - ), - migrations.AlterField( - model_name='nota', - name='texto', - field=models.TextField(verbose_name='Texto'), - ), - ] diff --git a/sapl/compilacao/migrations/0027_auto_20151130_1632.py b/sapl/compilacao/migrations/0027_auto_20151130_1632.py deleted file mode 100644 index 81c64d951..000000000 --- a/sapl/compilacao/migrations/0027_auto_20151130_1632.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0026_auto_20151122_1756'), - ] - - operations = [ - migrations.AlterModelOptions( - name='nota', - options={'verbose_name': 'Nota', 'ordering': ['-publicacao', '-modified'], 'verbose_name_plural': 'Notas'}, - ), - migrations.AlterField( - model_name='nota', - name='titulo', - field=models.CharField(verbose_name='Título', default='', blank=True, max_length=100), - ), - migrations.AlterField( - model_name='vide', - name='dispositivo_base', - field=models.ForeignKey(verbose_name='Dispositivo Base', related_name='cita', to='compilacao.Dispositivo'), - ), - migrations.AlterField( - model_name='vide', - name='dispositivo_ref', - field=models.ForeignKey(verbose_name='Dispositivo Referido', related_name='citado', to='compilacao.Dispositivo'), - ), - ] diff --git a/sapl/compilacao/migrations/0028_auto_20151201_0042.py b/sapl/compilacao/migrations/0028_auto_20151201_0042.py deleted file mode 100644 index 990c31fbc..000000000 --- a/sapl/compilacao/migrations/0028_auto_20151201_0042.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0027_auto_20151130_1632'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='vide', - unique_together=set([('dispositivo_base', 'dispositivo_ref')]), - ), - ] diff --git a/sapl/compilacao/migrations/0029_auto_20151201_1611.py b/sapl/compilacao/migrations/0029_auto_20151201_1611.py deleted file mode 100644 index 34055d72c..000000000 --- a/sapl/compilacao/migrations/0029_auto_20151201_1611.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0028_auto_20151201_0042'), - ] - - operations = [ - migrations.AlterField( - model_name='nota', - name='publicidade', - field=models.PositiveSmallIntegerField(verbose_name='Nível de Publicidade', choices=[(1, 'Nota Privada'), (2, 'Nota Institucional'), (3, 'Nota Pública')]), - ), - ] diff --git a/sapl/compilacao/migrations/0030_auto_20151203_1114.py b/sapl/compilacao/migrations/0030_auto_20151203_1114.py deleted file mode 100644 index 27b47f052..000000000 --- a/sapl/compilacao/migrations/0030_auto_20151203_1114.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0029_auto_20151201_1611'), - ] - - operations = [ - migrations.AlterField( - model_name='tipodispositivo', - name='relacoes_diretas_pai_filho', - field=models.ManyToManyField(to='compilacao.TipoDispositivo', related_name='+', through='compilacao.TipoDispositivoRelationship'), - ), - ] diff --git a/sapl/compilacao/migrations/0030_auto_20151203_1117.py b/sapl/compilacao/migrations/0030_auto_20151203_1117.py deleted file mode 100644 index 4daa1e950..000000000 --- a/sapl/compilacao/migrations/0030_auto_20151203_1117.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0029_auto_20151201_1611'), - ] - - operations = [ - migrations.AlterField( - model_name='tipodispositivo', - name='relacoes_diretas_pai_filho', - field=models.ManyToManyField(to='compilacao.TipoDispositivo', through='compilacao.TipoDispositivoRelationship', related_name='+'), - ), - ] diff --git a/sapl/compilacao/migrations/0031_merge.py b/sapl/compilacao/migrations/0031_merge.py deleted file mode 100644 index 13e743923..000000000 --- a/sapl/compilacao/migrations/0031_merge.py +++ /dev/null @@ -1,15 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0030_auto_20151203_1114'), - ('compilacao', '0030_auto_20151203_1117'), - ] - - operations = [ - ] diff --git a/sapl/compilacao/migrations/0032_auto_20151213_1538.py b/sapl/compilacao/migrations/0032_auto_20151213_1538.py deleted file mode 100644 index 3bd8555a7..000000000 --- a/sapl/compilacao/migrations/0032_auto_20151213_1538.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0031_merge'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='vide', - unique_together=set( - [('dispositivo_base', 'dispositivo_ref', 'tipo')]), - ), - ] diff --git a/sapl/compilacao/migrations/0033_auto_20151226_1320.py b/sapl/compilacao/migrations/0033_auto_20151226_1320.py deleted file mode 100644 index db1b3b145..000000000 --- a/sapl/compilacao/migrations/0033_auto_20151226_1320.py +++ /dev/null @@ -1,115 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0032_auto_20151213_1538'), - ] - - operations = [ - migrations.CreateModel( - name='PerfilEstruturalTextoArticulado', - fields=[ - ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')), - ('sigla', models.CharField(unique=True, max_length=10, verbose_name='Sigla')), - ('nome', models.CharField(max_length=50, verbose_name='Nome')), - ('padrao', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Padrão')), - ], - options={ - 'verbose_name_plural': 'Perfis Estruturais de Textos Articulados', - 'verbose_name': 'Perfil Estrutural de Texto Articulado', - 'ordering': ['-padrao', 'sigla'], - }, - ), - migrations.CreateModel( - name='TextoArticulado', - fields=[ - ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')), - ('created', models.DateTimeField(auto_now_add=True, verbose_name='created')), - ('modified', models.DateTimeField(auto_now=True, verbose_name='modified')), - ('data', models.DateField(null=True, verbose_name='Data', blank=True)), - ('ementa', models.TextField(verbose_name='Ementa')), - ('observacao', models.TextField(null=True, verbose_name='Observação', blank=True)), - ('numero', models.PositiveIntegerField(verbose_name='Número')), - ('ano', models.PositiveSmallIntegerField(verbose_name='Ano')), - ('participacao_social', models.NullBooleanField(choices=[(None, 'Padrão definido no Tipo'), (True, 'Sim'), (False, 'Não')], default=None, verbose_name='Participação Social')), - ], - options={ - 'verbose_name_plural': 'Textos Articulados', - 'verbose_name': 'Texto Articulado', - 'ordering': ['-data', '-numero'], - }, - ), - migrations.CreateModel( - name='TipoTextoArticulado', - fields=[ - ('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')), - ('sigla', models.CharField(max_length=3, verbose_name='Sigla')), - ('descricao', models.CharField(max_length=50, verbose_name='Descrição')), - ('participacao_social', models.NullBooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Participação Social')), - ], - options={ - 'verbose_name_plural': 'Tipos de Texto Articulados', - 'verbose_name': 'Tipo de Texto Articulado', - }, - ), - migrations.AlterModelOptions( - name='dispositivo', - options={'verbose_name_plural': 'Dispositivos', 'verbose_name': 'Dispositivo', 'ordering': ['ta', 'ordem']}, - ), - migrations.RemoveField( - model_name='publicacao', - name='norma', - ), - migrations.AlterField( - model_name='dispositivo', - name='visibilidade', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Visibilidade no Texto Articulado Publicado'), - ), - migrations.AlterField( - model_name='tipodispositivorelationship', - name='perfil', - field=models.ForeignKey(to='compilacao.PerfilEstruturalTextoArticulado'), - ), - migrations.AlterUniqueTogether( - name='dispositivo', - unique_together=set([]), - ), - migrations.DeleteModel( - name='PerfilEstruturalTextosNormativos', - ), - migrations.AddField( - model_name='textoarticulado', - name='tipo_ta', - field=models.ForeignKey(to='compilacao.TipoTextoArticulado', default=None, blank=True, null=True, verbose_name='Tipo de Texto Articulado'), - ), - migrations.RemoveField( - model_name='dispositivo', - name='norma', - ), - migrations.RemoveField( - model_name='dispositivo', - name='norma_publicada', - ), - migrations.AddField( - model_name='dispositivo', - name='ta', - field=models.ForeignKey(default=1, to='compilacao.TextoArticulado', related_name='dispositivos_set', verbose_name='Texto Articulado'), - preserve_default=False, - ), - migrations.AddField( - model_name='dispositivo', - name='ta_publicado', - field=models.ForeignKey(to='compilacao.TextoArticulado', default=None, blank=True, null=True, related_name='dispositivos_alterados_pelo_ta_set', verbose_name='Texto Articulado Publicado'), - ), - migrations.AddField( - model_name='publicacao', - name='ta', - field=models.ForeignKey(default=1, to='compilacao.TextoArticulado', verbose_name='Texto Articulado'), - preserve_default=False, - ), - ] diff --git a/sapl/compilacao/migrations/0034_auto_20151226_1321.py b/sapl/compilacao/migrations/0034_auto_20151226_1321.py deleted file mode 100644 index 6f4c8f6d1..000000000 --- a/sapl/compilacao/migrations/0034_auto_20151226_1321.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0033_auto_20151226_1320'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='dispositivo', - unique_together=set([('ta', 'ordem'), ('ta', 'dispositivo0', 'dispositivo1', 'dispositivo2', 'dispositivo3', 'dispositivo4', 'dispositivo5', 'tipo_dispositivo', 'dispositivo_pai', 'ta_publicado', 'publicacao')]), - ), - ] diff --git a/sapl/compilacao/migrations/0035_auto_20151226_1349.py b/sapl/compilacao/migrations/0035_auto_20151226_1349.py deleted file mode 100644 index ded460760..000000000 --- a/sapl/compilacao/migrations/0035_auto_20151226_1349.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import builtins - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('contenttypes', '0002_remove_content_type_name'), - ('compilacao', '0034_auto_20151226_1321'), - ] - - operations = [ - migrations.AddField( - model_name='textoarticulado', - name='content_type', - field=models.ForeignKey( - to='contenttypes.ContentType', default=142), - preserve_default=False, - ), - migrations.AddField( - model_name='textoarticulado', - name='object_id', - field=models.PositiveIntegerField(default=1), - preserve_default=False, - ), - ] diff --git a/sapl/compilacao/migrations/0036_auto_20151226_1411.py b/sapl/compilacao/migrations/0036_auto_20151226_1411.py deleted file mode 100644 index 1ae7b9baf..000000000 --- a/sapl/compilacao/migrations/0036_auto_20151226_1411.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0035_auto_20151226_1349'), - ] - - operations = [ - migrations.AlterField( - model_name='textoarticulado', - name='content_type', - field=models.ForeignKey(default=None, null=True, to='contenttypes.ContentType', blank=True), - ), - ] diff --git a/sapl/compilacao/migrations/0037_auto_20151226_1414.py b/sapl/compilacao/migrations/0037_auto_20151226_1414.py deleted file mode 100644 index 5420d7917..000000000 --- a/sapl/compilacao/migrations/0037_auto_20151226_1414.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0036_auto_20151226_1411'), - ] - - operations = [ - migrations.AlterField( - model_name='textoarticulado', - name='object_id', - field=models.PositiveIntegerField(blank=True, default=None, null=True), - ), - ] diff --git a/sapl/compilacao/migrations/0038_tipotextoarticulado_model.py b/sapl/compilacao/migrations/0038_tipotextoarticulado_model.py deleted file mode 100644 index 561196e71..000000000 --- a/sapl/compilacao/migrations/0038_tipotextoarticulado_model.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0037_auto_20151226_1414'), - ] - - operations = [ - migrations.AddField( - model_name='tipotextoarticulado', - name='model', - field=models.CharField(max_length=50, blank=True, default='', null=True, verbose_name='Modelagem Django'), - ), - ] diff --git a/sapl/compilacao/migrations/0039_auto_20151226_1433.py b/sapl/compilacao/migrations/0039_auto_20151226_1433.py deleted file mode 100644 index 807711408..000000000 --- a/sapl/compilacao/migrations/0039_auto_20151226_1433.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0038_tipotextoarticulado_model'), - ] - - operations = [ - migrations.AlterField( - model_name='tipotextoarticulado', - name='model', - field=models.CharField(verbose_name='Modelagem Django', default='', blank=True, null=True, max_length=50, unique=True), - ), - ] diff --git a/sapl/compilacao/migrations/0040_auto_20160106_1956.py b/sapl/compilacao/migrations/0040_auto_20160106_1956.py deleted file mode 100644 index e621839d6..000000000 --- a/sapl/compilacao/migrations/0040_auto_20160106_1956.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('contenttypes', '0002_remove_content_type_name'), - ('compilacao', '0039_auto_20151226_1433'), - ] - - operations = [ - migrations.RemoveField( - model_name='tipotextoarticulado', - name='model', - ), - migrations.AddField( - model_name='tipotextoarticulado', - name='content_type', - field=models.ForeignKey(verbose_name='Modelo Integrado', blank=True, default=None, null=True, to='contenttypes.ContentType'), - ), - ] diff --git a/sapl/compilacao/migrations/0041_auto_20160109_1928.py b/sapl/compilacao/migrations/0041_auto_20160109_1928.py deleted file mode 100644 index 9d854832c..000000000 --- a/sapl/compilacao/migrations/0041_auto_20160109_1928.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0040_auto_20160106_1956'), - ] - - operations = [ - migrations.RenameField( - model_name='publicacao', - old_name='publicacao', - new_name='data', - ), - migrations.AddField( - model_name='publicacao', - name='ano', - field=models.PositiveIntegerField(null=True, verbose_name='Pg. Início', blank=True), - ), - migrations.AddField( - model_name='publicacao', - name='edicao', - field=models.PositiveIntegerField(null=True, verbose_name='Pg. Início', blank=True), - ), - migrations.AddField( - model_name='publicacao', - name='numero', - field=models.PositiveIntegerField(null=True, verbose_name='Pg. Início', blank=True), - ), - migrations.AddField( - model_name='publicacao', - name='url_externa', - field=models.CharField(max_length=1024, verbose_name='Link para Versão Eletrônica', blank=True), - ), - ] diff --git a/sapl/compilacao/migrations/0042_auto_20160110_1620.py b/sapl/compilacao/migrations/0042_auto_20160110_1620.py deleted file mode 100644 index 97e2396cc..000000000 --- a/sapl/compilacao/migrations/0042_auto_20160110_1620.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import datetime - -from django.db import migrations, models -from django.utils.timezone import utc - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0041_auto_20160109_1928'), - ] - - operations = [ - migrations.AddField( - model_name='publicacao', - name='hora', - field=models.TimeField(default=datetime.datetime( - 2016, 1, 10, 18, 20, 1, 151209, tzinfo=utc), verbose_name='Horário de Publicação'), - preserve_default=False, - ), - migrations.AlterField( - model_name='publicacao', - name='ano', - field=models.PositiveIntegerField( - verbose_name='Ano', blank=True, null=True), - ), - migrations.AlterField( - model_name='publicacao', - name='data', - field=models.DateField(verbose_name='Data de Publicação'), - ), - migrations.AlterField( - model_name='publicacao', - name='edicao', - field=models.PositiveIntegerField( - verbose_name='Edição', blank=True, null=True), - ), - migrations.AlterField( - model_name='publicacao', - name='numero', - field=models.PositiveIntegerField( - verbose_name='Número', blank=True, null=True), - ), - ] diff --git a/sapl/compilacao/migrations/0043_auto_20160110_1733.py b/sapl/compilacao/migrations/0043_auto_20160110_1733.py deleted file mode 100644 index 94261c8bf..000000000 --- a/sapl/compilacao/migrations/0043_auto_20160110_1733.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0042_auto_20160110_1620'), - ] - - operations = [ - migrations.AlterField( - model_name='publicacao', - name='hora', - field=models.TimeField(null=True, verbose_name='Horário de Publicação', blank=True), - ), - ] diff --git a/sapl/compilacao/migrations/0044_auto_20160307_0918.py b/sapl/compilacao/migrations/0044_auto_20160307_0918.py deleted file mode 100644 index 302524708..000000000 --- a/sapl/compilacao/migrations/0044_auto_20160307_0918.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-07 12:18 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0043_auto_20160110_1733'), - ] - - operations = [ - migrations.AlterField( - model_name='nota', - name='url_externa', - field=models.URLField(blank=True, max_length=1024, verbose_name='Url externa'), - ), - migrations.AlterField( - model_name='publicacao', - name='url_externa', - field=models.URLField(blank=True, max_length=1024, verbose_name='Link para Versão Eletrônica'), - ), - ] diff --git a/sapl/compilacao/migrations/0045_auto_20160311_1117.py b/sapl/compilacao/migrations/0045_auto_20160311_1117.py deleted file mode 100644 index 07645df62..000000000 --- a/sapl/compilacao/migrations/0045_auto_20160311_1117.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-11 14:17 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0044_auto_20160307_0918'), - ] - - operations = [ - migrations.AlterField( - model_name='dispositivo', - name='dispositivo_subsequente', - field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='compilacao.Dispositivo', verbose_name='Dispositivo Subsequente'), - ), - migrations.AlterField( - model_name='dispositivo', - name='dispositivo_substituido', - field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='compilacao.Dispositivo', verbose_name='Dispositivo Substituido'), - ), - migrations.AlterField( - model_name='dispositivo', - name='inconstitucionalidade', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Declaração de Inconstitucionalidade'), - ), - migrations.AlterField( - model_name='dispositivo', - name='texto', - field=models.TextField(blank=True, default='', verbose_name='Texto na Norma Original'), - ), - ] diff --git a/sapl/compilacao/migrations/0045_auto_20160404_1411.py b/sapl/compilacao/migrations/0045_auto_20160404_1411.py deleted file mode 100644 index a934e8bf0..000000000 --- a/sapl/compilacao/migrations/0045_auto_20160404_1411.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-04-04 17:11 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0044_auto_20160307_0918'), - ] - - operations = [ - migrations.AlterField( - model_name='textoarticulado', - name='observacao', - field=models.TextField(blank=True, default='', verbose_name='Observação'), - preserve_default=False, - ), - ] diff --git a/sapl/compilacao/migrations/0046_auto_20160319_1542.py b/sapl/compilacao/migrations/0046_auto_20160319_1542.py deleted file mode 100644 index c3fc05c14..000000000 --- a/sapl/compilacao/migrations/0046_auto_20160319_1542.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-19 18:42 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0045_auto_20160311_1117'), - ] - - operations = [ - migrations.AlterField( - model_name='dispositivo', - name='inconstitucionalidade', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Declarado Inconstitucional'), - ), - migrations.AlterField( - model_name='dispositivo', - name='texto', - field=models.TextField(blank=True, default='', verbose_name='Texto Original'), - ), - ] diff --git a/sapl/compilacao/migrations/0047_auto_20160330_0027.py b/sapl/compilacao/migrations/0047_auto_20160330_0027.py deleted file mode 100644 index 920c70c2a..000000000 --- a/sapl/compilacao/migrations/0047_auto_20160330_0027.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-30 03:27 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0046_auto_20160319_1542'), - ] - - operations = [ - migrations.AlterField( - model_name='dispositivo', - name='dispositivo_vigencia', - field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='dispositivos_vigencias_set', to='compilacao.Dispositivo', verbose_name='Dispositivo de Vigência'), - ), - ] diff --git a/sapl/compilacao/migrations/0048_auto_20160404_2309.py b/sapl/compilacao/migrations/0048_auto_20160404_2309.py deleted file mode 100644 index 9c25badfc..000000000 --- a/sapl/compilacao/migrations/0048_auto_20160404_2309.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-04-05 02:09 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0047_auto_20160330_0027'), - ] - - operations = [ - migrations.AlterField( - model_name='dispositivo', - name='dispositivo_vigencia', - field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dispositivos_vigencias_set', to='compilacao.Dispositivo', verbose_name='Dispositivo de Vigência'), - ), - ] diff --git a/sapl/compilacao/migrations/0049_merge.py b/sapl/compilacao/migrations/0049_merge.py deleted file mode 100644 index beaedb5ff..000000000 --- a/sapl/compilacao/migrations/0049_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-04-06 17:43 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0045_auto_20160404_1411'), - ('compilacao', '0048_auto_20160404_2309'), - ] - - operations = [ - ] diff --git a/sapl/compilacao/migrations/0050_auto_20160503_0926.py b/sapl/compilacao/migrations/0050_auto_20160503_0926.py deleted file mode 100644 index 27c43be97..000000000 --- a/sapl/compilacao/migrations/0050_auto_20160503_0926.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-03 12:26 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0049_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='dispositivo', - name='dispositivo_subsequente', - field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dispositivo_subsequente_set', to='compilacao.Dispositivo', verbose_name='Dispositivo Subsequente'), - ), - migrations.AlterField( - model_name='dispositivo', - name='dispositivo_substituido', - field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dispositivo_substituido_set', to='compilacao.Dispositivo', verbose_name='Dispositivo Substituido'), - ), - migrations.AlterField( - model_name='nota', - name='dispositivo', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dispositivo_nota_set', to='compilacao.Dispositivo', verbose_name='Dispositivo da Nota'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='relacoes_diretas_pai_filho', - field=models.ManyToManyField(related_name='relacaoes_pai_filho', through='compilacao.TipoDispositivoRelationship', to='compilacao.TipoDispositivo'), - ), - migrations.AlterField( - model_name='vide', - name='dispositivo_base', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dispositivo_base_set', to='compilacao.Dispositivo', verbose_name='Dispositivo Base'), - ), - migrations.AlterField( - model_name='vide', - name='dispositivo_ref', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dispositivo_citado_set', to='compilacao.Dispositivo', verbose_name='Dispositivo Referido'), - ), - ] diff --git a/sapl/compilacao/migrations/0051_dispositivo_auto_inserido.py b/sapl/compilacao/migrations/0051_dispositivo_auto_inserido.py deleted file mode 100644 index 9b75fabf5..000000000 --- a/sapl/compilacao/migrations/0051_dispositivo_auto_inserido.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-12 16:24 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0050_auto_20160503_0926'), - ] - - operations = [ - migrations.AddField( - model_name='dispositivo', - name='auto_inserido', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Auto Inserido'), - ), - ] diff --git a/sapl/compilacao/migrations/0052_auto_20160915_1327.py b/sapl/compilacao/migrations/0052_auto_20160915_1327.py deleted file mode 100644 index 5cab6191f..000000000 --- a/sapl/compilacao/migrations/0052_auto_20160915_1327.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-15 16:27 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0051_dispositivo_auto_inserido'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='dispositivo', - unique_together=set([('ta', 'dispositivo0', 'dispositivo1', 'dispositivo2', 'dispositivo3', 'dispositivo4', 'dispositivo5', 'tipo_dispositivo', 'dispositivo_pai', 'dispositivo_atualizador', 'ta_publicado', 'publicacao'), ('ta', 'ordem')]), - ), - ] diff --git a/sapl/compilacao/migrations/0053_auto_20160916_1420.py b/sapl/compilacao/migrations/0053_auto_20160916_1420.py deleted file mode 100644 index 15d1446ff..000000000 --- a/sapl/compilacao/migrations/0053_auto_20160916_1420.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-16 17:20 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0052_auto_20160915_1327'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='dispositivo', - unique_together=set([('ta', 'ordem'), ('ta', 'dispositivo0', 'dispositivo1', 'dispositivo2', 'dispositivo3', 'dispositivo4', 'dispositivo5', 'tipo_dispositivo', 'dispositivo_pai', 'ta_publicado', 'publicacao')]), - ), - ] diff --git a/sapl/compilacao/migrations/0054_auto_20160916_1424.py b/sapl/compilacao/migrations/0054_auto_20160916_1424.py deleted file mode 100644 index 3c9eb0df6..000000000 --- a/sapl/compilacao/migrations/0054_auto_20160916_1424.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-16 17:24 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0053_auto_20160916_1420'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='dispositivo', - unique_together=set([('ta', 'ordem'), ('ta', 'dispositivo0', 'dispositivo1', 'dispositivo2', 'dispositivo3', 'dispositivo4', 'dispositivo5', 'tipo_dispositivo', 'dispositivo_pai', 'dispositivo_atualizador', 'ta_publicado', 'publicacao')]), - ), - ] diff --git a/sapl/compilacao/migrations/0055_dispositivo_dispositivo_de_revogacao.py b/sapl/compilacao/migrations/0055_dispositivo_dispositivo_de_revogacao.py deleted file mode 100644 index daf297852..000000000 --- a/sapl/compilacao/migrations/0055_dispositivo_dispositivo_de_revogacao.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-20 11:57 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0054_auto_20160916_1424'), - ] - - operations = [ - migrations.AddField( - model_name='dispositivo', - name='dispositivo_de_revogacao', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Dispositivo de Revogação'), - ), - ] diff --git a/sapl/compilacao/migrations/0056_auto_20161006_1251.py b/sapl/compilacao/migrations/0056_auto_20161006_1251.py deleted file mode 100644 index d92358d04..000000000 --- a/sapl/compilacao/migrations/0056_auto_20161006_1251.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-06 15:51 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0055_dispositivo_dispositivo_de_revogacao'), - ] - - operations = [ - migrations.AlterField( - model_name='tipotextoarticulado', - name='content_type', - field=models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType', verbose_name='Modelo Integrado'), - ), - ] diff --git a/sapl/compilacao/migrations/0057_auto_20161007_2200.py b/sapl/compilacao/migrations/0057_auto_20161007_2200.py deleted file mode 100644 index 9c454d6a0..000000000 --- a/sapl/compilacao/migrations/0057_auto_20161007_2200.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-08 01:00 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0056_auto_20161006_1251'), - ] - - operations = [ - migrations.AlterField( - model_name='dispositivo', - name='texto', - field=models.TextField(blank=True, default='', verbose_name='Texto do Dispositivo'), - ), - migrations.AlterField( - model_name='dispositivo', - name='texto_atualizador', - field=models.TextField(blank=True, default='', verbose_name='Texto do Dispositivo no Dispositivo Atualizador'), - ), - ] diff --git a/sapl/compilacao/migrations/0058_auto_20161008_0143.py b/sapl/compilacao/migrations/0058_auto_20161008_0143.py deleted file mode 100644 index 366984066..000000000 --- a/sapl/compilacao/migrations/0058_auto_20161008_0143.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-08 04:43 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0057_auto_20161007_2200'), - ] - - operations = [ - migrations.AlterField( - model_name='dispositivo', - name='ta', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='dispositivos_set', to='compilacao.TextoArticulado', verbose_name='Texto Articulado'), - ), - migrations.AlterField( - model_name='dispositivo', - name='ta_publicado', - field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='dispositivos_alterados_pelo_ta_set', to='compilacao.TextoArticulado', verbose_name='Texto Articulado Publicado'), - ), - migrations.AlterField( - model_name='dispositivo', - name='tipo_dispositivo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='dispositivos_do_tipo_set', to='compilacao.TipoDispositivo', verbose_name='Tipo do Dispositivo'), - ), - ] diff --git a/sapl/compilacao/migrations/0059_auto_20161027_1323.py b/sapl/compilacao/migrations/0059_auto_20161027_1323.py deleted file mode 100644 index fdfe8de37..000000000 --- a/sapl/compilacao/migrations/0059_auto_20161027_1323.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-27 13:23 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0058_auto_20161008_0143'), - ] - - operations = [ - migrations.AlterModelOptions( - name='dispositivo', - options={'ordering': ['ta', 'ordem'], 'permissions': (('change_dispositivo_edicao_dinamica', 'Permissão de edição de dispositivos originais via editor dinâmico.'), ('change_dispositivo_edicao_avancada', 'Permissão de edição de dispositivos originais via formulários de edição avançada.'), ('change_dispositivo_registros_compilacao', 'Permissão de registro de compilação via editor dinâmico.'), ('change_dispositivo_notificacoes', 'Permissão de acesso às notificações de pendências.')), 'verbose_name': 'Dispositivo', 'verbose_name_plural': 'Dispositivos'}, - ), - ] diff --git a/sapl/compilacao/migrations/0060_auto_20161101_0913.py b/sapl/compilacao/migrations/0060_auto_20161101_0913.py deleted file mode 100644 index 851746ec0..000000000 --- a/sapl/compilacao/migrations/0060_auto_20161101_0913.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-01 09:13 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0059_auto_20161027_1323'), - ] - - operations = [ - migrations.AlterModelOptions( - name='dispositivo', - options={'ordering': ['ta', 'ordem'], 'permissions': (('change_dispositivo_edicao_dinamica', 'Permissão de edição de dispositivos originais via editor dinâmico.'), ('change_dispositivo_edicao_avancada', 'Permissão de edição de dispositivos originais via formulários de edição avançada.'), ('change_dispositivo_registros_compilacao', 'Permissão de registro de compilação via editor dinâmico.'), ('view_dispositivo_notificacoes', 'Permissão de acesso às notificações de pendências.')), 'verbose_name': 'Dispositivo', 'verbose_name_plural': 'Dispositivos'}, - ), - ] diff --git a/sapl/compilacao/migrations/0061_auto_20161101_1025.py b/sapl/compilacao/migrations/0061_auto_20161101_1025.py deleted file mode 100644 index d74bdc8da..000000000 --- a/sapl/compilacao/migrations/0061_auto_20161101_1025.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-01 10:25 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0060_auto_20161101_0913'), - ] - - operations = [ - migrations.AlterField( - model_name='dispositivo', - name='ta', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dispositivos_set', to='compilacao.TextoArticulado', verbose_name='Texto Articulado'), - ), - ] diff --git a/sapl/compilacao/migrations/0062_auto_20161101_1221.py b/sapl/compilacao/migrations/0062_auto_20161101_1221.py deleted file mode 100644 index 63e703843..000000000 --- a/sapl/compilacao/migrations/0062_auto_20161101_1221.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-01 12:21 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0061_auto_20161101_1025'), - ] - - operations = [ - migrations.AlterModelOptions( - name='dispositivo', - options={'ordering': ['ta', 'ordem'], 'permissions': (('change_dispositivo_edicao_dinamica', 'Permissão de edição de dispositivos originais via editor dinâmico.'), ('change_dispositivo_edicao_avancada', 'Permissão de edição de dispositivos originais via formulários de edição avançada.'), ('change_dispositivo_registros_compilacao', 'Permissão de registro de compilação via editor dinâmico.'), ('view_dispositivo_notificacoes', 'Permissão de acesso às notificações de pendências.'), ('change_dispositivo_de_vigencia_global', 'Permissão alteração global do dispositivo de vigência')), 'verbose_name': 'Dispositivo', 'verbose_name_plural': 'Dispositivos'}, - ), - ] diff --git a/sapl/compilacao/migrations/0063_tipotextoarticulado_publicacao_func.py b/sapl/compilacao/migrations/0063_tipotextoarticulado_publicacao_func.py deleted file mode 100644 index 53dac62fc..000000000 --- a/sapl/compilacao/migrations/0063_tipotextoarticulado_publicacao_func.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-03 11:06 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0062_auto_20161101_1221'), - ] - - operations = [ - migrations.AddField( - model_name='tipotextoarticulado', - name='publicacao_func', - field=models.NullBooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=True, verbose_name='Histórico de Publicação'), - ), - ] diff --git a/sapl/compilacao/migrations/0064_auto_20161104_1420.py b/sapl/compilacao/migrations/0064_auto_20161104_1420.py deleted file mode 100644 index 508bc17ac..000000000 --- a/sapl/compilacao/migrations/0064_auto_20161104_1420.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-04 14:20 -from __future__ import unicode_literals - -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('compilacao', '0063_tipotextoarticulado_publicacao_func'), - ] - - operations = [ - migrations.AlterModelOptions( - name='textoarticulado', - options={'ordering': ['-data', '-numero'], 'permissions': (('view_restricted_textoarticulado', 'Pode ver qualquer Texto Articulado'),), 'verbose_name': 'Texto Articulado', 'verbose_name_plural': 'Textos Articulados'}, - ), - migrations.AddField( - model_name='textoarticulado', - name='editable_only_by_owners', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=True, verbose_name='Editável apenas pelos donos do Texto Articulado'), - ), - migrations.AddField( - model_name='textoarticulado', - name='editing_locked', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=True, verbose_name='Texto Articulado em Edição'), - ), - migrations.AddField( - model_name='textoarticulado', - name='owners', - field=models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL, verbose_name='Donos do Texto Articulado'), - ), - migrations.AddField( - model_name='textoarticulado', - name='visibilidade', - field=models.IntegerField(choices=[(99, 'Privado'), (79, 'Restrito'), (89, 'Em Edição'), (0, 'Público')], default=99, verbose_name='Visibilidade'), - ), - migrations.AlterField( - model_name='tipotextoarticulado', - name='publicacao_func', - field=models.NullBooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Histórico de Publicação'), - ), - ] diff --git a/sapl/compilacao/migrations/0065_auto_20161107_1024.py b/sapl/compilacao/migrations/0065_auto_20161107_1024.py deleted file mode 100644 index 5da908346..000000000 --- a/sapl/compilacao/migrations/0065_auto_20161107_1024.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-07 10:24 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0064_auto_20161104_1420'), - ] - - operations = [ - migrations.RenameField( - model_name='textoarticulado', - old_name='visibilidade', - new_name='privacidade' - ), - ] diff --git a/sapl/compilacao/migrations/0066_auto_20161107_1028.py b/sapl/compilacao/migrations/0066_auto_20161107_1028.py deleted file mode 100644 index a7c3ca92c..000000000 --- a/sapl/compilacao/migrations/0066_auto_20161107_1028.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-07 10:28 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0065_auto_20161107_1024'), - ] - - operations = [ - migrations.AlterField( - model_name='textoarticulado', - name='privacidade', - field=models.IntegerField(choices=[(99, 'Privado'), (79, 'Restrito'), (89, 'Em Edição'), (0, 'Público')], default=99, verbose_name='Privacidade'), - ), - ] diff --git a/sapl/compilacao/migrations/0067_auto_20161107_1351.py b/sapl/compilacao/migrations/0067_auto_20161107_1351.py deleted file mode 100644 index 54fcc16dc..000000000 --- a/sapl/compilacao/migrations/0067_auto_20161107_1351.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-07 13:51 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0066_auto_20161107_1028'), - ] - - operations = [ - migrations.AlterModelOptions( - name='textoarticulado', - options={'ordering': ['-data', '-numero'], 'permissions': (('view_restricted_textoarticulado', 'Pode ver qualquer Texto Articulado'), ('lock_unlock_textoarticulado', 'Pode bloquear/desbloquear edição de Texto Articulado')), 'verbose_name': 'Texto Articulado', 'verbose_name_plural': 'Textos Articulados'}, - ), - ] diff --git a/sapl/compilacao/migrations/0068_auto_20161107_1546.py b/sapl/compilacao/migrations/0068_auto_20161107_1546.py deleted file mode 100644 index 96c5f726b..000000000 --- a/sapl/compilacao/migrations/0068_auto_20161107_1546.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-07 15:46 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0067_auto_20161107_1351'), - ] - - operations = [ - migrations.AlterModelOptions( - name='dispositivo', - options={'ordering': ['ta', 'ordem'], 'permissions': (('change_dispositivo_edicao_dinamica', 'Permissão de edição de dispositivos originais via editor dinâmico.'), ('change_your_dispositivo_edicao_dinamica', 'Permissão de edição de dispositivos originais via editor dinâmico desde que seja dono.'), ('change_dispositivo_edicao_avancada', 'Permissão de edição de dispositivos originais via formulários de edição avançada.'), ('change_dispositivo_registros_compilacao', 'Permissão de registro de compilação via editor dinâmico.'), ('view_dispositivo_notificacoes', 'Permissão de acesso às notificações de pendências.'), ('change_dispositivo_de_vigencia_global', 'Permissão alteração global do dispositivo de vigência')), 'verbose_name': 'Dispositivo', 'verbose_name_plural': 'Dispositivos'}, - ), - ] diff --git a/sapl/compilacao/migrations/0069_auto_20161107_1932.py b/sapl/compilacao/migrations/0069_auto_20161107_1932.py deleted file mode 100644 index 743167a56..000000000 --- a/sapl/compilacao/migrations/0069_auto_20161107_1932.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-07 19:32 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0068_auto_20161107_1546'), - ] - - operations = [ - migrations.AlterField( - model_name='textoarticulado', - name='privacidade', - field=models.IntegerField(choices=[(99, 'Privado'), (79, 'Imotável Restrito'), (69, 'Imutável Público'), (89, 'Em Edição'), (0, 'Público')], default=99, verbose_name='Privacidade'), - ), - ] diff --git a/sapl/compilacao/migrations/0070_perfilestruturaltextoarticulado_parent.py b/sapl/compilacao/migrations/0070_perfilestruturaltextoarticulado_parent.py deleted file mode 100644 index 480d9c15c..000000000 --- a/sapl/compilacao/migrations/0070_perfilestruturaltextoarticulado_parent.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-11 13:01 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0069_auto_20161107_1932'), - ] - - operations = [ - migrations.AddField( - model_name='perfilestruturaltextoarticulado', - name='parent', - field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='perfil_parent_set', to='compilacao.PerfilEstruturalTextoArticulado', verbose_name='Perfil Herdado'), - ), - ] diff --git a/sapl/compilacao/migrations/0071_tipotextoarticulado_perfis.py b/sapl/compilacao/migrations/0071_tipotextoarticulado_perfis.py deleted file mode 100644 index ee2639bc5..000000000 --- a/sapl/compilacao/migrations/0071_tipotextoarticulado_perfis.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-12 14:25 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0070_perfilestruturaltextoarticulado_parent'), - ] - - operations = [ - migrations.AddField( - model_name='tipotextoarticulado', - name='perfis', - field=models.ManyToManyField(blank=True, help_text='\n Apenas os perfis selecionados aqui estarão disponíveis\n para o editor de Textos Articulados cujo Tipo seja este\n em edição.\n ', to='compilacao.PerfilEstruturalTextoArticulado', verbose_name='Perfis Estruturais de Textos Articulados'), - ), - ] diff --git a/sapl/compilacao/migrations/0072_auto_20161112_1553.py b/sapl/compilacao/migrations/0072_auto_20161112_1553.py deleted file mode 100644 index 421215496..000000000 --- a/sapl/compilacao/migrations/0072_auto_20161112_1553.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-12 15:53 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0071_tipotextoarticulado_perfis'), - ] - - operations = [ - migrations.AlterField( - model_name='tipodispositivo', - name='nota_automatica_prefixo_html', - field=models.TextField(blank=True, verbose_name='Prefixo html da nota automática'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='nota_automatica_sufixo_html', - field=models.TextField(blank=True, verbose_name='Sufixo html da nota automática'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_prefixo_html', - field=models.TextField(blank=True, verbose_name='Prefixo html do rótulo'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_prefixo_texto', - field=models.TextField(blank=True, verbose_name='Prefixo de Edição do rótulo'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_sufixo_html', - field=models.TextField(blank=True, verbose_name='Sufixo html do rótulo'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='rotulo_sufixo_texto', - field=models.TextField(blank=True, verbose_name='Sufixo de Edição do rótulo'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='texto_prefixo_html', - field=models.TextField(blank=True, verbose_name='Prefixo html do texto'), - ), - migrations.AlterField( - model_name='tipodispositivo', - name='texto_sufixo_html', - field=models.TextField(blank=True, verbose_name='Sufixo html do texto'), - ), - ] diff --git a/sapl/legacy/migrations/0001_initial.py b/sapl/legacy/migrations/0001_initial.py deleted file mode 100644 index 975b10678..000000000 --- a/sapl/legacy/migrations/0001_initial.py +++ /dev/null @@ -1,1210 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='AcompMateria', - fields=[ - ('cod_cadastro', models.AutoField(serialize=False, primary_key=True)), - ('cod_materia', models.IntegerField()), - ('end_email', models.CharField(max_length=100)), - ('txt_hash', models.CharField(max_length=8)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'acomp_materia', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Anexada', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('cod_materia_principal', models.IntegerField()), - ('cod_materia_anexada', models.IntegerField()), - ('dat_anexacao', models.DateField()), - ('dat_desanexacao', models.DateField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'anexada', - 'managed': False, - }, - ), - migrations.CreateModel( - name='AssuntoMateria', - fields=[ - ('cod_assunto', models.IntegerField(serialize=False, primary_key=True)), - ('des_assunto', models.CharField(max_length=200)), - ('des_dispositivo', models.CharField(max_length=50)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'assunto_materia', - 'managed': False, - }, - ), - migrations.CreateModel( - name='AssuntoNorma', - fields=[ - ('cod_assunto', models.AutoField(serialize=False, primary_key=True)), - ('des_assunto', models.CharField(max_length=50)), - ('des_estendida', models.CharField(max_length=250, blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'assunto_norma', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Autor', - fields=[ - ('cod_autor', models.AutoField(serialize=False, primary_key=True)), - ('cod_partido', models.IntegerField(blank=True, null=True)), - ('cod_comissao', models.IntegerField(blank=True, null=True)), - ('cod_parlamentar', models.IntegerField(blank=True, null=True)), - ('tip_autor', models.IntegerField()), - ('nom_autor', models.CharField(max_length=50, blank=True, null=True)), - ('des_cargo', models.CharField(max_length=50, blank=True, null=True)), - ('col_username', models.CharField(max_length=50, blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'autor', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Autoria', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('cod_autor', models.IntegerField()), - ('cod_materia', models.IntegerField()), - ('ind_primeiro_autor', models.IntegerField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'autoria', - 'managed': False, - }, - ), - migrations.CreateModel( - name='CargoComissao', - fields=[ - ('cod_cargo', models.AutoField(serialize=False, primary_key=True)), - ('des_cargo', models.CharField(max_length=50)), - ('ind_unico', models.IntegerField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'cargo_comissao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='CargoMesa', - fields=[ - ('cod_cargo', models.AutoField(serialize=False, primary_key=True)), - ('des_cargo', models.CharField(max_length=50)), - ('ind_unico', models.IntegerField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'cargo_mesa', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Coligacao', - fields=[ - ('cod_coligacao', models.AutoField(serialize=False, primary_key=True)), - ('num_legislatura', models.IntegerField()), - ('nom_coligacao', models.CharField(max_length=50)), - ('num_votos_coligacao', models.IntegerField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'coligacao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Comissao', - fields=[ - ('cod_comissao', models.AutoField(serialize=False, primary_key=True)), - ('tip_comissao', models.IntegerField()), - ('nom_comissao', models.CharField(max_length=60)), - ('sgl_comissao', models.CharField(max_length=10)), - ('dat_criacao', models.DateField()), - ('dat_extincao', models.DateField(blank=True, null=True)), - ('nom_apelido_temp', models.CharField(max_length=100, blank=True, null=True)), - ('dat_instalacao_temp', models.DateField(blank=True, null=True)), - ('dat_final_prevista_temp', models.DateField(blank=True, null=True)), - ('dat_prorrogada_temp', models.DateField(blank=True, null=True)), - ('dat_fim_comissao', models.DateField(blank=True, null=True)), - ('nom_secretario', models.CharField(max_length=30, blank=True, null=True)), - ('num_tel_reuniao', models.CharField(max_length=15, blank=True, null=True)), - ('end_secretaria', models.CharField(max_length=100, blank=True, null=True)), - ('num_tel_secretaria', models.CharField(max_length=15, blank=True, null=True)), - ('num_fax_secretaria', models.CharField(max_length=15, blank=True, null=True)), - ('des_agenda_reuniao', models.CharField(max_length=100, blank=True, null=True)), - ('loc_reuniao', models.CharField(max_length=100, blank=True, null=True)), - ('txt_finalidade', models.TextField(blank=True, null=True)), - ('end_email', models.CharField(max_length=100, blank=True, null=True)), - ('ind_unid_deliberativa', models.IntegerField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'comissao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='ComposicaoColigacao', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('cod_partido', models.IntegerField()), - ('cod_coligacao', models.IntegerField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'composicao_coligacao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='ComposicaoComissao', - fields=[ - ('cod_comp_comissao', models.AutoField(serialize=False, primary_key=True)), - ('cod_parlamentar', models.IntegerField()), - ('cod_comissao', models.IntegerField()), - ('cod_periodo_comp', models.IntegerField()), - ('cod_cargo', models.IntegerField()), - ('ind_titular', models.IntegerField()), - ('dat_designacao', models.DateField()), - ('dat_desligamento', models.DateField(blank=True, null=True)), - ('des_motivo_desligamento', models.CharField(max_length=150, blank=True, null=True)), - ('obs_composicao', models.CharField(max_length=150, blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'composicao_comissao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='ComposicaoMesa', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('cod_parlamentar', models.IntegerField()), - ('cod_sessao_leg', models.IntegerField()), - ('cod_cargo', models.IntegerField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'composicao_mesa', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Dependente', - fields=[ - ('cod_dependente', models.AutoField(serialize=False, primary_key=True)), - ('tip_dependente', models.IntegerField()), - ('cod_parlamentar', models.IntegerField()), - ('nom_dependente', models.CharField(max_length=50)), - ('sex_dependente', models.CharField(max_length=1)), - ('dat_nascimento', models.DateField(blank=True, null=True)), - ('num_cpf', models.CharField(max_length=14, blank=True, null=True)), - ('num_rg', models.CharField(max_length=15, blank=True, null=True)), - ('num_tit_eleitor', models.CharField(max_length=15, blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'dependente', - 'managed': False, - }, - ), - migrations.CreateModel( - name='DespachoInicial', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('cod_materia', models.IntegerField()), - ('num_ordem', models.IntegerField()), - ('cod_comissao', models.IntegerField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'despacho_inicial', - 'managed': False, - }, - ), - migrations.CreateModel( - name='DocumentoAcessorio', - fields=[ - ('cod_documento', models.AutoField(serialize=False, primary_key=True)), - ('cod_materia', models.IntegerField()), - ('tip_documento', models.IntegerField()), - ('nom_documento', models.CharField(max_length=30)), - ('dat_documento', models.DateField(blank=True, null=True)), - ('nom_autor_documento', models.CharField(max_length=50, blank=True, null=True)), - ('txt_ementa', models.TextField(blank=True, null=True)), - ('txt_indexacao', models.TextField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'documento_acessorio', - 'managed': False, - }, - ), - migrations.CreateModel( - name='DocumentoAcessorioAdministrativo', - fields=[ - ('cod_documento_acessorio', models.AutoField(serialize=False, primary_key=True)), - ('cod_documento', models.IntegerField()), - ('tip_documento', models.IntegerField()), - ('nom_documento', models.CharField(max_length=30)), - ('nom_arquivo', models.CharField(max_length=100)), - ('dat_documento', models.DateField(blank=True, null=True)), - ('nom_autor_documento', models.CharField(max_length=50, blank=True, null=True)), - ('txt_assunto', models.TextField(blank=True, null=True)), - ('txt_indexacao', models.TextField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'documento_acessorio_administrativo', - 'managed': False, - }, - ), - migrations.CreateModel( - name='DocumentoAdministrativo', - fields=[ - ('cod_documento', models.AutoField(serialize=False, primary_key=True)), - ('tip_documento', models.IntegerField()), - ('num_documento', models.IntegerField()), - ('ano_documento', models.SmallIntegerField()), - ('dat_documento', models.DateField()), - ('num_protocolo', models.IntegerField(blank=True, null=True)), - ('txt_interessado', models.CharField(max_length=50, blank=True, null=True)), - ('cod_autor', models.IntegerField(blank=True, null=True)), - ('num_dias_prazo', models.IntegerField(blank=True, null=True)), - ('dat_fim_prazo', models.DateField(blank=True, null=True)), - ('ind_tramitacao', models.IntegerField()), - ('txt_assunto', models.TextField()), - ('txt_observacao', models.TextField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'documento_administrativo', - 'managed': False, - }, - ), - migrations.CreateModel( - name='ExpedienteMateria', - fields=[ - ('cod_ordem', models.AutoField(serialize=False, primary_key=True)), - ('cod_sessao_plen', models.IntegerField()), - ('cod_materia', models.IntegerField()), - ('dat_ordem', models.DateField()), - ('txt_observacao', models.TextField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ('num_ordem', models.IntegerField()), - ('txt_resultado', models.TextField(blank=True, null=True)), - ('tip_votacao', models.IntegerField()), - ], - options={ - 'db_table': 'expediente_materia', - 'managed': False, - }, - ), - migrations.CreateModel( - name='ExpedienteSessaoPlenaria', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('cod_sessao_plen', models.IntegerField()), - ('cod_expediente', models.IntegerField()), - ('txt_expediente', models.TextField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'expediente_sessao_plenaria', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Filiacao', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('dat_filiacao', models.DateField()), - ('cod_parlamentar', models.IntegerField()), - ('cod_partido', models.IntegerField()), - ('dat_desfiliacao', models.DateField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'filiacao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='LegislacaoCitada', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('cod_materia', models.IntegerField()), - ('cod_norma', models.IntegerField()), - ('des_disposicoes', models.CharField(max_length=15, blank=True, null=True)), - ('des_parte', models.CharField(max_length=8, blank=True, null=True)), - ('des_livro', models.CharField(max_length=7, blank=True, null=True)), - ('des_titulo', models.CharField(max_length=7, blank=True, null=True)), - ('des_capitulo', models.CharField(max_length=7, blank=True, null=True)), - ('des_secao', models.CharField(max_length=7, blank=True, null=True)), - ('des_subsecao', models.CharField(max_length=7, blank=True, null=True)), - ('des_artigo', models.CharField(max_length=4, blank=True, null=True)), - ('des_paragrafo', models.CharField(max_length=3, blank=True, null=True)), - ('des_inciso', models.CharField(max_length=10, blank=True, null=True)), - ('des_alinea', models.CharField(max_length=3, blank=True, null=True)), - ('des_item', models.CharField(max_length=3, blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'legislacao_citada', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Legislatura', - fields=[ - ('num_legislatura', models.IntegerField(serialize=False, primary_key=True)), - ('dat_inicio', models.DateField()), - ('dat_fim', models.DateField()), - ('dat_eleicao', models.DateField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'legislatura', - 'managed': False, - }, - ), - migrations.CreateModel( - name='LexmlRegistroProvedor', - fields=[ - ('cod_provedor', models.AutoField(serialize=False, primary_key=True)), - ('id_provedor', models.IntegerField()), - ('nom_provedor', models.CharField(max_length=255)), - ('sgl_provedor', models.CharField(max_length=15)), - ('adm_email', models.CharField(max_length=50, blank=True, null=True)), - ('nom_responsavel', models.CharField(max_length=255, blank=True, null=True)), - ('tipo', models.CharField(max_length=50)), - ('id_responsavel', models.IntegerField(blank=True, null=True)), - ('xml_provedor', models.TextField(blank=True, null=True)), - ], - options={ - 'db_table': 'lexml_registro_provedor', - 'managed': False, - }, - ), - migrations.CreateModel( - name='LexmlRegistroPublicador', - fields=[ - ('cod_publicador', models.AutoField(serialize=False, primary_key=True)), - ('id_publicador', models.IntegerField()), - ('nom_publicador', models.CharField(max_length=255)), - ('adm_email', models.CharField(max_length=50, blank=True, null=True)), - ('sigla', models.CharField(max_length=255, blank=True, null=True)), - ('nom_responsavel', models.CharField(max_length=255, blank=True, null=True)), - ('tipo', models.CharField(max_length=50)), - ('id_responsavel', models.IntegerField()), - ], - options={ - 'db_table': 'lexml_registro_publicador', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Localidade', - fields=[ - ('cod_localidade', models.IntegerField(serialize=False, primary_key=True)), - ('nom_localidade', models.CharField(max_length=50, blank=True, null=True)), - ('nom_localidade_pesq', models.CharField(max_length=50, blank=True, null=True)), - ('tip_localidade', models.CharField(max_length=1, blank=True, null=True)), - ('sgl_uf', models.CharField(max_length=2, blank=True, null=True)), - ('sgl_regiao', models.CharField(max_length=2, blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'localidade', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Mandato', - fields=[ - ('cod_mandato', models.AutoField(serialize=False, primary_key=True)), - ('cod_parlamentar', models.IntegerField()), - ('tip_afastamento', models.IntegerField(blank=True, null=True)), - ('num_legislatura', models.IntegerField()), - ('cod_coligacao', models.IntegerField(blank=True, null=True)), - ('tip_causa_fim_mandato', models.IntegerField(blank=True, null=True)), - ('dat_fim_mandato', models.DateField(blank=True, null=True)), - ('num_votos_recebidos', models.IntegerField(blank=True, null=True)), - ('dat_expedicao_diploma', models.DateField(blank=True, null=True)), - ('txt_observacao', models.TextField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'mandato', - 'managed': False, - }, - ), - migrations.CreateModel( - name='MateriaAssunto', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('cod_assunto', models.IntegerField()), - ('cod_materia', models.IntegerField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'materia_assunto', - 'managed': False, - }, - ), - migrations.CreateModel( - name='MateriaLegislativa', - fields=[ - ('cod_materia', models.AutoField(serialize=False, primary_key=True)), - ('tip_id_basica', models.IntegerField()), - ('num_protocolo', models.IntegerField(blank=True, null=True)), - ('num_ident_basica', models.IntegerField()), - ('ano_ident_basica', models.SmallIntegerField()), - ('dat_apresentacao', models.DateField(blank=True, null=True)), - ('tip_apresentacao', models.CharField(max_length=1, blank=True, null=True)), - ('cod_regime_tramitacao', models.IntegerField()), - ('dat_publicacao', models.DateField(blank=True, null=True)), - ('tip_origem_externa', models.IntegerField(blank=True, null=True)), - ('num_origem_externa', models.CharField(max_length=5, blank=True, null=True)), - ('ano_origem_externa', models.SmallIntegerField(blank=True, null=True)), - ('dat_origem_externa', models.DateField(blank=True, null=True)), - ('cod_local_origem_externa', models.IntegerField(blank=True, null=True)), - ('nom_apelido', models.CharField(max_length=50, blank=True, null=True)), - ('num_dias_prazo', models.IntegerField(blank=True, null=True)), - ('dat_fim_prazo', models.DateField(blank=True, null=True)), - ('ind_tramitacao', models.IntegerField()), - ('ind_polemica', models.IntegerField(blank=True, null=True)), - ('des_objeto', models.CharField(max_length=150, blank=True, null=True)), - ('ind_complementar', models.IntegerField(blank=True, null=True)), - ('txt_ementa', models.TextField()), - ('txt_indexacao', models.TextField(blank=True, null=True)), - ('txt_observacao', models.TextField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ('txt_resultado', models.TextField(blank=True, null=True)), - ], - options={ - 'db_table': 'materia_legislativa', - 'managed': False, - }, - ), - migrations.CreateModel( - name='MesaSessaoPlenaria', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('cod_cargo', models.IntegerField()), - ('cod_sessao_leg', models.IntegerField()), - ('cod_parlamentar', models.IntegerField()), - ('cod_sessao_plen', models.IntegerField()), - ('ind_excluido', models.IntegerField(blank=True, null=True)), - ], - options={ - 'db_table': 'mesa_sessao_plenaria', - 'managed': False, - }, - ), - migrations.CreateModel( - name='NivelInstrucao', - fields=[ - ('cod_nivel_instrucao', models.AutoField(serialize=False, primary_key=True)), - ('des_nivel_instrucao', models.CharField(max_length=50)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'nivel_instrucao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='NormaJuridica', - fields=[ - ('cod_norma', models.AutoField(serialize=False, primary_key=True)), - ('tip_norma', models.IntegerField()), - ('cod_materia', models.IntegerField(blank=True, null=True)), - ('num_norma', models.IntegerField()), - ('ano_norma', models.SmallIntegerField()), - ('tip_esfera_federacao', models.CharField(max_length=1)), - ('dat_norma', models.DateField(blank=True, null=True)), - ('dat_publicacao', models.DateField(blank=True, null=True)), - ('des_veiculo_publicacao', models.CharField(max_length=30, blank=True, null=True)), - ('num_pag_inicio_publ', models.IntegerField(blank=True, null=True)), - ('num_pag_fim_publ', models.IntegerField(blank=True, null=True)), - ('txt_ementa', models.TextField()), - ('txt_indexacao', models.TextField(blank=True, null=True)), - ('txt_observacao', models.TextField(blank=True, null=True)), - ('ind_complemento', models.IntegerField(blank=True, null=True)), - ('cod_assunto', models.CharField(max_length=16)), - ('dat_vigencia', models.DateField(blank=True, null=True)), - ('timestamp', models.DateTimeField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'norma_juridica', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Numeracao', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('cod_materia', models.IntegerField()), - ('num_ordem', models.IntegerField()), - ('tip_materia', models.IntegerField()), - ('num_materia', models.CharField(max_length=5)), - ('ano_materia', models.SmallIntegerField()), - ('dat_materia', models.DateField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'numeracao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Oradores', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('cod_sessao_plen', models.IntegerField()), - ('cod_parlamentar', models.IntegerField()), - ('num_ordem', models.IntegerField()), - ('url_discurso', models.CharField(max_length=150, blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'oradores', - 'managed': False, - }, - ), - migrations.CreateModel( - name='OradoresExpediente', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('cod_sessao_plen', models.IntegerField()), - ('cod_parlamentar', models.IntegerField()), - ('num_ordem', models.IntegerField()), - ('url_discurso', models.CharField(max_length=150, blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'oradores_expediente', - 'managed': False, - }, - ), - migrations.CreateModel( - name='OrdemDia', - fields=[ - ('cod_ordem', models.AutoField(serialize=False, primary_key=True)), - ('cod_sessao_plen', models.IntegerField()), - ('cod_materia', models.IntegerField()), - ('dat_ordem', models.DateField()), - ('txt_observacao', models.TextField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ('num_ordem', models.IntegerField()), - ('txt_resultado', models.TextField(blank=True, null=True)), - ('tip_votacao', models.IntegerField()), - ], - options={ - 'db_table': 'ordem_dia', - 'managed': False, - }, - ), - migrations.CreateModel( - name='OrdemDiaPresenca', - fields=[ - ('cod_presenca_ordem_dia', models.AutoField(serialize=False, primary_key=True)), - ('cod_sessao_plen', models.IntegerField()), - ('cod_parlamentar', models.IntegerField()), - ('dat_ordem', models.DateField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'ordem_dia_presenca', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Orgao', - fields=[ - ('cod_orgao', models.AutoField(serialize=False, primary_key=True)), - ('nom_orgao', models.CharField(max_length=60)), - ('sgl_orgao', models.CharField(max_length=10)), - ('ind_unid_deliberativa', models.IntegerField()), - ('end_orgao', models.CharField(max_length=100, blank=True, null=True)), - ('num_tel_orgao', models.CharField(max_length=50, blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'orgao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Origem', - fields=[ - ('cod_origem', models.AutoField(serialize=False, primary_key=True)), - ('sgl_origem', models.CharField(max_length=10)), - ('nom_origem', models.CharField(max_length=50)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'origem', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Parecer', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('cod_relatoria', models.IntegerField()), - ('cod_materia', models.IntegerField()), - ('tip_conclusao', models.CharField(max_length=3, blank=True, null=True)), - ('tip_apresentacao', models.CharField(max_length=1)), - ('txt_parecer', models.TextField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'parecer', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Parlamentar', - fields=[ - ('cod_parlamentar', models.AutoField(serialize=False, primary_key=True)), - ('cod_nivel_instrucao', models.IntegerField(blank=True, null=True)), - ('tip_situacao_militar', models.IntegerField(blank=True, null=True)), - ('nom_completo', models.CharField(max_length=50)), - ('nom_parlamentar', models.CharField(max_length=50, blank=True, null=True)), - ('sex_parlamentar', models.CharField(max_length=1)), - ('dat_nascimento', models.DateField(blank=True, null=True)), - ('num_cpf', models.CharField(max_length=14, blank=True, null=True)), - ('num_rg', models.CharField(max_length=15, blank=True, null=True)), - ('num_tit_eleitor', models.CharField(max_length=15, blank=True, null=True)), - ('cod_casa', models.IntegerField()), - ('num_gab_parlamentar', models.CharField(max_length=10, blank=True, null=True)), - ('num_tel_parlamentar', models.CharField(max_length=50, blank=True, null=True)), - ('num_fax_parlamentar', models.CharField(max_length=50, blank=True, null=True)), - ('end_residencial', models.CharField(max_length=100, blank=True, null=True)), - ('cod_localidade_resid', models.IntegerField(blank=True, null=True)), - ('num_cep_resid', models.CharField(max_length=9, blank=True, null=True)), - ('num_tel_resid', models.CharField(max_length=50, blank=True, null=True)), - ('num_fax_resid', models.CharField(max_length=50, blank=True, null=True)), - ('end_web', models.CharField(max_length=100, blank=True, null=True)), - ('nom_profissao', models.CharField(max_length=50, blank=True, null=True)), - ('end_email', models.CharField(max_length=100, blank=True, null=True)), - ('des_local_atuacao', models.CharField(max_length=100, blank=True, null=True)), - ('ind_ativo', models.IntegerField()), - ('txt_biografia', models.TextField(blank=True, null=True)), - ('ind_unid_deliberativa', models.IntegerField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'parlamentar', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Partido', - fields=[ - ('cod_partido', models.AutoField(serialize=False, primary_key=True)), - ('sgl_partido', models.CharField(max_length=9)), - ('nom_partido', models.CharField(max_length=50)), - ('dat_criacao', models.DateField(blank=True, null=True)), - ('dat_extincao', models.DateField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'partido', - 'managed': False, - }, - ), - migrations.CreateModel( - name='PeriodoCompComissao', - fields=[ - ('cod_periodo_comp', models.AutoField(serialize=False, primary_key=True)), - ('dat_inicio_periodo', models.DateField()), - ('dat_fim_periodo', models.DateField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'periodo_comp_comissao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Proposicao', - fields=[ - ('cod_proposicao', models.AutoField(serialize=False, primary_key=True)), - ('cod_materia', models.IntegerField(blank=True, null=True)), - ('cod_autor', models.IntegerField()), - ('tip_proposicao', models.IntegerField()), - ('dat_envio', models.DateTimeField()), - ('dat_recebimento', models.DateTimeField(blank=True, null=True)), - ('txt_descricao', models.CharField(max_length=100)), - ('cod_mat_ou_doc', models.IntegerField(blank=True, null=True)), - ('dat_devolucao', models.DateTimeField(blank=True, null=True)), - ('txt_justif_devolucao', models.CharField(max_length=200, blank=True, null=True)), - ('num_proposicao', models.IntegerField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'proposicao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Protocolo', - fields=[ - ('cod_protocolo', models.AutoField(serialize=False, primary_key=True)), - ('num_protocolo', models.IntegerField(blank=True, null=True)), - ('ano_protocolo', models.SmallIntegerField()), - ('dat_protocolo', models.DateField()), - ('hor_protocolo', models.TimeField()), - ('dat_timestamp', models.DateTimeField()), - ('tip_protocolo', models.IntegerField()), - ('tip_processo', models.IntegerField()), - ('txt_interessado', models.CharField(max_length=60, blank=True, null=True)), - ('cod_autor', models.IntegerField(blank=True, null=True)), - ('txt_assunto_ementa', models.TextField(blank=True, null=True)), - ('tip_documento', models.IntegerField(blank=True, null=True)), - ('tip_materia', models.IntegerField(blank=True, null=True)), - ('num_paginas', models.IntegerField(blank=True, null=True)), - ('txt_observacao', models.TextField(blank=True, null=True)), - ('ind_anulado', models.IntegerField()), - ('txt_user_anulacao', models.CharField(max_length=20, blank=True, null=True)), - ('txt_ip_anulacao', models.CharField(max_length=15, blank=True, null=True)), - ('txt_just_anulacao', models.CharField(max_length=60, blank=True, null=True)), - ('timestamp_anulacao', models.DateTimeField(blank=True, null=True)), - ], - options={ - 'db_table': 'protocolo', - 'managed': False, - }, - ), - migrations.CreateModel( - name='RegimeTramitacao', - fields=[ - ('cod_regime_tramitacao', models.AutoField(serialize=False, primary_key=True)), - ('des_regime_tramitacao', models.CharField(max_length=50)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'regime_tramitacao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='RegistroVotacao', - fields=[ - ('cod_votacao', models.AutoField(serialize=False, primary_key=True)), - ('tip_resultado_votacao', models.IntegerField()), - ('cod_materia', models.IntegerField()), - ('cod_ordem', models.IntegerField()), - ('num_votos_sim', models.IntegerField()), - ('num_votos_nao', models.IntegerField()), - ('num_abstencao', models.IntegerField()), - ('txt_observacao', models.TextField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'registro_votacao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='RegistroVotacaoParlamentar', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')), - ('cod_votacao', models.IntegerField()), - ('cod_parlamentar', models.IntegerField()), - ('ind_excluido', models.IntegerField()), - ('vot_parlamentar', models.CharField(max_length=10)), - ], - options={ - 'db_table': 'registro_votacao_parlamentar', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Relatoria', - fields=[ - ('cod_relatoria', models.AutoField(serialize=False, primary_key=True)), - ('cod_materia', models.IntegerField()), - ('cod_parlamentar', models.IntegerField()), - ('tip_fim_relatoria', models.IntegerField(blank=True, null=True)), - ('cod_comissao', models.IntegerField(blank=True, null=True)), - ('dat_desig_relator', models.DateField()), - ('dat_destit_relator', models.DateField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'relatoria', - 'managed': False, - }, - ), - migrations.CreateModel( - name='SessaoLegislativa', - fields=[ - ('cod_sessao_leg', models.AutoField(serialize=False, primary_key=True)), - ('num_legislatura', models.IntegerField()), - ('num_sessao_leg', models.IntegerField()), - ('tip_sessao_leg', models.CharField(max_length=1)), - ('dat_inicio', models.DateField()), - ('dat_fim', models.DateField()), - ('dat_inicio_intervalo', models.DateField(blank=True, null=True)), - ('dat_fim_intervalo', models.DateField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'sessao_legislativa', - 'managed': False, - }, - ), - migrations.CreateModel( - name='SessaoPlenaria', - fields=[ - ('cod_sessao_plen', models.AutoField(serialize=False, primary_key=True)), - ('cod_andamento_sessao', models.IntegerField(blank=True, null=True)), - ('tip_sessao', models.IntegerField()), - ('cod_sessao_leg', models.IntegerField()), - ('num_legislatura', models.IntegerField()), - ('tip_expediente', models.CharField(max_length=10)), - ('dat_inicio_sessao', models.DateField()), - ('dia_sessao', models.CharField(max_length=15)), - ('hr_inicio_sessao', models.CharField(max_length=5)), - ('hr_fim_sessao', models.CharField(max_length=5, blank=True, null=True)), - ('num_sessao_plen', models.IntegerField()), - ('dat_fim_sessao', models.DateField(blank=True, null=True)), - ('url_audio', models.CharField(max_length=150, blank=True, null=True)), - ('url_video', models.CharField(max_length=150, blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'sessao_plenaria', - 'managed': False, - }, - ), - migrations.CreateModel( - name='SessaoPlenariaPresenca', - fields=[ - ('cod_presenca_sessao', models.AutoField(serialize=False, primary_key=True)), - ('cod_sessao_plen', models.IntegerField()), - ('cod_parlamentar', models.IntegerField()), - ('dat_sessao', models.DateField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'sessao_plenaria_presenca', - 'managed': False, - }, - ), - migrations.CreateModel( - name='SituacaoMilitar', - fields=[ - ('tip_situacao_militar', models.IntegerField(serialize=False, primary_key=True)), - ('des_tipo_situacao', models.CharField(max_length=50)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tipo_situacao_militar', - 'managed': False, - }, - ), - migrations.CreateModel( - name='StatusTramitacao', - fields=[ - ('cod_status', models.AutoField(serialize=False, primary_key=True)), - ('sgl_status', models.CharField(max_length=10)), - ('des_status', models.CharField(max_length=60)), - ('ind_fim_tramitacao', models.IntegerField()), - ('ind_retorno_tramitacao', models.IntegerField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'status_tramitacao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='StatusTramitacaoAdministrativo', - fields=[ - ('cod_status', models.AutoField(serialize=False, primary_key=True)), - ('sgl_status', models.CharField(max_length=10)), - ('des_status', models.CharField(max_length=60)), - ('ind_fim_tramitacao', models.IntegerField()), - ('ind_retorno_tramitacao', models.IntegerField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'status_tramitacao_administrativo', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TipoAfastamento', - fields=[ - ('tip_afastamento', models.AutoField(serialize=False, primary_key=True)), - ('des_afastamento', models.CharField(max_length=50)), - ('ind_afastamento', models.IntegerField()), - ('ind_fim_mandato', models.IntegerField()), - ('des_dispositivo', models.CharField(max_length=50, blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tipo_afastamento', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TipoAutor', - fields=[ - ('tip_autor', models.IntegerField(serialize=False, primary_key=True)), - ('des_tipo_autor', models.CharField(max_length=50)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tipo_autor', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TipoComissao', - fields=[ - ('tip_comissao', models.AutoField(serialize=False, primary_key=True)), - ('nom_tipo_comissao', models.CharField(max_length=50)), - ('sgl_natureza_comissao', models.CharField(max_length=1)), - ('sgl_tipo_comissao', models.CharField(max_length=10)), - ('des_dispositivo_regimental', models.CharField(max_length=50, blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tipo_comissao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TipoDependente', - fields=[ - ('tip_dependente', models.AutoField(serialize=False, primary_key=True)), - ('des_tipo_dependente', models.CharField(max_length=50)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tipo_dependente', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TipoDocumento', - fields=[ - ('tip_documento', models.AutoField(serialize=False, primary_key=True)), - ('des_tipo_documento', models.CharField(max_length=50)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tipo_documento', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TipoDocumentoAdministrativo', - fields=[ - ('tip_documento', models.AutoField(serialize=False, primary_key=True)), - ('sgl_tipo_documento', models.CharField(max_length=5)), - ('des_tipo_documento', models.CharField(max_length=50)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tipo_documento_administrativo', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TipoExpediente', - fields=[ - ('cod_expediente', models.AutoField(serialize=False, primary_key=True)), - ('nom_expediente', models.CharField(max_length=100)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tipo_expediente', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TipoFimRelatoria', - fields=[ - ('tip_fim_relatoria', models.AutoField(serialize=False, primary_key=True)), - ('des_fim_relatoria', models.CharField(max_length=50)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tipo_fim_relatoria', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TipoMateriaLegislativa', - fields=[ - ('tip_materia', models.AutoField(serialize=False, primary_key=True)), - ('sgl_tipo_materia', models.CharField(max_length=5)), - ('des_tipo_materia', models.CharField(max_length=50)), - ('ind_num_automatica', models.IntegerField()), - ('quorum_minimo_votacao', models.IntegerField()), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tipo_materia_legislativa', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TipoNormaJuridica', - fields=[ - ('tip_norma', models.AutoField(serialize=False, primary_key=True)), - ('voc_lexml', models.CharField(max_length=50, blank=True, null=True)), - ('sgl_tipo_norma', models.CharField(max_length=3)), - ('des_tipo_norma', models.CharField(max_length=50)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tipo_norma_juridica', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TipoProposicao', - fields=[ - ('tip_proposicao', models.AutoField(serialize=False, primary_key=True)), - ('des_tipo_proposicao', models.CharField(max_length=50)), - ('ind_mat_ou_doc', models.CharField(max_length=1)), - ('tip_mat_ou_doc', models.IntegerField()), - ('nom_modelo', models.CharField(max_length=50)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tipo_proposicao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TipoResultadoVotacao', - fields=[ - ('tip_resultado_votacao', models.AutoField(serialize=False, primary_key=True)), - ('nom_resultado', models.CharField(max_length=100)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tipo_resultado_votacao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TipoSessaoPlenaria', - fields=[ - ('tip_sessao', models.AutoField(serialize=False, primary_key=True)), - ('nom_sessao', models.CharField(max_length=30)), - ('ind_excluido', models.IntegerField()), - ('num_minimo', models.IntegerField()), - ], - options={ - 'db_table': 'tipo_sessao_plenaria', - 'managed': False, - }, - ), - migrations.CreateModel( - name='Tramitacao', - fields=[ - ('cod_tramitacao', models.AutoField(serialize=False, primary_key=True)), - ('cod_status', models.IntegerField(blank=True, null=True)), - ('cod_materia', models.IntegerField()), - ('dat_tramitacao', models.DateField(blank=True, null=True)), - ('cod_unid_tram_local', models.IntegerField(blank=True, null=True)), - ('dat_encaminha', models.DateField(blank=True, null=True)), - ('cod_unid_tram_dest', models.IntegerField(blank=True, null=True)), - ('ind_ult_tramitacao', models.IntegerField()), - ('ind_urgencia', models.IntegerField()), - ('sgl_turno', models.CharField(max_length=1, blank=True, null=True)), - ('txt_tramitacao', models.TextField(blank=True, null=True)), - ('dat_fim_prazo', models.DateField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tramitacao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='TramitacaoAdministrativo', - fields=[ - ('cod_tramitacao', models.AutoField(serialize=False, primary_key=True)), - ('cod_documento', models.IntegerField()), - ('dat_tramitacao', models.DateField(blank=True, null=True)), - ('cod_unid_tram_local', models.IntegerField(blank=True, null=True)), - ('dat_encaminha', models.DateField(blank=True, null=True)), - ('cod_unid_tram_dest', models.IntegerField(blank=True, null=True)), - ('cod_status', models.IntegerField(blank=True, null=True)), - ('ind_ult_tramitacao', models.IntegerField()), - ('txt_tramitacao', models.TextField(blank=True, null=True)), - ('dat_fim_prazo', models.DateField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'tramitacao_administrativo', - 'managed': False, - }, - ), - migrations.CreateModel( - name='UnidadeTramitacao', - fields=[ - ('cod_unid_tramitacao', models.AutoField(serialize=False, primary_key=True)), - ('cod_comissao', models.IntegerField(blank=True, null=True)), - ('cod_orgao', models.IntegerField(blank=True, null=True)), - ('cod_parlamentar', models.IntegerField(blank=True, null=True)), - ('ind_excluido', models.IntegerField()), - ], - options={ - 'db_table': 'unidade_tramitacao', - 'managed': False, - }, - ), - migrations.CreateModel( - name='VinculoNormaJuridica', - fields=[ - ('cod_vinculo', models.AutoField(serialize=False, primary_key=True)), - ('cod_norma_referente', models.IntegerField()), - ('cod_norma_referida', models.IntegerField()), - ('tip_vinculo', models.CharField(max_length=1, blank=True, null=True)), - ('ind_excluido', models.CharField(max_length=1)), - ], - options={ - 'db_table': 'vinculo_norma_juridica', - 'managed': False, - }, - ), - ] diff --git a/sapl/legacy/migrations/__init__.py b/sapl/legacy/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/sapl/lexml/migrations/0001_initial.py b/sapl/lexml/migrations/0001_initial.py index 6a2e21391..d79f15080 100644 --- a/sapl/lexml/migrations/0001_initial.py +++ b/sapl/lexml/migrations/0001_initial.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 11:14 from __future__ import unicode_literals from django.db import migrations, models @@ -6,6 +7,8 @@ from django.db import migrations, models class Migration(migrations.Migration): + initial = True + dependencies = [ ] @@ -13,36 +16,36 @@ class Migration(migrations.Migration): migrations.CreateModel( name='LexmlProvedor', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('id_provedor', models.IntegerField(verbose_name='Id do provedor')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('id_provedor', models.PositiveIntegerField(verbose_name='Id do provedor')), ('nome', models.CharField(max_length=255, verbose_name='Nome do provedor')), ('sigla', models.CharField(max_length=15)), - ('email_responsavel', models.CharField(blank=True, max_length=50, null=True, verbose_name='E-mail do responsável')), - ('nome_responsavel', models.CharField(blank=True, max_length=255, null=True, verbose_name='Nome do responsável')), + ('email_responsavel', models.EmailField(blank=True, max_length=50, verbose_name='E-mail do responsável')), + ('nome_responsavel', models.CharField(blank=True, max_length=255, verbose_name='Nome do responsável')), ('tipo', models.CharField(max_length=50)), - ('id_responsavel', models.IntegerField(blank=True, null=True, verbose_name='Id do responsável')), - ('xml', models.TextField(blank=True, null=True, verbose_name='XML fornecido pela equipe do LexML:')), + ('id_responsavel', models.PositiveIntegerField(blank=True, null=True, verbose_name='Id do responsável')), + ('xml', models.TextField(blank=True, verbose_name='XML fornecido pela equipe do LexML:')), ], options={ - 'verbose_name_plural': 'Provedores Lexml', 'verbose_name': 'Provedor Lexml', + 'verbose_name_plural': 'Provedores Lexml', }, ), migrations.CreateModel( name='LexmlPublicador', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('id_publicador', models.IntegerField(verbose_name='Id do publicador')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('id_publicador', models.PositiveIntegerField(verbose_name='Id do publicador')), ('nome', models.CharField(max_length=255, verbose_name='Nome do publicador')), - ('email_responsavel', models.CharField(blank=True, max_length=50, null=True, verbose_name='E-mail do responsável')), - ('sigla', models.CharField(blank=True, max_length=255, null=True, verbose_name='Sigla do Publicador')), - ('nome_responsavel', models.CharField(blank=True, max_length=255, null=True, verbose_name='Nome do responsável')), + ('email_responsavel', models.EmailField(blank=True, max_length=50, verbose_name='E-mail do responsável')), + ('sigla', models.CharField(blank=True, max_length=255, verbose_name='Sigla do Publicador')), + ('nome_responsavel', models.CharField(blank=True, max_length=255, verbose_name='Nome do responsável')), ('tipo', models.CharField(max_length=50)), - ('id_responsavel', models.IntegerField(verbose_name='Id do responsável')), + ('id_responsavel', models.PositiveIntegerField(verbose_name='Id do responsável')), ], options={ - 'verbose_name_plural': 'Publicadores Lexml', 'verbose_name': 'Publicador Lexml', + 'verbose_name_plural': 'Publicadores Lexml', }, ), ] diff --git a/sapl/lexml/migrations/0002_auto_20150806_1614.py b/sapl/lexml/migrations/0002_auto_20150806_1614.py deleted file mode 100644 index b0ae800e0..000000000 --- a/sapl/lexml/migrations/0002_auto_20150806_1614.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('lexml', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='lexmlprovedor', - name='id_provedor', - field=models.PositiveIntegerField(verbose_name='Id do provedor'), - ), - migrations.AlterField( - model_name='lexmlprovedor', - name='id_responsavel', - field=models.PositiveIntegerField(blank=True, null=True, verbose_name='Id do responsável'), - ), - migrations.AlterField( - model_name='lexmlpublicador', - name='id_publicador', - field=models.PositiveIntegerField(verbose_name='Id do publicador'), - ), - migrations.AlterField( - model_name='lexmlpublicador', - name='id_responsavel', - field=models.PositiveIntegerField(verbose_name='Id do responsável'), - ), - ] diff --git a/sapl/lexml/migrations/0003_auto_20160216_1015.py b/sapl/lexml/migrations/0003_auto_20160216_1015.py deleted file mode 100644 index 245da6911..000000000 --- a/sapl/lexml/migrations/0003_auto_20160216_1015.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('lexml', '0002_auto_20150806_1614'), - ] - - operations = [ - migrations.AlterField( - model_name='lexmlprovedor', - name='email_responsavel', - field=models.CharField(verbose_name='E-mail do responsável', max_length=50, blank=True), - ), - migrations.AlterField( - model_name='lexmlprovedor', - name='nome_responsavel', - field=models.CharField(verbose_name='Nome do responsável', max_length=255, blank=True), - ), - migrations.AlterField( - model_name='lexmlprovedor', - name='xml', - field=models.TextField(verbose_name='XML fornecido pela equipe do LexML:', blank=True), - ), - migrations.AlterField( - model_name='lexmlpublicador', - name='email_responsavel', - field=models.CharField(verbose_name='E-mail do responsável', max_length=50, blank=True), - ), - migrations.AlterField( - model_name='lexmlpublicador', - name='nome_responsavel', - field=models.CharField(verbose_name='Nome do responsável', max_length=255, blank=True), - ), - migrations.AlterField( - model_name='lexmlpublicador', - name='sigla', - field=models.CharField(verbose_name='Sigla do Publicador', max_length=255, blank=True), - ), - ] diff --git a/sapl/lexml/migrations/0004_auto_20160307_0918.py b/sapl/lexml/migrations/0004_auto_20160307_0918.py deleted file mode 100644 index c6f31833e..000000000 --- a/sapl/lexml/migrations/0004_auto_20160307_0918.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-07 12:18 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('lexml', '0003_auto_20160216_1015'), - ] - - operations = [ - migrations.AlterField( - model_name='lexmlprovedor', - name='email_responsavel', - field=models.EmailField(blank=True, max_length=50, verbose_name='E-mail do responsável'), - ), - migrations.AlterField( - model_name='lexmlpublicador', - name='email_responsavel', - field=models.EmailField(blank=True, max_length=50, verbose_name='E-mail do responsável'), - ), - ] diff --git a/sapl/materia/migrations/0001_initial.py b/sapl/materia/migrations/0001_initial.py index 0552b7edb..9993a4e22 100644 --- a/sapl/materia/migrations/0001_initial.py +++ b/sapl/materia/migrations/0001_initial.py @@ -1,451 +1,449 @@ # -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 11:14 from __future__ import unicode_literals from django.db import migrations, models +import django.db.models.deletion +import sapl.utils class Migration(migrations.Migration): + initial = True + dependencies = [ - ('parlamentares', '0001_initial'), + ('base', '0001_initial'), + ('contenttypes', '0002_remove_content_type_name'), ('comissoes', '0001_initial'), + ('compilacao', '0001_initial'), + ('parlamentares', '0001_initial'), ] operations = [ migrations.CreateModel( name='AcompanhamentoMateria', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('email', models.CharField(max_length=100, verbose_name='Endereço de E-mail')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('usuario', models.CharField(max_length=50)), + ('email', models.EmailField(max_length=100, verbose_name='E-mail')), + ('data_cadastro', models.DateField(auto_now_add=True)), ('hash', models.CharField(max_length=8)), + ('confirmado', models.BooleanField(default=False)), ], options={ - 'verbose_name_plural': 'Acompanhamentos de Matéria', 'verbose_name': 'Acompanhamento de Matéria', + 'verbose_name_plural': 'Acompanhamentos de Matéria', }, ), migrations.CreateModel( name='Anexada', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('data_anexacao', models.DateField(verbose_name='Data Anexação')), ('data_desanexacao', models.DateField(blank=True, null=True, verbose_name='Data Desanexação')), ], options={ - 'verbose_name_plural': 'Anexadas', 'verbose_name': 'Anexada', + 'verbose_name_plural': 'Anexadas', }, ), migrations.CreateModel( name='AssuntoMateria', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('assunto', models.CharField(max_length=200)), ('dispositivo', models.CharField(max_length=50)), ], options={ - 'verbose_name_plural': 'Assuntos de Matéria', 'verbose_name': 'Assunto de Matéria', - }, - ), - migrations.CreateModel( - name='Autor', - fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('nome', models.CharField(blank=True, max_length=50, null=True, verbose_name='Autor')), - ('cargo', models.CharField(blank=True, max_length=50, null=True)), - ('username', models.CharField(blank=True, max_length=50, null=True)), - ('comissao', models.ForeignKey(blank=True, null=True, to='comissoes.Comissao')), - ('parlamentar', models.ForeignKey(blank=True, null=True, to='parlamentares.Parlamentar')), - ('partido', models.ForeignKey(blank=True, null=True, to='parlamentares.Partido')), - ], - options={ - 'verbose_name_plural': 'Autores', - 'verbose_name': 'Autor', + 'verbose_name_plural': 'Assuntos de Matéria', }, ), migrations.CreateModel( name='Autoria', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('primeiro_autor', models.BooleanField(verbose_name='Primeiro Autor')), - ('autor', models.ForeignKey(to='materia.Autor')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('primeiro_autor', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Primeiro Autor')), + ('autor', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='base.Autor', verbose_name='Autor')), ], options={ - 'verbose_name_plural': 'Autorias', 'verbose_name': 'Autoria', + 'verbose_name_plural': 'Autorias', }, ), migrations.CreateModel( name='DespachoInicial', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('numero_ordem', models.IntegerField()), - ('comissao', models.ForeignKey(to='comissoes.Comissao')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('comissao', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.Comissao')), ], options={ - 'verbose_name_plural': 'Despachos Iniciais', 'verbose_name': 'Despacho Inicial', + 'verbose_name_plural': 'Despachos Iniciais', }, ), migrations.CreateModel( name='DocumentoAcessorio', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('nome', models.CharField(max_length=30, verbose_name='Descrição')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('nome', models.CharField(max_length=30, verbose_name='Nome')), ('data', models.DateField(blank=True, null=True, verbose_name='Data')), - ('autor', models.CharField(blank=True, max_length=50, null=True, verbose_name='Autor')), - ('ementa', models.TextField(blank=True, null=True, verbose_name='Ementa')), - ('indexacao', models.TextField(blank=True, null=True)), + ('autor', models.CharField(blank=True, max_length=50, verbose_name='Autor')), + ('ementa', models.TextField(blank=True, verbose_name='Ementa')), + ('indexacao', models.TextField(blank=True)), + ('arquivo', models.FileField(blank=True, null=True, upload_to=sapl.utils.texto_upload_path, validators=[sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Texto Integral')), ], options={ - 'verbose_name_plural': 'Documentos Acessórios', 'verbose_name': 'Documento Acessório', + 'verbose_name_plural': 'Documentos Acessórios', }, ), migrations.CreateModel( name='MateriaAssunto', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('assunto', models.ForeignKey(to='materia.AssuntoMateria')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('assunto', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.AssuntoMateria')), ], options={ - 'verbose_name_plural': 'Relações Matéria - Assunto', 'verbose_name': 'Relação Matéria - Assunto', + 'verbose_name_plural': 'Relações Matéria - Assunto', }, ), migrations.CreateModel( name='MateriaLegislativa', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('numero', models.IntegerField(verbose_name='Número')), - ('ano', models.SmallIntegerField(verbose_name='Ano')), - ('numero_protocolo', models.IntegerField(blank=True, null=True, verbose_name='Núm. Protocolo')), - ('data_apresentacao', models.DateField(blank=True, null=True, verbose_name='Data Apresentação')), - ('tipo_apresentacao', models.CharField(blank=True, max_length=1, null=True, verbose_name='Tipo de Apresentação', choices=[('O', 'Oral'), ('E', 'Escrita')])), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('numero', models.PositiveIntegerField(verbose_name='Número')), + ('ano', models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano')), + ('numero_protocolo', models.PositiveIntegerField(blank=True, null=True, verbose_name='Núm. Protocolo')), + ('data_apresentacao', models.DateField(verbose_name='Data Apresentação')), + ('tipo_apresentacao', models.CharField(blank=True, choices=[('O', 'Oral'), ('E', 'Escrita')], max_length=1, verbose_name='Tipo de Apresentação')), ('data_publicacao', models.DateField(blank=True, null=True, verbose_name='Data Publicação')), - ('numero_origem_externa', models.CharField(blank=True, max_length=5, null=True, verbose_name='Número')), - ('ano_origem_externa', models.SmallIntegerField(blank=True, null=True, verbose_name='Ano')), + ('numero_origem_externa', models.CharField(blank=True, max_length=5, verbose_name='Número')), + ('ano_origem_externa', models.PositiveSmallIntegerField(blank=True, choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], null=True, verbose_name='Ano')), ('data_origem_externa', models.DateField(blank=True, null=True, verbose_name='Data')), - ('apelido', models.CharField(blank=True, max_length=50, null=True, verbose_name='Apelido')), - ('dias_prazo', models.IntegerField(blank=True, null=True, verbose_name='Dias Prazo')), + ('apelido', models.CharField(blank=True, max_length=50, verbose_name='Apelido')), + ('dias_prazo', models.PositiveIntegerField(blank=True, null=True, verbose_name='Dias Prazo')), ('data_fim_prazo', models.DateField(blank=True, null=True, verbose_name='Data Fim Prazo')), - ('em_tramitacao', models.BooleanField(verbose_name='Em Tramitação?')), + ('em_tramitacao', models.BooleanField(choices=[(1, 'Sim'), (0, 'Não')], default=False, verbose_name='Em Tramitação?')), ('polemica', models.NullBooleanField(verbose_name='Matéria Polêmica?')), - ('objeto', models.CharField(blank=True, max_length=150, null=True, verbose_name='Objeto')), + ('objeto', models.CharField(blank=True, max_length=150, verbose_name='Objeto')), ('complementar', models.NullBooleanField(verbose_name='É Complementar?')), ('ementa', models.TextField(verbose_name='Ementa')), - ('indexacao', models.TextField(blank=True, null=True, verbose_name='Indexação')), - ('observacao', models.TextField(blank=True, null=True, verbose_name='Observação')), - ('resultado', models.TextField(blank=True, null=True)), - ('anexadas', models.ManyToManyField(to='materia.MateriaLegislativa', through='materia.Anexada', related_name='anexo_de')), + ('indexacao', models.TextField(blank=True, verbose_name='Indexação')), + ('observacao', models.TextField(blank=True, verbose_name='Observação')), + ('resultado', models.TextField(blank=True)), + ('texto_original', models.FileField(blank=True, null=True, upload_to=sapl.utils.texto_upload_path, validators=[sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Texto Original')), + ('anexadas', models.ManyToManyField(blank=True, related_name='anexo_de', through='materia.Anexada', to='materia.MateriaLegislativa')), + ('autores', models.ManyToManyField(through='materia.Autoria', to='base.Autor')), ], options={ - 'verbose_name_plural': 'Matérias Legislativas', 'verbose_name': 'Matéria Legislativa', + 'verbose_name_plural': 'Matérias Legislativas', }, ), migrations.CreateModel( name='Numeracao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('numero_ordem', models.IntegerField()), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('numero_materia', models.CharField(max_length=5, verbose_name='Número')), - ('ano_materia', models.SmallIntegerField(verbose_name='Ano')), - ('data_materia', models.DateField(blank=True, null=True, verbose_name='Data')), - ('materia', models.ForeignKey(to='materia.MateriaLegislativa')), + ('ano_materia', models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano')), + ('data_materia', models.DateField(verbose_name='Data')), + ('materia', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa')), ], options={ - 'verbose_name_plural': 'Numerações', + 'ordering': ('materia', 'tipo_materia', 'numero_materia', 'ano_materia', 'data_materia'), 'verbose_name': 'Numeração', + 'verbose_name_plural': 'Numerações', }, ), migrations.CreateModel( name='Orgao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nome', models.CharField(max_length=60, verbose_name='Nome')), ('sigla', models.CharField(max_length=10, verbose_name='Sigla')), - ('unidade_deliberativa', models.BooleanField(verbose_name='Unidade Deliberativa')), - ('endereco', models.CharField(blank=True, max_length=100, null=True, verbose_name='Endereço')), - ('telefone', models.CharField(blank=True, max_length=50, null=True, verbose_name='Telefone')), + ('unidade_deliberativa', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Unidade Deliberativa')), + ('endereco', models.CharField(blank=True, max_length=100, verbose_name='Endereço')), + ('telefone', models.CharField(blank=True, max_length=50, verbose_name='Telefone')), ], options={ - 'verbose_name_plural': 'Órgãos', 'verbose_name': 'Órgão', + 'verbose_name_plural': 'Órgãos', }, ), migrations.CreateModel( name='Origem', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('sigla', models.CharField(max_length=10, verbose_name='Sigla')), ('nome', models.CharField(max_length=50, verbose_name='Nome')), ], options={ - 'verbose_name_plural': 'Origens', 'verbose_name': 'Origem', + 'verbose_name_plural': 'Origens', }, ), migrations.CreateModel( name='Parecer', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('tipo_conclusao', models.CharField(blank=True, max_length=3, null=True)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('tipo_conclusao', models.CharField(blank=True, max_length=3)), ('tipo_apresentacao', models.CharField(choices=[('O', 'Oral'), ('E', 'Escrita')], max_length=1)), - ('parecer', models.TextField(blank=True, null=True)), - ('materia', models.ForeignKey(to='materia.MateriaLegislativa')), + ('parecer', models.TextField(blank=True)), + ('materia', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa')), ], options={ - 'verbose_name_plural': 'Pareceres', 'verbose_name': 'Parecer', + 'verbose_name_plural': 'Pareceres', }, ), migrations.CreateModel( name='Proposicao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('data_envio', models.DateTimeField(null=True, verbose_name='Data de Envio')), - ('data_recebimento', models.DateTimeField(blank=True, null=True, verbose_name='Data de Incorporação')), - ('descricao', models.CharField(max_length=100, verbose_name='Descrição')), - ('data_devolucao', models.DateTimeField(blank=True, null=True, verbose_name='Data de devolução')), - ('justificativa_devolucao', models.CharField(blank=True, max_length=200, null=True, verbose_name='Justificativa da Devolução')), - ('numero_proposicao', models.IntegerField(blank=True, null=True, verbose_name='Número')), - ('autor', models.ForeignKey(to='materia.Autor')), - ('documento', models.ForeignKey(blank=True, null=True, to='materia.DocumentoAcessorio', verbose_name='Documento')), - ('materia', models.ForeignKey(blank=True, null=True, to='materia.MateriaLegislativa', verbose_name='Matéria')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('data_envio', models.DateTimeField(blank=True, null=True, verbose_name='Data de Envio')), + ('data_recebimento', models.DateTimeField(blank=True, null=True, verbose_name='Data de Recebimento')), + ('data_devolucao', models.DateTimeField(blank=True, null=True, verbose_name='Data de Devolução')), + ('descricao', models.TextField(verbose_name='Descrição')), + ('justificativa_devolucao', models.CharField(blank=True, max_length=200, verbose_name='Justificativa da Devolução')), + ('ano', models.PositiveSmallIntegerField(blank=True, choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=None, null=True, verbose_name='Ano')), + ('numero_proposicao', models.PositiveIntegerField(blank=True, null=True, verbose_name='Número')), + ('status', models.CharField(blank=True, choices=[('E', 'Enviada'), ('R', 'Recebida'), ('I', 'Incorporada')], max_length=1, verbose_name='Status Proposição')), + ('texto_original', models.FileField(blank=True, null=True, upload_to=sapl.utils.texto_upload_path, validators=[sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Texto Original')), + ('object_id', models.PositiveIntegerField(blank=True, default=None, null=True)), + ('autor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='base.Autor')), + ('content_type', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType', verbose_name='Tipo de Material Gerado')), + ('materia_de_vinculo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='proposicao_set', to='materia.MateriaLegislativa', verbose_name='Matéria anexadora')), ], options={ - 'verbose_name_plural': 'Proposições', + 'permissions': (('detail_proposicao_enviada', 'Pode acessar detalhes de uma proposição enviada.'), ('detail_proposicao_devolvida', 'Pode acessar detalhes de uma proposição devolvida.'), ('detail_proposicao_incorporada', 'Pode acessar detalhes de uma proposição incorporada.')), 'verbose_name': 'Proposição', + 'verbose_name_plural': 'Proposições', }, ), migrations.CreateModel( name='RegimeTramitacao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('descricao', models.CharField(max_length=50)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('descricao', models.CharField(max_length=50, verbose_name='Descrição')), ], options={ - 'verbose_name_plural': 'Regimes Tramitação', 'verbose_name': 'Regime Tramitação', + 'verbose_name_plural': 'Regimes Tramitação', }, ), migrations.CreateModel( name='Relatoria', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('data_designacao_relator', models.DateField(verbose_name='Data Designação')), ('data_destituicao_relator', models.DateField(blank=True, null=True, verbose_name='Data Destituição')), - ('comissao', models.ForeignKey(blank=True, null=True, to='comissoes.Comissao', verbose_name='Localização Atual')), - ('materia', models.ForeignKey(to='materia.MateriaLegislativa')), - ('parlamentar', models.ForeignKey(to='parlamentares.Parlamentar', verbose_name='Parlamentar')), + ('comissao', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='comissoes.Comissao', verbose_name='Comissão')), + ('materia', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa')), + ('parlamentar', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar', verbose_name='Parlamentar')), ], options={ - 'verbose_name_plural': 'Relatorias', 'verbose_name': 'Relatoria', + 'verbose_name_plural': 'Relatorias', }, ), migrations.CreateModel( name='StatusTramitacao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('sigla', models.CharField(max_length=10, verbose_name='Sigla')), ('descricao', models.CharField(max_length=60, verbose_name='Descrição')), - ('indicador', models.CharField(choices=[('F', 'Fim'), ('R', 'Retorno')], max_length=1, verbose_name='Indicador da Tramitação')), + ('indicador', models.CharField(blank=True, choices=[('F', 'Fim'), ('R', 'Retorno')], max_length=1, verbose_name='Indicador da Tramitação')), ], options={ - 'verbose_name_plural': 'Status de Tramitação', + 'ordering': ['descricao'], 'verbose_name': 'Status de Tramitação', - }, - ), - migrations.CreateModel( - name='TipoAutor', - fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('descricao', models.CharField(max_length=50, verbose_name='Descrição')), - ], - options={ - 'verbose_name_plural': 'Tipos de Autor', - 'verbose_name': 'Tipo de Autor', + 'verbose_name_plural': 'Status de Tramitação', }, ), migrations.CreateModel( name='TipoDocumento', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('descricao', models.CharField(max_length=50, verbose_name='Tipo Documento')), ], options={ - 'verbose_name_plural': 'Tipos de Documento', 'verbose_name': 'Tipo de Documento', + 'verbose_name_plural': 'Tipos de Documento', }, ), migrations.CreateModel( name='TipoFimRelatoria', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('descricao', models.CharField(max_length=50, verbose_name='Tipo Fim Relatoria')), ], options={ - 'verbose_name_plural': 'Tipos Fim de Relatoria', 'verbose_name': 'Tipo Fim de Relatoria', + 'verbose_name_plural': 'Tipos Fim de Relatoria', }, ), migrations.CreateModel( name='TipoMateriaLegislativa', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('sigla', models.CharField(max_length=5, verbose_name='Sigla')), ('descricao', models.CharField(max_length=50, verbose_name='Descrição ')), - ('num_automatica', models.BooleanField()), - ('quorum_minimo_votacao', models.IntegerField()), + ('num_automatica', models.BooleanField(default=False)), + ('quorum_minimo_votacao', models.PositiveIntegerField(blank=True, null=True)), ], options={ - 'verbose_name_plural': 'Tipos de Matérias Legislativas', + 'ordering': ['descricao'], 'verbose_name': 'Tipo de Matéria Legislativa', + 'verbose_name_plural': 'Tipos de Matérias Legislativas', }, ), migrations.CreateModel( name='TipoProposicao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('descricao', models.CharField(max_length=50, verbose_name='Descrição')), - ('materia_ou_documento', models.CharField(choices=[('M', 'Matéria'), ('D', 'Documento')], max_length=1, verbose_name='Gera')), - ('modelo', models.CharField(max_length=50, verbose_name='Modelo XML')), - ('tipo_documento', models.ForeignKey(blank=True, null=True, to='materia.TipoDocumento', verbose_name='Tipo Documento')), - ('tipo_materia', models.ForeignKey(blank=True, null=True, to='materia.TipoMateriaLegislativa', verbose_name='Tipo Matéria')), + ('object_id', models.PositiveIntegerField(blank=True, default=None, null=True)), + ('content_type', models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='contenttypes.ContentType', verbose_name='Definição de Tipo')), + ('perfis', models.ManyToManyField(blank=True, help_text='\n Mesmo que em Configurações da Aplicação nas\n Tabelas Auxiliares esteja definido que Proposições possam\n utilizar Textos Articulados, ao gerar uma proposição,\n a solução de Textos Articulados será disponibilizada se\n o Tipo escolhido para a Proposição estiver associado a ao\n menos um Perfil Estrutural de Texto Articulado.\n ', to='compilacao.PerfilEstruturalTextoArticulado', verbose_name='Perfis Estruturais de Textos Articulados')), ], options={ - 'verbose_name_plural': 'Tipos de Proposições', 'verbose_name': 'Tipo de Proposição', + 'verbose_name_plural': 'Tipos de Proposições', }, ), migrations.CreateModel( name='Tramitacao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('data_tramitacao', models.DateField(blank=True, null=True, verbose_name='Data Tramitação')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('data_tramitacao', models.DateField(verbose_name='Data Tramitação')), ('data_encaminhamento', models.DateField(blank=True, null=True, verbose_name='Data Encaminhamento')), - ('ultima', models.BooleanField()), - ('urgente', models.BooleanField(verbose_name='Urgente ?')), - ('turno', models.CharField(blank=True, max_length=1, null=True, verbose_name='Turno', choices=[('P', 'Primeiro'), ('S', 'Segundo'), ('Ú', 'Único'), ('L', 'Suplementar'), ('F', 'Final'), ('A', 'Votação única em Regime de Urgência'), ('B', '1ª Votação'), ('C', '2ª e 3ª Votação')])), - ('texto', models.TextField(blank=True, null=True, verbose_name='Texto da Ação')), + ('urgente', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Urgente ?')), + ('turno', models.CharField(blank=True, choices=[('P', 'Primeiro'), ('S', 'Segundo'), ('U', 'Único'), ('L', 'Suplementar'), ('F', 'Final'), ('A', 'Votação única em Regime de Urgência'), ('B', '1ª Votação'), ('C', '2ª e 3ª Votação')], max_length=1, verbose_name='Turno')), + ('texto', models.TextField(verbose_name='Texto da Ação')), ('data_fim_prazo', models.DateField(blank=True, null=True, verbose_name='Data Fim Prazo')), - ('materia', models.ForeignKey(to='materia.MateriaLegislativa')), - ('status', models.ForeignKey(blank=True, null=True, to='materia.StatusTramitacao', verbose_name='Status')), + ('materia', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa')), + ('status', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.StatusTramitacao', verbose_name='Status')), ], options={ - 'verbose_name_plural': 'Tramitações', 'verbose_name': 'Tramitação', + 'verbose_name_plural': 'Tramitações', }, ), migrations.CreateModel( name='UnidadeTramitacao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('comissao', models.ForeignKey(blank=True, null=True, to='comissoes.Comissao', verbose_name='Comissão')), - ('orgao', models.ForeignKey(blank=True, null=True, to='materia.Orgao', verbose_name='Órgão')), - ('parlamentar', models.ForeignKey(blank=True, null=True, to='parlamentares.Parlamentar', verbose_name='Parlamentar')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('comissao', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='comissoes.Comissao', verbose_name='Comissão')), + ('orgao', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.Orgao', verbose_name='Órgão')), + ('parlamentar', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar', verbose_name='Parlamentar')), ], options={ - 'verbose_name_plural': 'Unidades de Tramitação', 'verbose_name': 'Unidade de Tramitação', + 'verbose_name_plural': 'Unidades de Tramitação', }, ), migrations.AddField( model_name='tramitacao', name='unidade_tramitacao_destino', - field=models.ForeignKey(blank=True, null=True, to='materia.UnidadeTramitacao', verbose_name='Unidade Destino', related_name='+'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='tramitacoes_destino', to='materia.UnidadeTramitacao', verbose_name='Unidade Destino'), ), migrations.AddField( model_name='tramitacao', name='unidade_tramitacao_local', - field=models.ForeignKey(blank=True, null=True, to='materia.UnidadeTramitacao', verbose_name='Unidade Local', related_name='+'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='tramitacoes_origem', to='materia.UnidadeTramitacao', verbose_name='Unidade Local'), ), migrations.AddField( model_name='relatoria', name='tipo_fim_relatoria', - field=models.ForeignKey(blank=True, null=True, to='materia.TipoFimRelatoria', verbose_name='Motivo Fim Relatoria'), + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.TipoFimRelatoria', verbose_name='Motivo Fim Relatoria'), ), migrations.AddField( model_name='proposicao', name='tipo', - field=models.ForeignKey(to='materia.TipoProposicao', verbose_name='Tipo'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.TipoProposicao', verbose_name='Tipo'), ), migrations.AddField( model_name='parecer', name='relatoria', - field=models.ForeignKey(to='materia.Relatoria'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.Relatoria'), ), migrations.AddField( model_name='numeracao', name='tipo_materia', - field=models.ForeignKey(to='materia.TipoMateriaLegislativa', verbose_name='Tipo de Matéria'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.TipoMateriaLegislativa', verbose_name='Tipo de Matéria'), ), migrations.AddField( model_name='materialegislativa', name='local_origem_externa', - field=models.ForeignKey(blank=True, null=True, to='materia.Origem', verbose_name='Local Origem'), + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.Origem', verbose_name='Local Origem'), ), migrations.AddField( model_name='materialegislativa', name='regime_tramitacao', - field=models.ForeignKey(to='materia.RegimeTramitacao', verbose_name='Regime Tramitação'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.RegimeTramitacao', verbose_name='Regime Tramitação'), ), migrations.AddField( model_name='materialegislativa', name='tipo', - field=models.ForeignKey(to='materia.TipoMateriaLegislativa', verbose_name='Tipo'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.TipoMateriaLegislativa', verbose_name='Tipo'), ), migrations.AddField( model_name='materialegislativa', name='tipo_origem_externa', - field=models.ForeignKey(blank=True, null=True, to='materia.TipoMateriaLegislativa', verbose_name='Tipo', related_name='+'), + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='tipo_origem_externa_set', to='materia.TipoMateriaLegislativa', verbose_name='Tipo'), ), migrations.AddField( model_name='materiaassunto', name='materia', - field=models.ForeignKey(to='materia.MateriaLegislativa'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), ), migrations.AddField( model_name='documentoacessorio', name='materia', - field=models.ForeignKey(to='materia.MateriaLegislativa'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), ), migrations.AddField( model_name='documentoacessorio', name='tipo', - field=models.ForeignKey(to='materia.TipoDocumento', verbose_name='Tipo'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.TipoDocumento', verbose_name='Tipo'), ), migrations.AddField( model_name='despachoinicial', name='materia', - field=models.ForeignKey(to='materia.MateriaLegislativa'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), ), migrations.AddField( model_name='autoria', name='materia', - field=models.ForeignKey(to='materia.MateriaLegislativa'), - ), - migrations.AddField( - model_name='autor', - name='tipo', - field=models.ForeignKey(to='materia.TipoAutor', verbose_name='Tipo'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa', verbose_name='Matéria Legislativa'), ), migrations.AddField( model_name='anexada', name='materia_anexada', - field=models.ForeignKey(to='materia.MateriaLegislativa', related_name='+'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='materia_anexada_set', to='materia.MateriaLegislativa'), ), migrations.AddField( model_name='anexada', name='materia_principal', - field=models.ForeignKey(to='materia.MateriaLegislativa', related_name='+'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='materia_principal_set', to='materia.MateriaLegislativa'), ), migrations.AddField( model_name='acompanhamentomateria', name='materia', - field=models.ForeignKey(to='materia.MateriaLegislativa'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), + ), + migrations.AlterUniqueTogether( + name='tipoproposicao', + unique_together=set([('content_type', 'object_id')]), + ), + migrations.AlterUniqueTogether( + name='proposicao', + unique_together=set([('content_type', 'object_id')]), + ), + migrations.AlterUniqueTogether( + name='materialegislativa', + unique_together=set([('tipo', 'numero', 'ano')]), ), ] diff --git a/sapl/materia/migrations/0002_auto_20150729_1310.py b/sapl/materia/migrations/0002_auto_20150729_1310.py deleted file mode 100644 index a9e9b21c3..000000000 --- a/sapl/materia/migrations/0002_auto_20150729_1310.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='orgao', - name='unidade_deliberativa', - field=models.BooleanField(verbose_name='Unidade Deliberativa', choices=[(True, 'Sim'), (False, 'Não')]), - ), - ] diff --git a/sapl/materia/migrations/0003_auto_20150729_1717.py b/sapl/materia/migrations/0003_auto_20150729_1717.py deleted file mode 100644 index 6ffea56bd..000000000 --- a/sapl/materia/migrations/0003_auto_20150729_1717.py +++ /dev/null @@ -1,64 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0002_auto_20150729_1310'), - ] - - operations = [ - migrations.AlterField( - model_name='despachoinicial', - name='numero_ordem', - field=models.PositiveIntegerField(), - ), - migrations.AlterField( - model_name='materialegislativa', - name='ano', - field=models.PositiveSmallIntegerField(verbose_name='Ano'), - ), - migrations.AlterField( - model_name='materialegislativa', - name='ano_origem_externa', - field=models.PositiveSmallIntegerField(blank=True, verbose_name='Ano', null=True), - ), - migrations.AlterField( - model_name='materialegislativa', - name='dias_prazo', - field=models.PositiveIntegerField(blank=True, verbose_name='Dias Prazo', null=True), - ), - migrations.AlterField( - model_name='materialegislativa', - name='numero', - field=models.PositiveIntegerField(verbose_name='Número'), - ), - migrations.AlterField( - model_name='materialegislativa', - name='numero_protocolo', - field=models.PositiveIntegerField(blank=True, verbose_name='Núm. Protocolo', null=True), - ), - migrations.AlterField( - model_name='numeracao', - name='ano_materia', - field=models.PositiveSmallIntegerField(verbose_name='Ano'), - ), - migrations.AlterField( - model_name='numeracao', - name='numero_ordem', - field=models.PositiveIntegerField(), - ), - migrations.AlterField( - model_name='proposicao', - name='numero_proposicao', - field=models.PositiveIntegerField(blank=True, verbose_name='Número', null=True), - ), - migrations.AlterField( - model_name='tipomaterialegislativa', - name='quorum_minimo_votacao', - field=models.PositiveIntegerField(), - ), - ] diff --git a/sapl/materia/migrations/0004_materialegislativa_texto_original.py b/sapl/materia/migrations/0004_materialegislativa_texto_original.py deleted file mode 100644 index 3f5adf474..000000000 --- a/sapl/materia/migrations/0004_materialegislativa_texto_original.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - -import sapl.materia.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0003_auto_20150729_1717'), - ] - - operations = [ - migrations.AddField( - model_name='materialegislativa', - name='texto_original', - field=models.FileField( - null=True, blank=True, verbose_name='Texto original (PDF)', upload_to=sapl.materia.models.texto_upload_path), - ), - ] diff --git a/sapl/materia/migrations/0005_auto_20150923_0941.py b/sapl/materia/migrations/0005_auto_20150923_0941.py deleted file mode 100644 index 24148ca2b..000000000 --- a/sapl/materia/migrations/0005_auto_20150923_0941.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0004_materialegislativa_texto_original'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='materialegislativa', - unique_together=set([('tipo', 'numero', 'ano')]), - ), - ] diff --git a/sapl/materia/migrations/0006_proposicao_status.py b/sapl/materia/migrations/0006_proposicao_status.py deleted file mode 100644 index 9e8678308..000000000 --- a/sapl/materia/migrations/0006_proposicao_status.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0005_auto_20150923_0941'), - ] - - operations = [ - migrations.AddField( - model_name='proposicao', - name='status', - field=models.CharField(verbose_name='Status Proposição', max_length=1, blank=True, choices=[('P', 'Pendente'), ('D', 'Devolvida'), ('I', 'Incorporada')], null=True), - ), - ] diff --git a/sapl/materia/migrations/0007_auto_20151021_1200.py b/sapl/materia/migrations/0007_auto_20151021_1200.py deleted file mode 100644 index 2cdad3b5c..000000000 --- a/sapl/materia/migrations/0007_auto_20151021_1200.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0006_proposicao_status'), - ] - - operations = [ - migrations.AlterField( - model_name='proposicao', - name='status', - field=models.CharField(max_length=1, verbose_name='Status Proposição', blank=True, null=True, choices=[('E', 'Enviada'), ('D', 'Devolvida'), ('I', 'Incorporada')]), - ), - ] diff --git a/sapl/materia/migrations/0008_auto_20151029_1416.py b/sapl/materia/migrations/0008_auto_20151029_1416.py deleted file mode 100644 index 4ee72acaf..000000000 --- a/sapl/materia/migrations/0008_auto_20151029_1416.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0007_auto_20151021_1200'), - ] - - operations = [ - migrations.RemoveField( - model_name='despachoinicial', - name='numero_ordem', - ) - ] diff --git a/sapl/materia/migrations/0009_auto_20151029_1420.py b/sapl/materia/migrations/0009_auto_20151029_1420.py deleted file mode 100644 index b831a3885..000000000 --- a/sapl/materia/migrations/0009_auto_20151029_1420.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0008_auto_20151029_1416'), - ] - - operations = [ - migrations.RemoveField( - model_name='numeracao', - name='numero_ordem', - ) - ] diff --git a/sapl/materia/migrations/0010_auto_20151117_1551.py b/sapl/materia/migrations/0010_auto_20151117_1551.py deleted file mode 100644 index e9f095b1c..000000000 --- a/sapl/materia/migrations/0010_auto_20151117_1551.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - -import sapl.materia.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0009_auto_20151029_1420'), - ] - - operations = [ - migrations.AlterField( - model_name='materialegislativa', - name='texto_original', - field=models.FileField(verbose_name='Texto Original (PDF)', - upload_to=sapl.materia.models.texto_upload_path, blank=True, null=True), - ), - ] diff --git a/sapl/materia/migrations/0011_proposicao_texto_original.py b/sapl/materia/migrations/0011_proposicao_texto_original.py deleted file mode 100644 index 49f74fb6c..000000000 --- a/sapl/materia/migrations/0011_proposicao_texto_original.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import sapl.materia.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0010_auto_20151117_1551'), - ] - - operations = [ - migrations.AddField( - model_name='proposicao', - name='texto_original', - field=models.FileField(upload_to=sapl.materia.models.texto_upload_path, - verbose_name='Texto Original (PDF)', blank=True, null=True), - ), - ] diff --git a/sapl/materia/migrations/0012_auto_20151124_1328.py b/sapl/materia/migrations/0012_auto_20151124_1328.py deleted file mode 100644 index c886d6329..000000000 --- a/sapl/materia/migrations/0012_auto_20151124_1328.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0011_proposicao_texto_original'), - ] - - operations = [ - migrations.AlterField( - model_name='proposicao', - name='autor', - field=models.ForeignKey(null=True, to='materia.Autor', blank=True), - ), - ] diff --git a/sapl/materia/migrations/0013_remove_tramitacao_ultima.py b/sapl/materia/migrations/0013_remove_tramitacao_ultima.py deleted file mode 100644 index b887dd3ae..000000000 --- a/sapl/materia/migrations/0013_remove_tramitacao_ultima.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0012_auto_20151124_1328'), - ] - - operations = [ - migrations.RemoveField( - model_name='tramitacao', - name='ultima', - ), - ] diff --git a/sapl/materia/migrations/0014_autoria_partido.py b/sapl/materia/migrations/0014_autoria_partido.py deleted file mode 100644 index fcdb5df70..000000000 --- a/sapl/materia/migrations/0014_autoria_partido.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0010_auto_20160107_1850'), - ('materia', '0013_remove_tramitacao_ultima'), - ] - - operations = [ - migrations.AddField( - model_name='autoria', - name='partido', - field=models.ForeignKey(null=True, to='parlamentares.Partido', blank=True), - ), - ] diff --git a/sapl/materia/migrations/0015_auto_20160216_1015.py b/sapl/materia/migrations/0015_auto_20160216_1015.py deleted file mode 100644 index 9e3ecd8f1..000000000 --- a/sapl/materia/migrations/0015_auto_20160216_1015.py +++ /dev/null @@ -1,124 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0014_autoria_partido'), - ] - - operations = [ - migrations.AlterField( - model_name='autor', - name='cargo', - field=models.CharField(max_length=50, blank=True), - ), - migrations.AlterField( - model_name='autor', - name='nome', - field=models.CharField(verbose_name='Autor', max_length=50, blank=True), - ), - migrations.AlterField( - model_name='autor', - name='username', - field=models.CharField(max_length=50, blank=True), - ), - migrations.AlterField( - model_name='documentoacessorio', - name='autor', - field=models.CharField(verbose_name='Autor', max_length=50, blank=True), - ), - migrations.AlterField( - model_name='documentoacessorio', - name='ementa', - field=models.TextField(verbose_name='Ementa', blank=True), - ), - migrations.AlterField( - model_name='documentoacessorio', - name='indexacao', - field=models.TextField(blank=True), - ), - migrations.AlterField( - model_name='materialegislativa', - name='apelido', - field=models.CharField(verbose_name='Apelido', max_length=50, blank=True), - ), - migrations.AlterField( - model_name='materialegislativa', - name='indexacao', - field=models.TextField(verbose_name='Indexação', blank=True), - ), - migrations.AlterField( - model_name='materialegislativa', - name='numero_origem_externa', - field=models.CharField(verbose_name='Número', max_length=5, blank=True), - ), - migrations.AlterField( - model_name='materialegislativa', - name='objeto', - field=models.CharField(verbose_name='Objeto', max_length=150, blank=True), - ), - migrations.AlterField( - model_name='materialegislativa', - name='observacao', - field=models.TextField(verbose_name='Observação', blank=True), - ), - migrations.AlterField( - model_name='materialegislativa', - name='resultado', - field=models.TextField(blank=True), - ), - migrations.AlterField( - model_name='materialegislativa', - name='tipo_apresentacao', - field=models.CharField(blank=True, verbose_name='Tipo de Apresentação', choices=[('O', 'Oral'), ('E', 'Escrita')], max_length=1), - ), - migrations.AlterField( - model_name='numeracao', - name='data_materia', - field=models.DateField(verbose_name='Data', blank=True), - ), - migrations.AlterField( - model_name='orgao', - name='endereco', - field=models.CharField(verbose_name='Endereço', max_length=100, blank=True), - ), - migrations.AlterField( - model_name='orgao', - name='telefone', - field=models.CharField(verbose_name='Telefone', max_length=50, blank=True), - ), - migrations.AlterField( - model_name='parecer', - name='parecer', - field=models.TextField(blank=True), - ), - migrations.AlterField( - model_name='parecer', - name='tipo_conclusao', - field=models.CharField(max_length=3, blank=True), - ), - migrations.AlterField( - model_name='proposicao', - name='justificativa_devolucao', - field=models.CharField(verbose_name='Justificativa da Devolução', max_length=200, blank=True), - ), - migrations.AlterField( - model_name='proposicao', - name='status', - field=models.CharField(blank=True, verbose_name='Status Proposição', choices=[('E', 'Enviada'), ('D', 'Devolvida'), ('I', 'Incorporada')], max_length=1), - ), - migrations.AlterField( - model_name='tramitacao', - name='texto', - field=models.TextField(verbose_name='Texto da Ação', blank=True), - ), - migrations.AlterField( - model_name='tramitacao', - name='turno', - field=models.CharField(blank=True, verbose_name='Turno', choices=[('P', 'Primeiro'), ('S', 'Segundo'), ('Ú', 'Único'), ('L', 'Suplementar'), ('F', 'Final'), ('A', 'Votação única em Regime de Urgência'), ('B', '1ª Votação'), ('C', '2ª e 3ª Votação')], max_length=1), - ), - ] diff --git a/sapl/materia/migrations/0016_auto_20160223_0813.py b/sapl/materia/migrations/0016_auto_20160223_0813.py deleted file mode 100644 index 0d2cb84a5..000000000 --- a/sapl/materia/migrations/0016_auto_20160223_0813.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import datetime -from django.utils.timezone import utc - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0015_auto_20160216_1015'), - ] - - operations = [ - migrations.AddField( - model_name='acompanhamentomateria', - name='data_cadastro', - field=models.DateField(auto_now_add=True, default=datetime.datetime(2016, 2, 23, 11, 13, 25, 362112, tzinfo=utc)), - preserve_default=False, - ), - migrations.AddField( - model_name='acompanhamentomateria', - name='usuario', - field=models.CharField(max_length=50, default=''), - preserve_default=False, - ), - ] diff --git a/sapl/materia/migrations/0016_auto_20160225_0918.py b/sapl/materia/migrations/0016_auto_20160225_0918.py deleted file mode 100644 index b404a7e6c..000000000 --- a/sapl/materia/migrations/0016_auto_20160225_0918.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0015_auto_20160216_1015'), - ] - - operations = [ - migrations.AlterField( - model_name='tramitacao', - name='turno', - field=models.CharField(max_length=1, verbose_name='Turno', choices=[('P', 'Primeiro'), ('S', 'Segundo'), ('U', 'Único'), ('L', 'Suplementar'), ('F', 'Final'), ('A', 'Votação única em Regime de Urgência'), ('B', '1ª Votação'), ('C', '2ª e 3ª Votação')], blank=True), - ), - ] diff --git a/sapl/materia/migrations/0017_acompanhamentomateria_confirmado.py b/sapl/materia/migrations/0017_acompanhamentomateria_confirmado.py deleted file mode 100644 index 59bd9dac2..000000000 --- a/sapl/materia/migrations/0017_acompanhamentomateria_confirmado.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0016_auto_20160223_0813'), - ] - - operations = [ - migrations.AddField( - model_name='acompanhamentomateria', - name='confirmado', - field=models.BooleanField(default=False), - ), - ] diff --git a/sapl/materia/migrations/0018_merge.py b/sapl/materia/migrations/0018_merge.py deleted file mode 100644 index 082356b16..000000000 --- a/sapl/materia/migrations/0018_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-02-26 14:25 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0017_acompanhamentomateria_confirmado'), - ('materia', '0016_auto_20160225_0918'), - ] - - operations = [ - ] diff --git a/sapl/materia/migrations/0019_auto_20160229_1321.py b/sapl/materia/migrations/0019_auto_20160229_1321.py deleted file mode 100644 index 02f0f3e81..000000000 --- a/sapl/materia/migrations/0019_auto_20160229_1321.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0018_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='materialegislativa', - name='anexadas', - field=models.ManyToManyField(to='materia.MateriaLegislativa', blank=True, related_name='anexo_de', through='materia.Anexada'), - ), - ] diff --git a/sapl/materia/migrations/0020_auto_20160229_1324.py b/sapl/materia/migrations/0020_auto_20160229_1324.py deleted file mode 100644 index cbe51e7c4..000000000 --- a/sapl/materia/migrations/0020_auto_20160229_1324.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -from django.utils.timezone import utc -import datetime - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0019_auto_20160229_1321'), - ] - - operations = [ - migrations.AlterField( - model_name='materialegislativa', - name='data_apresentacao', - field=models.DateField(default=datetime.datetime(2016, 2, 29, 16, 24, 24, 963568, tzinfo=utc), verbose_name='Data Apresentação'), - preserve_default=False, - ), - ] diff --git a/sapl/materia/migrations/0021_auto_20160307_0905.py b/sapl/materia/migrations/0021_auto_20160307_0905.py deleted file mode 100644 index b7e65bc30..000000000 --- a/sapl/materia/migrations/0021_auto_20160307_0905.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-07 12:05 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0020_auto_20160229_1324'), - ] - - operations = [ - migrations.AlterField( - model_name='acompanhamentomateria', - name='email', - field=models.EmailField(max_length=100, verbose_name='E-mail'), - ), - ] diff --git a/sapl/materia/migrations/0022_auto_20160309_1323.py b/sapl/materia/migrations/0022_auto_20160309_1323.py deleted file mode 100644 index 23c874dc1..000000000 --- a/sapl/materia/migrations/0022_auto_20160309_1323.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-09 16:23 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0021_auto_20160307_0905'), - ] - - operations = [ - migrations.AlterField( - model_name='numeracao', - name='ano_materia', - field=models.PositiveSmallIntegerField(choices=[(2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - migrations.AlterField( - model_name='proposicao', - name='descricao', - field=models.TextField(max_length=100, verbose_name='Descrição'), - ), - ] diff --git a/sapl/materia/migrations/0023_auto_20160309_1407.py b/sapl/materia/migrations/0023_auto_20160309_1407.py deleted file mode 100644 index ea07440b4..000000000 --- a/sapl/materia/migrations/0023_auto_20160309_1407.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-09 17:07 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0022_auto_20160309_1323'), - ] - - operations = [ - migrations.AlterField( - model_name='materialegislativa', - name='ano', - field=models.PositiveSmallIntegerField(choices=[(2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - migrations.AlterField( - model_name='materialegislativa', - name='ano_origem_externa', - field=models.PositiveSmallIntegerField(blank=True, choices=[(2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], null=True, verbose_name='Ano'), - ), - ] diff --git a/sapl/materia/migrations/0024_auto_20160311_1501.py b/sapl/materia/migrations/0024_auto_20160311_1501.py deleted file mode 100644 index dd2ca6397..000000000 --- a/sapl/materia/migrations/0024_auto_20160311_1501.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-11 18:01 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0023_auto_20160309_1407'), - ] - - operations = [ - migrations.AlterField( - model_name='numeracao', - name='data_materia', - field=models.DateField(verbose_name='Data'), - ), - ] diff --git a/sapl/materia/migrations/0025_auto_20160311_1613.py b/sapl/materia/migrations/0025_auto_20160311_1613.py deleted file mode 100644 index 3223ea78c..000000000 --- a/sapl/materia/migrations/0025_auto_20160311_1613.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-11 19:13 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0024_auto_20160311_1501'), - ] - - operations = [ - migrations.AlterField( - model_name='proposicao', - name='data_envio', - field=models.DateTimeField(blank=True, null=True, verbose_name='Data de Envio'), - ), - ] diff --git a/sapl/materia/migrations/0026_auto_20160322_1514.py b/sapl/materia/migrations/0026_auto_20160322_1514.py deleted file mode 100644 index 91af09313..000000000 --- a/sapl/materia/migrations/0026_auto_20160322_1514.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-22 18:14 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0025_auto_20160311_1613'), - ] - - operations = [ - migrations.AlterField( - model_name='tramitacao', - name='data_tramitacao', - field=models.DateField(verbose_name='Data Tramitação'), - ), - migrations.AlterField( - model_name='tramitacao', - name='status', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='materia.StatusTramitacao', verbose_name='Status'), - ), - migrations.AlterField( - model_name='tramitacao', - name='texto', - field=models.TextField(verbose_name='Texto da Ação'), - ), - migrations.AlterField( - model_name='tramitacao', - name='unidade_tramitacao_destino', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='materia.UnidadeTramitacao', verbose_name='Unidade Destino'), - ), - migrations.AlterField( - model_name='tramitacao', - name='unidade_tramitacao_local', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='materia.UnidadeTramitacao', verbose_name='Unidade Local'), - ), - ] diff --git a/sapl/materia/migrations/0027_auto_20160404_1409.py b/sapl/materia/migrations/0027_auto_20160404_1409.py deleted file mode 100644 index ee05c96ab..000000000 --- a/sapl/materia/migrations/0027_auto_20160404_1409.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-04-04 17:09 -from __future__ import unicode_literals - -from django.db import migrations, models -import sapl.materia.models -import sapl.utils - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0026_auto_20160322_1514'), - ] - - operations = [ - migrations.AlterField( - model_name='materialegislativa', - name='texto_original', - field=models.FileField(blank=True, null=True, upload_to=sapl.materia.models.texto_upload_path, validators=[ - sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Texto Original (PDF)'), - ), - migrations.AlterField( - model_name='proposicao', - name='texto_original', - field=models.FileField(blank=True, null=True, upload_to=sapl.materia.models.texto_upload_path, validators=[ - sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Texto Original (PDF)'), - ), - ] diff --git a/sapl/materia/migrations/0028_auto_20160419_1000.py b/sapl/materia/migrations/0028_auto_20160419_1000.py deleted file mode 100644 index 579eca291..000000000 --- a/sapl/materia/migrations/0028_auto_20160419_1000.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-04-19 13:00 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0027_auto_20160404_1409'), - ] - - operations = [ - migrations.AlterField( - model_name='tipomaterialegislativa', - name='num_automatica', - field=models.BooleanField(default=False), - ), - migrations.AlterField( - model_name='tipomaterialegislativa', - name='quorum_minimo_votacao', - field=models.PositiveIntegerField(blank=True, null=True), - ), - ] diff --git a/sapl/materia/migrations/0028_auto_20160419_1056.py b/sapl/materia/migrations/0028_auto_20160419_1056.py deleted file mode 100644 index bd4eb7f22..000000000 --- a/sapl/materia/migrations/0028_auto_20160419_1056.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-04-19 13:56 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0027_auto_20160404_1409'), - ] - - operations = [ - migrations.AlterField( - model_name='tramitacao', - name='unidade_tramitacao_destino', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tramitacoes_destino', to='materia.UnidadeTramitacao', verbose_name='Unidade Destino'), - ), - migrations.AlterField( - model_name='tramitacao', - name='unidade_tramitacao_local', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tramitacoes_origem', to='materia.UnidadeTramitacao', verbose_name='Unidade Local'), - ), - ] diff --git a/sapl/materia/migrations/0029_auto_20160428_1020.py b/sapl/materia/migrations/0029_auto_20160428_1020.py deleted file mode 100644 index 2cdd68c76..000000000 --- a/sapl/materia/migrations/0029_auto_20160428_1020.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-04-28 13:20 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0028_auto_20160419_1000'), - ] - - operations = [ - migrations.AlterField( - model_name='autoria', - name='primeiro_autor', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Primeiro Autor'), - ), - ] diff --git a/sapl/materia/migrations/0029_merge.py b/sapl/materia/migrations/0029_merge.py deleted file mode 100644 index 3a37b2421..000000000 --- a/sapl/materia/migrations/0029_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-04-19 18:02 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0028_auto_20160419_1056'), - ('materia', '0028_auto_20160419_1000'), - ] - - operations = [ - ] diff --git a/sapl/materia/migrations/0030_auto_20160429_1349.py b/sapl/materia/migrations/0030_auto_20160429_1349.py deleted file mode 100644 index cfd764719..000000000 --- a/sapl/materia/migrations/0030_auto_20160429_1349.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-04-29 16:49 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0029_auto_20160428_1020'), - ] - - operations = [ - migrations.AlterModelOptions( - name='numeracao', - options={'ordering': ('materia', 'tipo_materia', 'numero_materia', 'ano_materia', 'data_materia'), 'verbose_name': 'Numeração', 'verbose_name_plural': 'Numerações'}, - ), - ] diff --git a/sapl/materia/migrations/0030_auto_20160502_1630.py b/sapl/materia/migrations/0030_auto_20160502_1630.py deleted file mode 100644 index 6f8fd60be..000000000 --- a/sapl/materia/migrations/0030_auto_20160502_1630.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-02 19:30 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0029_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='materialegislativa', - name='tipo_origem_externa', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tipo_origem_externa_set', to='materia.TipoMateriaLegislativa', verbose_name='Tipo'), - ), - ] diff --git a/sapl/materia/migrations/0031_auto_20160502_1131.py b/sapl/materia/migrations/0031_auto_20160502_1131.py deleted file mode 100644 index a51221080..000000000 --- a/sapl/materia/migrations/0031_auto_20160502_1131.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-02 14:31 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0030_auto_20160429_1349'), - ] - - operations = [ - migrations.AlterField( - model_name='tramitacao', - name='urgente', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Urgente ?'), - ), - ] diff --git a/sapl/materia/migrations/0031_merge.py b/sapl/materia/migrations/0031_merge.py deleted file mode 100644 index 9faf9d45a..000000000 --- a/sapl/materia/migrations/0031_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-03 20:05 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0030_auto_20160429_1349'), - ('materia', '0030_auto_20160502_1630'), - ] - - operations = [ - ] diff --git a/sapl/materia/migrations/0032_auto_20160503_0926.py b/sapl/materia/migrations/0032_auto_20160503_0926.py deleted file mode 100644 index 0ece4f329..000000000 --- a/sapl/materia/migrations/0032_auto_20160503_0926.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-03 12:26 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0031_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='anexada', - name='materia_anexada', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='materia_anexada_set', to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='anexada', - name='materia_principal', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='materia_principal_set', to='materia.MateriaLegislativa'), - ), - ] diff --git a/sapl/materia/migrations/0032_merge.py b/sapl/materia/migrations/0032_merge.py deleted file mode 100644 index 8882ae927..000000000 --- a/sapl/materia/migrations/0032_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-09 01:00 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0031_auto_20160502_1131'), - ('materia', '0031_merge'), - ] - - operations = [ - ] diff --git a/sapl/materia/migrations/0033_documentoacessorio_texto_original.py b/sapl/materia/migrations/0033_documentoacessorio_texto_original.py deleted file mode 100644 index 43e89a395..000000000 --- a/sapl/materia/migrations/0033_documentoacessorio_texto_original.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-10 12:43 -from __future__ import unicode_literals - -from django.db import migrations, models -import sapl.materia.models -import sapl.utils - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0032_merge'), - ] - - operations = [ - migrations.AddField( - model_name='documentoacessorio', - name='texto_original', - field=models.FileField(blank=True, null=True, upload_to=sapl.materia.models.texto_upload_path, validators=[ - sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Texto Integral'), - ), - ] diff --git a/sapl/materia/migrations/0034_auto_20160510_0946.py b/sapl/materia/migrations/0034_auto_20160510_0946.py deleted file mode 100644 index eac94fc88..000000000 --- a/sapl/materia/migrations/0034_auto_20160510_0946.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-10 12:46 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0033_documentoacessorio_texto_original'), - ] - - operations = [ - migrations.RenameField( - model_name='documentoacessorio', - old_name='texto_original', - new_name='arquivo', - ), - ] diff --git a/sapl/materia/migrations/0035_auto_20160510_0949.py b/sapl/materia/migrations/0035_auto_20160510_0949.py deleted file mode 100644 index eacd9db10..000000000 --- a/sapl/materia/migrations/0035_auto_20160510_0949.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-10 12:49 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0034_auto_20160510_0946'), - ] - - operations = [ - migrations.AlterField( - model_name='documentoacessorio', - name='nome', - field=models.CharField(max_length=30, verbose_name='Nome'), - ), - ] diff --git a/sapl/materia/migrations/0036_merge.py b/sapl/materia/migrations/0036_merge.py deleted file mode 100644 index f0a9f86a6..000000000 --- a/sapl/materia/migrations/0036_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-19 13:49 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0032_auto_20160503_0926'), - ('materia', '0035_auto_20160510_0949'), - ] - - operations = [ - ] diff --git a/sapl/materia/migrations/0037_auto_20160520_1250.py b/sapl/materia/migrations/0037_auto_20160520_1250.py deleted file mode 100644 index d70ae7dca..000000000 --- a/sapl/materia/migrations/0037_auto_20160520_1250.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-20 15:50 -from __future__ import unicode_literals - -from django.db import migrations, models -import sapl.materia.models -import sapl.utils - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0036_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='proposicao', - name='texto_original', - field=models.FileField(blank=True, null=True, upload_to=sapl.materia.models.texto_upload_path, validators=[ - sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Texto Original'), - ), - ] diff --git a/sapl/materia/migrations/0038_auto_20160612_1506.py b/sapl/materia/migrations/0038_auto_20160612_1506.py deleted file mode 100644 index 0ce74f84b..000000000 --- a/sapl/materia/migrations/0038_auto_20160612_1506.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-06-12 18:06 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0037_auto_20160520_1250'), - ] - - operations = [ - migrations.AlterField( - model_name='statustramitacao', - name='indicador', - field=models.CharField(blank=True, choices=[('F', 'Fim'), ('R', 'Retorno')], max_length=1, verbose_name='Indicador da Tramitação'), - ), - ] diff --git a/sapl/materia/migrations/0039_auto_20160628_1251.py b/sapl/materia/migrations/0039_auto_20160628_1251.py deleted file mode 100644 index a730729e2..000000000 --- a/sapl/materia/migrations/0039_auto_20160628_1251.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-06-28 15:51 -from __future__ import unicode_literals - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion -import sapl.materia.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('auth', '0007_alter_validators_add_error_messages'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('materia', '0038_auto_20160612_1506'), - ] - - operations = [ - migrations.AddField( - model_name='autor', - name='email', - field=models.EmailField(default=' ', max_length=254, verbose_name='Email'), - preserve_default=False, - ), - migrations.AddField( - model_name='autor', - name='grupo_usuario', - field=models.ForeignKey(default=sapl.materia.models.grupo_autor, on_delete=django.db.models.deletion.CASCADE, to='auth.Group'), - ), - migrations.AddField( - model_name='autor', - name='user', - field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), - preserve_default=False, - ), - ] diff --git a/sapl/materia/migrations/0039_auto_20160808_1753.py b/sapl/materia/migrations/0039_auto_20160808_1753.py deleted file mode 100644 index a7473aa59..000000000 --- a/sapl/materia/migrations/0039_auto_20160808_1753.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-08-08 20:53 -from __future__ import unicode_literals - -from django.db import migrations, models -import sapl.materia.models -import sapl.utils - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0038_auto_20160612_1506'), - ] - - operations = [ - migrations.RemoveField( - model_name='proposicao', - name='data_devolucao', - ), - migrations.AddField( - model_name='proposicao', - name='data_incorporação', - field=models.DateTimeField(blank=True, null=True, verbose_name='Data de Incorporação'), - ), - migrations.AlterField( - model_name='proposicao', - name='data_recebimento', - field=models.DateTimeField(blank=True, null=True, verbose_name='Data de Recebimento'), - ), - migrations.AlterField( - model_name='proposicao', - name='status', - field=models.CharField(blank=True, choices=[('E', 'Enviada'), ('R', 'Recebida'), ('I', 'Incorporada')], max_length=1, verbose_name='Status Proposição'), - ), - migrations.AlterField( - model_name='proposicao', - name='texto_original', - field=models.FileField(default='', upload_to=sapl.materia.models.texto_upload_path, validators=[sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Texto Original'), - preserve_default=False, - ), - ] diff --git a/sapl/materia/migrations/0040_auto_20160810_1524.py b/sapl/materia/migrations/0040_auto_20160810_1524.py deleted file mode 100644 index 798bd8a64..000000000 --- a/sapl/materia/migrations/0040_auto_20160810_1524.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-08-10 18:24 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0039_auto_20160808_1753'), - ] - - operations = [ - migrations.RemoveField( - model_name='proposicao', - name='documento', - ), - migrations.AddField( - model_name='proposicao', - name='documento_gerado', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='materia.DocumentoAcessorio'), - ), - migrations.AddField( - model_name='proposicao', - name='materia_gerada', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='materia_gerada', to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='proposicao', - name='materia', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='materia_vinculada', to='materia.MateriaLegislativa', verbose_name='Matéria'), - ), - ] diff --git a/sapl/materia/migrations/0041_remove_proposicao_data_incorporação.py b/sapl/materia/migrations/0041_remove_proposicao_data_incorporação.py deleted file mode 100644 index 126ef1687..000000000 --- a/sapl/materia/migrations/0041_remove_proposicao_data_incorporação.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-08-10 20:02 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0040_auto_20160810_1524'), - ] - - operations = [ - migrations.RemoveField( - model_name='proposicao', - name='data_incorporação', - ), - ] diff --git a/sapl/materia/migrations/0042_proposicao_data_devolução.py b/sapl/materia/migrations/0042_proposicao_data_devolução.py deleted file mode 100644 index cb17864d6..000000000 --- a/sapl/materia/migrations/0042_proposicao_data_devolução.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-08-10 20:37 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0041_remove_proposicao_data_incorporação'), - ] - - operations = [ - migrations.AddField( - model_name='proposicao', - name='data_devolução', - field=models.DateTimeField(blank=True, null=True, verbose_name='Data de Devolução'), - ), - ] diff --git a/sapl/materia/migrations/0043_auto_20160810_1738.py b/sapl/materia/migrations/0043_auto_20160810_1738.py deleted file mode 100644 index 4012d1162..000000000 --- a/sapl/materia/migrations/0043_auto_20160810_1738.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-08-10 20:38 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0042_proposicao_data_devolução'), - ] - - operations = [ - migrations.RenameField( - model_name='proposicao', - old_name='data_devolução', - new_name='data_devolucao', - ), - ] diff --git a/sapl/materia/migrations/0044_merge.py b/sapl/materia/migrations/0044_merge.py deleted file mode 100644 index 43a6fdb36..000000000 --- a/sapl/materia/migrations/0044_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-08-22 20:18 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0039_auto_20160628_1251'), - ('materia', '0043_auto_20160810_1738'), - ] - - operations = [ - ] diff --git a/sapl/materia/migrations/0045_auto_20160823_1658.py b/sapl/materia/migrations/0045_auto_20160823_1658.py deleted file mode 100644 index 6c0b8ddbf..000000000 --- a/sapl/materia/migrations/0045_auto_20160823_1658.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-08-23 19:58 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0044_merge'), - ] - - operations = [ - migrations.RemoveField( - model_name='autor', - name='grupo_usuario', - ), - migrations.AlterField( - model_name='autor', - name='username', - field=models.CharField(blank=True, max_length=50, verbose_name='Nome de Usuário'), - ), - ] diff --git a/sapl/materia/migrations/0046_auto_20160825_1504.py b/sapl/materia/migrations/0046_auto_20160825_1504.py deleted file mode 100644 index 26e078d05..000000000 --- a/sapl/materia/migrations/0046_auto_20160825_1504.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- 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/0046_auto_20160825_1833.py b/sapl/materia/migrations/0046_auto_20160825_1833.py deleted file mode 100644 index 25b586eb3..000000000 --- a/sapl/materia/migrations/0046_auto_20160825_1833.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-08-25 21:33 -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 deleted file mode 100644 index dd4fbdfa2..000000000 --- a/sapl/materia/migrations/0047_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- 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/migrations/0048_auto_20160927_1254.py b/sapl/materia/migrations/0048_auto_20160927_1254.py deleted file mode 100644 index c229b854a..000000000 --- a/sapl/materia/migrations/0048_auto_20160927_1254.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-27 15:54 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0047_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='autoria', - name='autor', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='materia.Autor', verbose_name='Autor'), - ), - migrations.AlterField( - model_name='autoria', - name='partido', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='parlamentares.Partido', verbose_name='Partido'), - ), - ] diff --git a/sapl/materia/migrations/0049_remove_autoria_partido.py b/sapl/materia/migrations/0049_remove_autoria_partido.py deleted file mode 100644 index 6f5002e05..000000000 --- a/sapl/materia/migrations/0049_remove_autoria_partido.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-29 14:11 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0048_auto_20160927_1254'), - ] - - operations = [ - migrations.RemoveField( - model_name='autoria', - name='partido', - ), - ] diff --git a/sapl/materia/migrations/0050_auto_20161003_0417.py b/sapl/materia/migrations/0050_auto_20161003_0417.py deleted file mode 100644 index 2506b31a9..000000000 --- a/sapl/materia/migrations/0050_auto_20161003_0417.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-03 07:17 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0049_remove_autoria_partido'), - ] - - operations = [ - migrations.AlterModelOptions( - name='tramitacao', - options={'ordering': ('data_tramitacao',), 'verbose_name': 'Tramitação', 'verbose_name_plural': 'Tramitações'}, - ), - ] diff --git a/sapl/materia/migrations/0051_auto_20161004_0927.py b/sapl/materia/migrations/0051_auto_20161004_0927.py deleted file mode 100644 index db4e3349e..000000000 --- a/sapl/materia/migrations/0051_auto_20161004_0927.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-04 12:27 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0050_auto_20161003_0417'), - ] - - operations = [ - migrations.AlterModelOptions( - name='tramitacao', - options={'ordering': ('-data_tramitacao',), 'verbose_name': 'Tramitação', 'verbose_name_plural': 'Tramitações'}, - ), - ] diff --git a/sapl/materia/migrations/0052_auto_20161004_1041.py b/sapl/materia/migrations/0052_auto_20161004_1041.py deleted file mode 100644 index eefa28ea8..000000000 --- a/sapl/materia/migrations/0052_auto_20161004_1041.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-04 13:41 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0051_auto_20161004_0927'), - ] - - operations = [ - migrations.AlterField( - model_name='regimetramitacao', - name='descricao', - field=models.CharField(max_length=50, verbose_name='Descrição'), - ), - ] diff --git a/sapl/materia/migrations/0053_auto_20161004_1854.py b/sapl/materia/migrations/0053_auto_20161004_1854.py deleted file mode 100644 index b9e2bd88a..000000000 --- a/sapl/materia/migrations/0053_auto_20161004_1854.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-04 21:54 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0052_auto_20161004_1041'), - ] - - operations = [ - migrations.AlterModelOptions( - name='tramitacao', - options={'verbose_name': 'Tramitação', 'verbose_name_plural': 'Tramitações'}, - ), - ] diff --git a/sapl/materia/migrations/0054_auto_20161009_1222.py b/sapl/materia/migrations/0054_auto_20161009_1222.py deleted file mode 100644 index 48a12f263..000000000 --- a/sapl/materia/migrations/0054_auto_20161009_1222.py +++ /dev/null @@ -1,63 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-09 15:22 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -def clear_model_autoria(apps, schema_editor): - Autoria = apps.get_model("materia", "Autoria") - Autoria.objects.all().delete() - Proposicao = apps.get_model("materia", "Proposicao") - Proposicao.objects.all().delete() - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0003_auto_20161009_1222'), - ('materia', '0053_auto_20161004_1854'), - ] - - operations = [ - migrations.RunPython(clear_model_autoria), - migrations.RemoveField( - model_name='autor', - name='comissao', - ), - migrations.RemoveField( - model_name='autor', - name='parlamentar', - ), - migrations.RemoveField( - model_name='autor', - name='partido', - ), - migrations.RemoveField( - model_name='autor', - name='tipo', - ), - migrations.RemoveField( - model_name='autor', - name='user', - ), - migrations.AlterField( - model_name='autoria', - name='autor', - field=models.OneToOneField( - on_delete=django.db.models.deletion.CASCADE, to='base.Autor', verbose_name='Autor'), - ), - migrations.AlterField( - model_name='proposicao', - name='autor', - field=models.ForeignKey( - blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='base.Autor'), - ), - migrations.DeleteModel( - name='Autor', - ), - migrations.DeleteModel( - name='TipoAutor', - ), - ] diff --git a/sapl/materia/migrations/0054_auto_20161011_0904.py b/sapl/materia/migrations/0054_auto_20161011_0904.py deleted file mode 100644 index c4a2b34bb..000000000 --- a/sapl/materia/migrations/0054_auto_20161011_0904.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-11 12:04 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0053_auto_20161004_1854'), - ] - - operations = [ - migrations.AlterField( - model_name='materialegislativa', - name='em_tramitacao', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Em Tramitação?'), - ), - ] diff --git a/sapl/materia/migrations/0055_auto_20161009_1418.py b/sapl/materia/migrations/0055_auto_20161009_1418.py deleted file mode 100644 index 8168ab4e4..000000000 --- a/sapl/materia/migrations/0055_auto_20161009_1418.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-09 17:18 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('base', '0022_auto_20161009_1222'), - ('materia', '0054_auto_20161009_1222'), - ] - - operations = [ - migrations.AddField( - model_name='materialegislativa', - name='autores', - field=models.ManyToManyField(through='materia.Autoria', to='base.Autor'), - ), - migrations.AlterField( - model_name='autoria', - name='autor', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='base.Autor', verbose_name='Autor'), - ), - migrations.AlterField( - model_name='autoria', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='materia.MateriaLegislativa', verbose_name='Matéria Legislativa'), - ), - ] diff --git a/sapl/materia/migrations/0056_merge.py b/sapl/materia/migrations/0056_merge.py deleted file mode 100644 index 895977296..000000000 --- a/sapl/materia/migrations/0056_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-11 19:45 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0055_auto_20161009_1418'), - ('materia', '0054_auto_20161011_0904'), - ] - - operations = [ - ] diff --git a/sapl/materia/migrations/0056_remove_tipo_proposicao.py b/sapl/materia/migrations/0056_remove_tipo_proposicao.py deleted file mode 100644 index 42d212c57..000000000 --- a/sapl/materia/migrations/0056_remove_tipo_proposicao.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-11 19:45 -from __future__ import unicode_literals - -from django.db import migrations - - -def clear_model_tipo_proposicao(apps, schema_editor): - TipoProposicao = apps.get_model("materia", "TipoProposicao") - TipoProposicao.objects.all().delete() - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0056_merge'), - ] - - operations = [ - migrations.RunPython(clear_model_tipo_proposicao), ] diff --git a/sapl/materia/migrations/0057_auto_20161016_0156.py b/sapl/materia/migrations/0057_auto_20161016_0156.py deleted file mode 100644 index 31dad187e..000000000 --- a/sapl/materia/migrations/0057_auto_20161016_0156.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-16 03:56 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -def clear_model_tipo_proposicao(apps, schema_editor): - TipoProposicao = apps.get_model("materia", "TipoProposicao") - TipoProposicao.objects.all().delete() - - -class Migration(migrations.Migration): - - dependencies = [ - ('contenttypes', '0002_remove_content_type_name'), - ('materia', '0056_remove_tipo_proposicao'), - ] - - operations = [ - migrations.RunPython(clear_model_tipo_proposicao), - migrations.RemoveField( - model_name='tipoproposicao', - name='materia_ou_documento', - ), - migrations.RemoveField( - model_name='tipoproposicao', - name='modelo', - ), - migrations.RemoveField( - model_name='tipoproposicao', - name='tipo_documento', - ), - migrations.RemoveField( - model_name='tipoproposicao', - name='tipo_materia', - ), - migrations.AddField( - model_name='tipoproposicao', - name='conteudo', - field=models.ForeignKey( - default=None, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType', verbose_name='Conteúdo'), - ), - ] diff --git a/sapl/materia/migrations/0058_auto_20161016_0329.py b/sapl/materia/migrations/0058_auto_20161016_0329.py deleted file mode 100644 index caacc710c..000000000 --- a/sapl/materia/migrations/0058_auto_20161016_0329.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-16 05:29 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0057_auto_20161016_0156'), - ] - - operations = [ - migrations.AddField( - model_name='tipoproposicao', - name='object_id', - field=models.PositiveIntegerField(blank=True, default=None, null=True), - ), - migrations.AlterField( - model_name='tipoproposicao', - name='conteudo', - field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType', verbose_name='Definição de Tipo'), - ), - ] diff --git a/sapl/materia/migrations/0059_auto_20161016_1333.py b/sapl/materia/migrations/0059_auto_20161016_1333.py deleted file mode 100644 index 8ec92f96f..000000000 --- a/sapl/materia/migrations/0059_auto_20161016_1333.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-16 15:33 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0058_auto_20161016_0329'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='tipoproposicao', - unique_together=set([('conteudo', 'object_id')]), - ), - ] diff --git a/sapl/materia/migrations/0060_auto_20161017_0050.py b/sapl/materia/migrations/0060_auto_20161017_0050.py deleted file mode 100644 index ec0cc4d8a..000000000 --- a/sapl/materia/migrations/0060_auto_20161017_0050.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-17 02:50 -from __future__ import unicode_literals - -from django.db import migrations, models -import sapl.materia.models -import sapl.utils - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0059_auto_20161016_1333'), - ] - - operations = [ - migrations.AlterField( - model_name='proposicao', - name='texto_original', - field=models.FileField(blank=True, null=True, upload_to=sapl.materia.models.texto_upload_path, validators=[sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Texto Original'), - ), - ] diff --git a/sapl/materia/migrations/0061_auto_20161017_1655.py b/sapl/materia/migrations/0061_auto_20161017_1655.py deleted file mode 100644 index cbe8a0568..000000000 --- a/sapl/materia/migrations/0061_auto_20161017_1655.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-17 18:55 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0060_auto_20161017_0050'), - ] - - operations = [ - migrations.AlterField( - model_name='proposicao', - name='descricao', - field=models.TextField(verbose_name='Descrição'), - ), - ] diff --git a/sapl/materia/migrations/0062_auto_20161021_1424.py b/sapl/materia/migrations/0062_auto_20161021_1424.py deleted file mode 100644 index c9d8985ea..000000000 --- a/sapl/materia/migrations/0062_auto_20161021_1424.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-21 14:24 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0061_auto_20161017_1655'), - ] - - operations = [ - migrations.AlterField( - model_name='proposicao', - name='autor', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='base.Autor'), - ), - migrations.AlterField( - model_name='proposicao', - name='materia', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='materia_vinculada', to='materia.MateriaLegislativa', verbose_name='Matéria Vinculada'), - ), - ] diff --git a/sapl/materia/migrations/0063_auto_20161021_1445.py b/sapl/materia/migrations/0063_auto_20161021_1445.py deleted file mode 100644 index 4a9a8a0dd..000000000 --- a/sapl/materia/migrations/0063_auto_20161021_1445.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-21 14:45 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0062_auto_20161021_1424'), - ] - - operations = [ - migrations.RemoveField( - model_name='proposicao', - name='materia', - ), - migrations.AddField( - model_name='proposicao', - name='materia_vinculada', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='proposicao_set', to='materia.MateriaLegislativa', verbose_name='Matéria Vinculada'), - ), - ] diff --git a/sapl/materia/migrations/0064_auto_20161022_1405.py b/sapl/materia/migrations/0064_auto_20161022_1405.py deleted file mode 100644 index e7db0ecd7..000000000 --- a/sapl/materia/migrations/0064_auto_20161022_1405.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-22 14:05 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('contenttypes', '0002_remove_content_type_name'), - ('materia', '0063_auto_20161021_1445'), - ] - - operations = [ - migrations.AddField( - model_name='proposicao', - name='content_type', - field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType', verbose_name='Tipo de Material Gerado'), - ), - migrations.AddField( - model_name='proposicao', - name='materia_de_vinculo', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='proposicao_set', to='materia.MateriaLegislativa', verbose_name='Matéria anexadora'), - ), - migrations.AddField( - model_name='proposicao', - name='object_id', - field=models.PositiveIntegerField(blank=True, default=None, null=True), - ), - migrations.RemoveField( - model_name='proposicao', - name='documento_gerado', - ), - migrations.RemoveField( - model_name='proposicao', - name='materia_gerada', - ), - migrations.RemoveField( - model_name='proposicao', - name='materia_vinculada', - ), - migrations.AlterUniqueTogether( - name='proposicao', - unique_together=set([('content_type', 'object_id')]), - ), - ] diff --git a/sapl/materia/migrations/0065_auto_20161022_1411.py b/sapl/materia/migrations/0065_auto_20161022_1411.py deleted file mode 100644 index ce3a060df..000000000 --- a/sapl/materia/migrations/0065_auto_20161022_1411.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-22 14:11 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0064_auto_20161022_1405'), - ] - - operations = [ - migrations.AlterField( - model_name='proposicao', - name='content_type', - field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType', verbose_name='Tipo de Material Gerado'), - ), - ] diff --git a/sapl/materia/migrations/0066_proposicao_ano.py b/sapl/materia/migrations/0066_proposicao_ano.py deleted file mode 100644 index d7152e987..000000000 --- a/sapl/materia/migrations/0066_proposicao_ano.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-22 23:03 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0065_auto_20161022_1411'), - ] - - operations = [ - migrations.AddField( - model_name='proposicao', - name='ano', - field=models.PositiveSmallIntegerField(blank=True, choices=[(2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=None, null=True, verbose_name='Ano'), - ), - ] diff --git a/sapl/materia/migrations/0067_auto_20161025_1630.py b/sapl/materia/migrations/0067_auto_20161025_1630.py deleted file mode 100644 index 93e8eac0c..000000000 --- a/sapl/materia/migrations/0067_auto_20161025_1630.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-25 16:30 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0066_proposicao_ano'), - ] - - operations = [ - migrations.RenameField( - model_name='tipoproposicao', - old_name='conteudo', - new_name='content_type', - ), - migrations.AlterUniqueTogether( - name='tipoproposicao', - unique_together=set([('content_type', 'object_id')]), - ), - ] diff --git a/sapl/materia/migrations/0068_auto_20161110_0910.py b/sapl/materia/migrations/0068_auto_20161110_0910.py deleted file mode 100644 index 5d4bc7b36..000000000 --- a/sapl/materia/migrations/0068_auto_20161110_0910.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-10 09:10 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0067_auto_20161025_1630'), - ] - - operations = [ - migrations.AlterField( - model_name='materialegislativa', - name='ano', - field=models.PositiveSmallIntegerField(choices=[('', 'Selecione'), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - migrations.AlterField( - model_name='materialegislativa', - name='ano_origem_externa', - field=models.PositiveSmallIntegerField(blank=True, choices=[('', 'Selecione'), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], null=True, verbose_name='Ano'), - ), - migrations.AlterField( - model_name='numeracao', - name='ano_materia', - field=models.PositiveSmallIntegerField(choices=[('', 'Selecione'), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - migrations.AlterField( - model_name='proposicao', - name='ano', - field=models.PositiveSmallIntegerField(blank=True, choices=[('', 'Selecione'), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=None, null=True, verbose_name='Ano'), - ), - ] diff --git a/sapl/materia/migrations/0069_tipoproposicao_perfis.py b/sapl/materia/migrations/0069_tipoproposicao_perfis.py deleted file mode 100644 index e6bcb3076..000000000 --- a/sapl/materia/migrations/0069_tipoproposicao_perfis.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-11 10:05 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('compilacao', '0069_auto_20161107_1932'), - ('materia', '0068_auto_20161110_0910'), - ] - - operations = [ - migrations.AddField( - model_name='tipoproposicao', - name='perfis', - field=models.ManyToManyField(blank=True, to='compilacao.PerfilEstruturalTextoArticulado', verbose_name='Perfis Estruturais de Textos Articulados'), - ), - ] diff --git a/sapl/materia/migrations/0070_auto_20161111_1301.py b/sapl/materia/migrations/0070_auto_20161111_1301.py deleted file mode 100644 index 38a53d9cd..000000000 --- a/sapl/materia/migrations/0070_auto_20161111_1301.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-11 13:01 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0069_tipoproposicao_perfis'), - ] - - operations = [ - migrations.AlterField( - model_name='tipoproposicao', - name='perfis', - field=models.ManyToManyField(blank=True, help_text='\n Mesmo que em Configurações da Aplicação nas\n Tabelas Auxiliares esteja definido que Proposições possam\n utilizar Textos Articulados, ao gerar uma proposição,\n a solução de Textos Articulados será disponibilizada se\n o Tipo escolhido para a Proposição estiver associado a ao\n menos um Perfil Estrutural de Texto Articulado.\n ', - to='compilacao.PerfilEstruturalTextoArticulado', verbose_name='Perfis Estruturais de Textos Articulados'), - ), - ] diff --git a/sapl/materia/migrations/0071_auto_20161130_1001.py b/sapl/materia/migrations/0071_auto_20161130_1001.py deleted file mode 100644 index c1b688121..000000000 --- a/sapl/materia/migrations/0071_auto_20161130_1001.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.11 on 2016-11-30 10:01 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0070_auto_20161111_1301'), - ] - - operations = [ - migrations.AlterModelOptions( - name='proposicao', - options={'permissions': (('detail_proposicao_enviada', 'Pode acessar detalhes de uma proposição enviada.'), ('detail_proposicao_devolvida', 'Pode acessar detalhes de uma proposição devolvida.')), 'verbose_name': 'Proposição', 'verbose_name_plural': 'Proposições'}, - ), - ] diff --git a/sapl/materia/migrations/0072_auto_20161130_1618.py b/sapl/materia/migrations/0072_auto_20161130_1618.py deleted file mode 100644 index da265d3ff..000000000 --- a/sapl/materia/migrations/0072_auto_20161130_1618.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.11 on 2016-11-30 16:18 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0071_auto_20161130_1001'), - ] - - operations = [ - migrations.AlterModelOptions( - name='proposicao', - options={'permissions': (('detail_proposicao_enviada', 'Pode acessar detalhes de uma proposição enviada.'), ('detail_proposicao_devolvida', 'Pode acessar detalhes de uma proposição devolvida.'), ('detail_proposicao_incorporada', 'Pode acessar detalhes de uma proposição incorporada.')), 'verbose_name': 'Proposição', 'verbose_name_plural': 'Proposições'}, - ), - ] diff --git a/sapl/materia/migrations/0073_auto_20161216_1640.py b/sapl/materia/migrations/0073_auto_20161216_1640.py deleted file mode 100644 index 55717d87d..000000000 --- a/sapl/materia/migrations/0073_auto_20161216_1640.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.12 on 2016-12-16 16:40 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0072_auto_20161130_1618'), - ] - - operations = [ - migrations.AlterModelOptions( - name='statustramitacao', - options={'ordering': ['descricao'], 'verbose_name': 'Status de Tramitação', 'verbose_name_plural': 'Status de Tramitação'}, - ), - migrations.AlterModelOptions( - name='tipomaterialegislativa', - options={'ordering': ['descricao'], 'verbose_name': 'Tipo de Matéria Legislativa', 'verbose_name_plural': 'Tipos de Matérias Legislativas'}, - ), - ] diff --git a/sapl/materia/migrations/0074_auto_20170102_0951.py b/sapl/materia/migrations/0074_auto_20170102_0951.py deleted file mode 100644 index 12422eeb8..000000000 --- a/sapl/materia/migrations/0074_auto_20170102_0951.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-01-02 09:51 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0073_auto_20161216_1640'), - ] - - operations = [ - migrations.AlterField( - model_name='materialegislativa', - name='ano', - field=models.PositiveSmallIntegerField(choices=[('', 'Selecione'), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - migrations.AlterField( - model_name='materialegislativa', - name='ano_origem_externa', - field=models.PositiveSmallIntegerField(blank=True, choices=[('', 'Selecione'), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], null=True, verbose_name='Ano'), - ), - migrations.AlterField( - model_name='numeracao', - name='ano_materia', - field=models.PositiveSmallIntegerField(choices=[('', 'Selecione'), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - migrations.AlterField( - model_name='proposicao', - name='ano', - field=models.PositiveSmallIntegerField(blank=True, choices=[('', 'Selecione'), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=None, null=True, verbose_name='Ano'), - ), - ] diff --git a/sapl/materia/migrations/0075_auto_20170123_1548.py b/sapl/materia/migrations/0075_auto_20170123_1548.py deleted file mode 100644 index 7a1ca66ea..000000000 --- a/sapl/materia/migrations/0075_auto_20170123_1548.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-01-23 15:48 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0074_auto_20170102_0951'), - ] - - operations = [ - migrations.AlterField( - model_name='materialegislativa', - name='ano', - field=models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - migrations.AlterField( - model_name='materialegislativa', - name='ano_origem_externa', - field=models.PositiveSmallIntegerField(blank=True, choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], null=True, verbose_name='Ano'), - ), - migrations.AlterField( - model_name='numeracao', - name='ano_materia', - field=models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - migrations.AlterField( - model_name='proposicao', - name='ano', - field=models.PositiveSmallIntegerField(blank=True, choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=None, null=True, verbose_name='Ano'), - ), - ] diff --git a/sapl/materia/migrations/0075_auto_20170203_1019.py b/sapl/materia/migrations/0075_auto_20170203_1019.py deleted file mode 100644 index c8e5e5887..000000000 --- a/sapl/materia/migrations/0075_auto_20170203_1019.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-02-03 10:19 -from __future__ import unicode_literals - -from django.db import migrations, models -import sapl.utils - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0074_auto_20170102_0951'), - ] - - operations = [ - migrations.AlterField( - model_name='autoria', - name='primeiro_autor', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Primeiro Autor'), - ), - migrations.AlterField( - model_name='materialegislativa', - name='ano', - field=models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - migrations.AlterField( - model_name='materialegislativa', - name='ano_origem_externa', - field=models.PositiveSmallIntegerField(blank=True, choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], null=True, verbose_name='Ano'), - ), - migrations.AlterField( - model_name='materialegislativa', - name='texto_original', - field=models.FileField(blank=True, null=True, upload_to=sapl.utils.texto_upload_path, validators=[sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Texto Original'), - ), - migrations.AlterField( - model_name='numeracao', - name='ano_materia', - field=models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - migrations.AlterField( - model_name='proposicao', - name='ano', - field=models.PositiveSmallIntegerField(blank=True, choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], default=None, null=True, verbose_name='Ano'), - ), - ] diff --git a/sapl/materia/migrations/0076_merge.py b/sapl/materia/migrations/0076_merge.py deleted file mode 100644 index 49ae8f130..000000000 --- a/sapl/materia/migrations/0076_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-03-03 16:34 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0075_auto_20170203_1019'), - ('materia', '0075_auto_20170123_1548'), - ] - - operations = [ - ] diff --git a/sapl/materia/migrations/0077_auto_20170321_1130.py b/sapl/materia/migrations/0077_auto_20170321_1130.py deleted file mode 100644 index a39b48c1d..000000000 --- a/sapl/materia/migrations/0077_auto_20170321_1130.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-03-21 11:30 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0076_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='relatoria', - name='comissao', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='comissoes.Comissao', verbose_name='Comissão'), - ), - ] diff --git a/sapl/materia/migrations/0078_auto_20170325_1052.py b/sapl/materia/migrations/0078_auto_20170325_1052.py deleted file mode 100644 index fb0a733af..000000000 --- a/sapl/materia/migrations/0078_auto_20170325_1052.py +++ /dev/null @@ -1,181 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.12 on 2017-03-25 10:52 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0077_auto_20170321_1130'), - ] - - operations = [ - migrations.AlterField( - model_name='acompanhamentomateria', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='anexada', - name='materia_anexada', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='materia_anexada_set', to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='anexada', - name='materia_principal', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='materia_principal_set', to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='autoria', - name='autor', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='base.Autor', verbose_name='Autor'), - ), - migrations.AlterField( - model_name='autoria', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa', verbose_name='Matéria Legislativa'), - ), - migrations.AlterField( - model_name='despachoinicial', - name='comissao', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='comissoes.Comissao'), - ), - migrations.AlterField( - model_name='despachoinicial', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='documentoacessorio', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='documentoacessorio', - name='tipo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.TipoDocumento', verbose_name='Tipo'), - ), - migrations.AlterField( - model_name='materiaassunto', - name='assunto', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.AssuntoMateria'), - ), - migrations.AlterField( - model_name='materiaassunto', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='materialegislativa', - name='local_origem_externa', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.Origem', verbose_name='Local Origem'), - ), - migrations.AlterField( - model_name='materialegislativa', - name='regime_tramitacao', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.RegimeTramitacao', verbose_name='Regime Tramitação'), - ), - migrations.AlterField( - model_name='materialegislativa', - name='tipo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.TipoMateriaLegislativa', verbose_name='Tipo'), - ), - migrations.AlterField( - model_name='materialegislativa', - name='tipo_origem_externa', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='tipo_origem_externa_set', to='materia.TipoMateriaLegislativa', verbose_name='Tipo'), - ), - migrations.AlterField( - model_name='numeracao', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='numeracao', - name='tipo_materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.TipoMateriaLegislativa', verbose_name='Tipo de Matéria'), - ), - migrations.AlterField( - model_name='parecer', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='parecer', - name='relatoria', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.Relatoria'), - ), - migrations.AlterField( - model_name='proposicao', - name='materia_de_vinculo', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='proposicao_set', to='materia.MateriaLegislativa', verbose_name='Matéria anexadora'), - ), - migrations.AlterField( - model_name='proposicao', - name='tipo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.TipoProposicao', verbose_name='Tipo'), - ), - migrations.AlterField( - model_name='relatoria', - name='comissao', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='comissoes.Comissao', verbose_name='Comissão'), - ), - migrations.AlterField( - model_name='relatoria', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='relatoria', - name='parlamentar', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar', verbose_name='Parlamentar'), - ), - migrations.AlterField( - model_name='relatoria', - name='tipo_fim_relatoria', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.TipoFimRelatoria', verbose_name='Motivo Fim Relatoria'), - ), - migrations.AlterField( - model_name='tipoproposicao', - name='content_type', - field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.PROTECT, to='contenttypes.ContentType', verbose_name='Definição de Tipo'), - ), - migrations.AlterField( - model_name='tramitacao', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='tramitacao', - name='status', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.StatusTramitacao', verbose_name='Status'), - ), - migrations.AlterField( - model_name='tramitacao', - name='unidade_tramitacao_destino', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='tramitacoes_destino', to='materia.UnidadeTramitacao', verbose_name='Unidade Destino'), - ), - migrations.AlterField( - model_name='tramitacao', - name='unidade_tramitacao_local', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='tramitacoes_origem', to='materia.UnidadeTramitacao', verbose_name='Unidade Local'), - ), - migrations.AlterField( - model_name='unidadetramitacao', - name='comissao', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='comissoes.Comissao', verbose_name='Comissão'), - ), - migrations.AlterField( - model_name='unidadetramitacao', - name='orgao', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.Orgao', verbose_name='Órgão'), - ), - migrations.AlterField( - model_name='unidadetramitacao', - name='parlamentar', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar', verbose_name='Parlamentar'), - ), - ] diff --git a/sapl/norma/migrations/0001_initial.py b/sapl/norma/migrations/0001_initial.py index 1e3be4b19..5ccc01658 100644 --- a/sapl/norma/migrations/0001_initial.py +++ b/sapl/norma/migrations/0001_initial.py @@ -1,11 +1,16 @@ # -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 11:14 from __future__ import unicode_literals from django.db import migrations, models +import django.db.models.deletion +import sapl.utils class Migration(migrations.Migration): + initial = True + dependencies = [ ('materia', '0001_initial'), ] @@ -14,98 +19,118 @@ class Migration(migrations.Migration): migrations.CreateModel( name='AssuntoNorma', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('assunto', models.CharField(max_length=50, verbose_name='Assunto')), - ('descricao', models.CharField(blank=True, max_length=250, null=True, verbose_name='Descrição')), + ('descricao', models.CharField(blank=True, max_length=250, verbose_name='Descrição')), ], options={ - 'verbose_name_plural': 'Assuntos de Norma', 'verbose_name': 'Assunto de Norma', + 'verbose_name_plural': 'Assuntos de Norma', }, ), migrations.CreateModel( name='LegislacaoCitada', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('disposicoes', models.CharField(blank=True, max_length=15, null=True, verbose_name='Disposição')), - ('parte', models.CharField(blank=True, max_length=8, null=True, verbose_name='Parte')), - ('livro', models.CharField(blank=True, max_length=7, null=True, verbose_name='Livro')), - ('titulo', models.CharField(blank=True, max_length=7, null=True, verbose_name='Título')), - ('capitulo', models.CharField(blank=True, max_length=7, null=True, verbose_name='Capítulo')), - ('secao', models.CharField(blank=True, max_length=7, null=True, verbose_name='Seção')), - ('subsecao', models.CharField(blank=True, max_length=7, null=True, verbose_name='Subseção')), - ('artigo', models.CharField(blank=True, max_length=4, null=True, verbose_name='Artigo')), - ('paragrafo', models.CharField(blank=True, max_length=3, null=True, verbose_name='Parágrafo')), - ('inciso', models.CharField(blank=True, max_length=10, null=True, verbose_name='Inciso')), - ('alinea', models.CharField(blank=True, max_length=3, null=True, verbose_name='Alínea')), - ('item', models.CharField(blank=True, max_length=3, null=True, verbose_name='Item')), - ('materia', models.ForeignKey(to='materia.MateriaLegislativa')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('disposicoes', models.CharField(blank=True, max_length=15, verbose_name='Disposição')), + ('parte', models.CharField(blank=True, max_length=8, verbose_name='Parte')), + ('livro', models.CharField(blank=True, max_length=7, verbose_name='Livro')), + ('titulo', models.CharField(blank=True, max_length=7, verbose_name='Título')), + ('capitulo', models.CharField(blank=True, max_length=7, verbose_name='Capítulo')), + ('secao', models.CharField(blank=True, max_length=7, verbose_name='Seção')), + ('subsecao', models.CharField(blank=True, max_length=7, verbose_name='Subseção')), + ('artigo', models.CharField(blank=True, max_length=4, verbose_name='Artigo')), + ('paragrafo', models.CharField(blank=True, max_length=3, verbose_name='Parágrafo')), + ('inciso', models.CharField(blank=True, max_length=10, verbose_name='Inciso')), + ('alinea', models.CharField(blank=True, max_length=3, verbose_name='Alínea')), + ('item', models.CharField(blank=True, max_length=3, verbose_name='Item')), + ('materia', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa')), ], options={ - 'verbose_name_plural': 'Matérias Legislativas', - 'verbose_name': 'Matéria Legislativa', + 'verbose_name': 'Legislação', + 'verbose_name_plural': 'Legislações', }, ), migrations.CreateModel( name='NormaJuridica', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('numero', models.IntegerField(verbose_name='Número')), - ('ano', models.SmallIntegerField(verbose_name='Ano')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('texto_integral', models.FileField(blank=True, null=True, upload_to=sapl.utils.texto_upload_path, verbose_name='Texto Integral')), + ('numero', models.CharField(max_length=8, verbose_name='Número')), + ('ano', models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano')), ('esfera_federacao', models.CharField(choices=[('E', 'Estadual'), ('F', 'Federal'), ('M', 'Municipal')], max_length=1, verbose_name='Esfera Federação')), - ('data', models.DateField(blank=True, null=True, verbose_name='Data')), + ('data', models.DateField(verbose_name='Data')), ('data_publicacao', models.DateField(blank=True, null=True, verbose_name='Data Publicação')), - ('veiculo_publicacao', models.CharField(blank=True, max_length=30, null=True, verbose_name='Veículo Publicação')), - ('pagina_inicio_publicacao', models.IntegerField(blank=True, null=True, verbose_name='Pg. Início')), - ('pagina_fim_publicacao', models.IntegerField(blank=True, null=True, verbose_name='Pg. Fim')), + ('veiculo_publicacao', models.CharField(blank=True, max_length=30, verbose_name='Veículo Publicação')), + ('pagina_inicio_publicacao', models.PositiveIntegerField(blank=True, null=True, verbose_name='Pg. Início')), + ('pagina_fim_publicacao', models.PositiveIntegerField(blank=True, null=True, verbose_name='Pg. Fim')), ('ementa', models.TextField(verbose_name='Ementa')), - ('indexacao', models.TextField(blank=True, null=True, verbose_name='Indexação')), - ('observacao', models.TextField(blank=True, null=True, verbose_name='Observação')), - ('complemento', models.NullBooleanField(verbose_name='Complementar ?')), + ('indexacao', models.TextField(blank=True, verbose_name='Indexação')), + ('observacao', models.TextField(blank=True, verbose_name='Observação')), + ('complemento', models.NullBooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Complementar ?')), ('data_vigencia', models.DateField(blank=True, null=True)), ('timestamp', models.DateTimeField()), - ('assunto', models.ForeignKey(to='norma.AssuntoNorma')), - ('materia', models.ForeignKey(blank=True, null=True, to='materia.MateriaLegislativa')), + ('assuntos', models.ManyToManyField(blank=True, to='norma.AssuntoNorma', verbose_name='Assuntos')), + ('materia', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa', verbose_name='Matéria')), ], options={ - 'verbose_name_plural': 'Normas Jurídicas', + 'ordering': ['-data', '-numero'], 'verbose_name': 'Norma Jurídica', + 'verbose_name_plural': 'Normas Jurídicas', + }, + ), + migrations.CreateModel( + name='NormaRelacionada', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('norma_principal', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='norma_principal', to='norma.NormaJuridica', verbose_name='Norma Principal')), + ('norma_relacionada', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='norma_relacionada', to='norma.NormaJuridica', verbose_name='Norma Relacionada')), + ], + options={ + 'verbose_name': 'Norma Relacionada', + 'verbose_name_plural': 'Normas Relacionadas', }, ), migrations.CreateModel( name='TipoNormaJuridica', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('equivalente_lexml', models.CharField(blank=True, max_length=50, null=True, verbose_name='Equivalente LexML', choices=[('constituicao', 'constituicao'), ('ementa.constitucional', 'ementa.constitucional'), ('lei.complementar', 'lei.complementar'), ('lei.delegada', 'lei.delegada'), ('lei', 'lei'), ('decreto.lei', 'decreto.lei'), ('medida.provisoria', 'medida.provisoria'), ('decreto', 'decreto'), ('lei.organica', 'lei.organica'), ('emenda.lei.organica', 'emenda.lei.organica'), ('decreto.legislativo', 'decreto.legislativo'), ('resolucao', 'resolucao'), ('regimento.interno', 'regimento.interno')])), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('equivalente_lexml', models.CharField(blank=True, choices=[('constituicao', 'constituicao'), ('ementa.constitucional', 'ementa.constitucional'), ('lei.complementar', 'lei.complementar'), ('lei.delegada', 'lei.delegada'), ('lei', 'lei'), ('decreto.lei', 'decreto.lei'), ('medida.provisoria', 'medida.provisoria'), ('decreto', 'decreto'), ('lei.organica', 'lei.organica'), ('emenda.lei.organica', 'emenda.lei.organica'), ('decreto.legislativo', 'decreto.legislativo'), ('resolucao', 'resolucao'), ('regimento.interno', 'regimento.interno')], max_length=50, verbose_name='Equivalente LexML')), ('sigla', models.CharField(max_length=3, verbose_name='Sigla')), ('descricao', models.CharField(max_length=50, verbose_name='Descrição')), ], options={ - 'verbose_name_plural': 'Tipos de Norma Jurídica', + 'ordering': ['descricao'], 'verbose_name': 'Tipo de Norma Jurídica', + 'verbose_name_plural': 'Tipos de Norma Jurídica', }, ), migrations.CreateModel( - name='VinculoNormaJuridica', + name='TipoVinculoNormaJuridica', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('tipo_vinculo', models.CharField(blank=True, max_length=1, null=True, choices=[('A', 'Altera a norma'), ('R', 'Revoga a norma'), ('P', 'Revoga parcialmente a norma'), ('T', 'Revoga por consolidação a norma'), ('C', 'Norma correlata'), ('I', 'Suspende a execução da norma'), ('G', 'Regulamenta a norma')])), - ('norma_referente', models.ForeignKey(to='norma.NormaJuridica', related_name='+')), - ('norma_referida', models.ForeignKey(to='norma.NormaJuridica', related_name='+')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sigla', models.CharField(blank=True, max_length=1, verbose_name='Sigla')), + ('descricao_ativa', models.CharField(blank=True, max_length=50, verbose_name='Descrição Ativa')), + ('descricao_passiva', models.CharField(blank=True, max_length=50, verbose_name='Descrição Passiva')), ], options={ - 'verbose_name_plural': 'Vínculos entre Normas Jurídicas', - 'verbose_name': 'Vínculo entre Normas Jurídicas', + 'verbose_name': 'Tipo de Vínculo entre Normas Jurídicas', + 'verbose_name_plural': 'Tipos de Vínculos entre Normas Jurídicas', }, ), + migrations.AddField( + model_name='normarelacionada', + name='tipo_vinculo', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='norma.TipoVinculoNormaJuridica', verbose_name='Tipo de Vínculo'), + ), migrations.AddField( model_name='normajuridica', name='tipo', - field=models.ForeignKey(to='norma.TipoNormaJuridica', verbose_name='Tipo'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='norma.TipoNormaJuridica', verbose_name='Tipo da Norma Juridica'), ), migrations.AddField( model_name='legislacaocitada', name='norma', - field=models.ForeignKey(to='norma.NormaJuridica'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='norma.NormaJuridica'), ), ] diff --git a/sapl/norma/migrations/0002_auto_20150729_1717.py b/sapl/norma/migrations/0002_auto_20150729_1717.py deleted file mode 100644 index d2a9cba0f..000000000 --- a/sapl/norma/migrations/0002_auto_20150729_1717.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='normajuridica', - name='ano', - field=models.PositiveSmallIntegerField(verbose_name='Ano'), - ), - migrations.AlterField( - model_name='normajuridica', - name='numero', - field=models.PositiveIntegerField(verbose_name='Número'), - ), - migrations.AlterField( - model_name='normajuridica', - name='pagina_fim_publicacao', - field=models.PositiveIntegerField(blank=True, verbose_name='Pg. Fim', null=True), - ), - migrations.AlterField( - model_name='normajuridica', - name='pagina_inicio_publicacao', - field=models.PositiveIntegerField(blank=True, verbose_name='Pg. Início', null=True), - ), - ] diff --git a/sapl/norma/migrations/0003_auto_20150906_0239.py b/sapl/norma/migrations/0003_auto_20150906_0239.py deleted file mode 100644 index dff90c71e..000000000 --- a/sapl/norma/migrations/0003_auto_20150906_0239.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0002_auto_20150729_1717'), - ] - - operations = [ - migrations.CreateModel( - name='AssuntoNormaRelationship', - fields=[ - ('id', models.AutoField(auto_created=True, verbose_name='ID', primary_key=True, serialize=False)), - ('assunto', models.ForeignKey(to='norma.AssuntoNorma')), - ], - ), - migrations.RemoveField( - model_name='normajuridica', - name='assunto', - ), - migrations.AddField( - model_name='assuntonormarelationship', - name='norma', - field=models.ForeignKey(to='norma.NormaJuridica'), - ), - migrations.AddField( - model_name='normajuridica', - name='assuntos', - field=models.ManyToManyField(to='norma.AssuntoNorma', through='norma.AssuntoNormaRelationship'), - ), - ] diff --git a/sapl/norma/migrations/0004_auto_20150907_0004.py b/sapl/norma/migrations/0004_auto_20150907_0004.py deleted file mode 100644 index 9a716cabc..000000000 --- a/sapl/norma/migrations/0004_auto_20150907_0004.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0003_auto_20150906_0239'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='assuntonormarelationship', - unique_together=set([('assunto', 'norma')]), - ), - ] diff --git a/sapl/norma/migrations/0005_auto_20150915_1141.py b/sapl/norma/migrations/0005_auto_20150915_1141.py deleted file mode 100644 index 6d9798f23..000000000 --- a/sapl/norma/migrations/0005_auto_20150915_1141.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0004_auto_20150907_0004'), - ] - - operations = [ - migrations.AlterModelOptions( - name='normajuridica', - options={'verbose_name_plural': 'Normas Jurídicas', 'verbose_name': 'Norma Jurídica', 'ordering': ['-data']}, - ), - ] diff --git a/sapl/norma/migrations/0006_auto_20151025_1427.py b/sapl/norma/migrations/0006_auto_20151025_1427.py deleted file mode 100644 index 1a5f7c607..000000000 --- a/sapl/norma/migrations/0006_auto_20151025_1427.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0005_auto_20150915_1141'), - ] - - operations = [ - migrations.AlterModelOptions( - name='normajuridica', - options={'ordering': ['-data', '-numero'], 'verbose_name_plural': 'Normas Jurídicas', 'verbose_name': 'Norma Jurídica'}, - ), - ] diff --git a/sapl/norma/migrations/0007_auto_20151130_1632.py b/sapl/norma/migrations/0007_auto_20151130_1632.py deleted file mode 100644 index 745eda239..000000000 --- a/sapl/norma/migrations/0007_auto_20151130_1632.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0006_auto_20151025_1427'), - ] - - operations = [ - migrations.AlterField( - model_name='normajuridica', - name='complemento', - field=models.NullBooleanField(verbose_name='Complementar ?', choices=[(True, 'Sim'), (False, 'Não')]), - ), - ] diff --git a/sapl/norma/migrations/0008_normajuridica_texto_integral.py b/sapl/norma/migrations/0008_normajuridica_texto_integral.py deleted file mode 100644 index 7415852b5..000000000 --- a/sapl/norma/migrations/0008_normajuridica_texto_integral.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import sapl.norma.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0007_auto_20151130_1632'), - ] - - operations = [ - migrations.AddField( - model_name='normajuridica', - name='texto_integral', - field=models.FileField( - null=True, verbose_name='Texto Integral', upload_to=sapl.norma.models.texto_upload_path, blank=True), - ), - ] diff --git a/sapl/norma/migrations/0009_auto_20160106_1511.py b/sapl/norma/migrations/0009_auto_20160106_1511.py deleted file mode 100644 index f7c0766cb..000000000 --- a/sapl/norma/migrations/0009_auto_20160106_1511.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0008_normajuridica_texto_integral'), - ] - - operations = [ - migrations.AlterField( - model_name='normajuridica', - name='tipo', - field=models.ForeignKey(verbose_name='Tipo da Norma Juridica', to='norma.TipoNormaJuridica'), - ), - ] diff --git a/sapl/norma/migrations/0010_auto_20160216_1015.py b/sapl/norma/migrations/0010_auto_20160216_1015.py deleted file mode 100644 index 6aaa8e5d6..000000000 --- a/sapl/norma/migrations/0010_auto_20160216_1015.py +++ /dev/null @@ -1,104 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0009_auto_20160106_1511'), - ] - - operations = [ - migrations.AlterField( - model_name='assuntonorma', - name='descricao', - field=models.CharField(verbose_name='Descrição', max_length=250, blank=True), - ), - migrations.AlterField( - model_name='legislacaocitada', - name='alinea', - field=models.CharField(verbose_name='Alínea', max_length=3, blank=True), - ), - migrations.AlterField( - model_name='legislacaocitada', - name='artigo', - field=models.CharField(verbose_name='Artigo', max_length=4, blank=True), - ), - migrations.AlterField( - model_name='legislacaocitada', - name='capitulo', - field=models.CharField(verbose_name='Capítulo', max_length=7, blank=True), - ), - migrations.AlterField( - model_name='legislacaocitada', - name='disposicoes', - field=models.CharField(verbose_name='Disposição', max_length=15, blank=True), - ), - migrations.AlterField( - model_name='legislacaocitada', - name='inciso', - field=models.CharField(verbose_name='Inciso', max_length=10, blank=True), - ), - migrations.AlterField( - model_name='legislacaocitada', - name='item', - field=models.CharField(verbose_name='Item', max_length=3, blank=True), - ), - migrations.AlterField( - model_name='legislacaocitada', - name='livro', - field=models.CharField(verbose_name='Livro', max_length=7, blank=True), - ), - migrations.AlterField( - model_name='legislacaocitada', - name='paragrafo', - field=models.CharField(verbose_name='Parágrafo', max_length=3, blank=True), - ), - migrations.AlterField( - model_name='legislacaocitada', - name='parte', - field=models.CharField(verbose_name='Parte', max_length=8, blank=True), - ), - migrations.AlterField( - model_name='legislacaocitada', - name='secao', - field=models.CharField(verbose_name='Seção', max_length=7, blank=True), - ), - migrations.AlterField( - model_name='legislacaocitada', - name='subsecao', - field=models.CharField(verbose_name='Subseção', max_length=7, blank=True), - ), - migrations.AlterField( - model_name='legislacaocitada', - name='titulo', - field=models.CharField(verbose_name='Título', max_length=7, blank=True), - ), - migrations.AlterField( - model_name='normajuridica', - name='indexacao', - field=models.TextField(verbose_name='Indexação', blank=True), - ), - migrations.AlterField( - model_name='normajuridica', - name='observacao', - field=models.TextField(verbose_name='Observação', blank=True), - ), - migrations.AlterField( - model_name='normajuridica', - name='veiculo_publicacao', - field=models.CharField(verbose_name='Veículo Publicação', max_length=30, blank=True), - ), - migrations.AlterField( - model_name='tiponormajuridica', - name='equivalente_lexml', - field=models.CharField(blank=True, verbose_name='Equivalente LexML', choices=[('constituicao', 'constituicao'), ('ementa.constitucional', 'ementa.constitucional'), ('lei.complementar', 'lei.complementar'), ('lei.delegada', 'lei.delegada'), ('lei', 'lei'), ('decreto.lei', 'decreto.lei'), ('medida.provisoria', 'medida.provisoria'), ('decreto', 'decreto'), ('lei.organica', 'lei.organica'), ('emenda.lei.organica', 'emenda.lei.organica'), ('decreto.legislativo', 'decreto.legislativo'), ('resolucao', 'resolucao'), ('regimento.interno', 'regimento.interno')], max_length=50), - ), - migrations.AlterField( - model_name='vinculonormajuridica', - name='tipo_vinculo', - field=models.CharField(blank=True, choices=[('A', 'Altera a norma'), ('R', 'Revoga a norma'), ('P', 'Revoga parcialmente a norma'), ('T', 'Revoga por consolidação a norma'), ('C', 'Norma correlata'), ('I', 'Suspende a execução da norma'), ('G', 'Regulamenta a norma')], max_length=1), - ), - ] diff --git a/sapl/norma/migrations/0011_auto_20160307_1153.py b/sapl/norma/migrations/0011_auto_20160307_1153.py deleted file mode 100644 index 19631773d..000000000 --- a/sapl/norma/migrations/0011_auto_20160307_1153.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-07 14:53 -from __future__ import unicode_literals - -import datetime -from django.db import migrations, models -from django.utils.timezone import utc - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0010_auto_20160216_1015'), - ] - - operations = [ - migrations.AlterField( - model_name='normajuridica', - name='data', - field=models.DateField(default=datetime.datetime(2016, 3, 7, 14, 53, 52, 206255, tzinfo=utc), verbose_name='Data'), - preserve_default=False, - ), - ] diff --git a/sapl/norma/migrations/0012_auto_20160309_1407.py b/sapl/norma/migrations/0012_auto_20160309_1407.py deleted file mode 100644 index 7075fa270..000000000 --- a/sapl/norma/migrations/0012_auto_20160309_1407.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-09 17:07 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0011_auto_20160307_1153'), - ] - - operations = [ - migrations.AlterField( - model_name='normajuridica', - name='ano', - field=models.PositiveSmallIntegerField(choices=[(2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - ] diff --git a/sapl/norma/migrations/0013_auto_20160503_0926.py b/sapl/norma/migrations/0013_auto_20160503_0926.py deleted file mode 100644 index 8c15dae96..000000000 --- a/sapl/norma/migrations/0013_auto_20160503_0926.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-03 12:26 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0012_auto_20160309_1407'), - ] - - operations = [ - migrations.AlterField( - model_name='vinculonormajuridica', - name='norma_referente', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='norma_referente_set', to='norma.NormaJuridica'), - ), - migrations.AlterField( - model_name='vinculonormajuridica', - name='norma_referida', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='norma_referida_set', to='norma.NormaJuridica'), - ), - ] diff --git a/sapl/norma/migrations/0013_auto_20160510_1404.py b/sapl/norma/migrations/0013_auto_20160510_1404.py deleted file mode 100644 index 97d780cb5..000000000 --- a/sapl/norma/migrations/0013_auto_20160510_1404.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-10 17:04 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0012_auto_20160309_1407'), - ] - - operations = [ - migrations.AlterField( - model_name='vinculonormajuridica', - name='tipo_vinculo', - field=models.CharField(blank=True, choices=[('A', 'Altera a norma'), ('R', 'Revoga integralmente a norma'), ('P', 'Revoga parcialmente a norma'), ('T', 'Revoga integralmente por consolidação'), ('C', 'Norma correlata'), ('S', 'Ressalva a norma'), ('E', 'Reedita a norma'), ('I', 'Reedita a norma com alteração'), ('G', 'Regulamenta a norma'), ('K', 'Suspende parcialmente a norma'), ('L', 'Suspende integralmente a norma'), ('N', 'Julgada integralmente inconstitucional'), ('O', 'Julgada parcialmente inconstitucional')], max_length=1), - ), - ] diff --git a/sapl/norma/migrations/0014_merge.py b/sapl/norma/migrations/0014_merge.py deleted file mode 100644 index be6ffd022..000000000 --- a/sapl/norma/migrations/0014_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-06-08 16:14 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0013_auto_20160510_1404'), - ('norma', '0013_auto_20160503_0926'), - ] - - operations = [ - ] diff --git a/sapl/norma/migrations/0015_auto_20160929_1635.py b/sapl/norma/migrations/0015_auto_20160929_1635.py deleted file mode 100644 index 5ea7f8a1b..000000000 --- a/sapl/norma/migrations/0015_auto_20160929_1635.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-29 19:35 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0014_merge'), - ] - - operations = [ - migrations.AlterModelOptions( - name='legislacaocitada', - options={'verbose_name': 'Legislação', 'verbose_name_plural': 'Legislações'}, - ), - ] diff --git a/sapl/norma/migrations/0016_auto_20161027_1419.py b/sapl/norma/migrations/0016_auto_20161027_1419.py deleted file mode 100644 index b090e538a..000000000 --- a/sapl/norma/migrations/0016_auto_20161027_1419.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-27 14:19 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0015_auto_20160929_1635'), - ] - - operations = [ - migrations.AlterModelOptions( - name='assuntonormarelationship', - options={'verbose_name': 'Assunto', 'verbose_name_plural': 'Assuntos'}, - ), - migrations.AlterUniqueTogether( - name='assuntonormarelationship', - unique_together=set([]), - ), - ] diff --git a/sapl/norma/migrations/0017_auto_20161027_1432.py b/sapl/norma/migrations/0017_auto_20161027_1432.py deleted file mode 100644 index 93208eb69..000000000 --- a/sapl/norma/migrations/0017_auto_20161027_1432.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-27 14:32 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0016_auto_20161027_1419'), - ] - - operations = [ - migrations.AlterField( - model_name='normajuridica', - name='assuntos', - field=models.ManyToManyField(through='norma.AssuntoNormaRelationship', to='norma.AssuntoNorma', verbose_name='Assuntos'), - ), - ] diff --git a/sapl/norma/migrations/0018_auto_20161027_1434.py b/sapl/norma/migrations/0018_auto_20161027_1434.py deleted file mode 100644 index c70998631..000000000 --- a/sapl/norma/migrations/0018_auto_20161027_1434.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-27 14:34 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0017_auto_20161027_1432'), - ] - - operations = [ - migrations.AlterField( - model_name='assuntonormarelationship', - name='assunto', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='norma.AssuntoNorma', verbose_name='Assunto'), - ), - migrations.AlterField( - model_name='assuntonormarelationship', - name='norma', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='norma.NormaJuridica', verbose_name='Norma'), - ), - ] diff --git a/sapl/norma/migrations/0019_auto_20161028_0232.py b/sapl/norma/migrations/0019_auto_20161028_0232.py deleted file mode 100644 index 075607017..000000000 --- a/sapl/norma/migrations/0019_auto_20161028_0232.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-28 02:32 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0018_auto_20161027_1434'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='assuntonormarelationship', - unique_together=set([('assunto', 'norma')]), - ), - ] diff --git a/sapl/norma/migrations/0020_auto_20161028_1335.py b/sapl/norma/migrations/0020_auto_20161028_1335.py deleted file mode 100644 index 4391c8340..000000000 --- a/sapl/norma/migrations/0020_auto_20161028_1335.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-28 13:35 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0019_auto_20161028_0232'), - ] - - operations = [ - migrations.AlterUniqueTogether( - name='assuntonormarelationship', - unique_together=set([]), - ), - migrations.RemoveField( - model_name='assuntonormarelationship', - name='assunto', - ), - migrations.RemoveField( - model_name='assuntonormarelationship', - name='norma', - ), - migrations.RemoveField( - model_name='normajuridica', - name='assuntos', - ), - migrations.AddField( - model_name='normajuridica', - name='assuntos', - field=models.TextField(blank=True, null=True), - ), - migrations.DeleteModel( - name='AssuntoNormaRelationship', - ), - ] diff --git a/sapl/norma/migrations/0021_auto_20161028_1335.py b/sapl/norma/migrations/0021_auto_20161028_1335.py deleted file mode 100644 index bbadc60d2..000000000 --- a/sapl/norma/migrations/0021_auto_20161028_1335.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-28 13:35 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0020_auto_20161028_1335'), - ] - - operations = [ - migrations.RemoveField( - model_name='normajuridica', - name='assuntos', - ), - migrations.AddField( - model_name='normajuridica', - name='assuntos', - field=models.ManyToManyField(blank=True, to='norma.AssuntoNorma', verbose_name='Assuntos'), - ), - ] diff --git a/sapl/norma/migrations/0022_auto_20161110_0910.py b/sapl/norma/migrations/0022_auto_20161110_0910.py deleted file mode 100644 index c440abb8a..000000000 --- a/sapl/norma/migrations/0022_auto_20161110_0910.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-10 09:10 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0021_auto_20161028_1335'), - ] - - operations = [ - migrations.AlterField( - model_name='normajuridica', - name='ano', - field=models.PositiveSmallIntegerField(choices=[('', 'Selecione'), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - ] diff --git a/sapl/norma/migrations/0023_auto_20161123_1359.py b/sapl/norma/migrations/0023_auto_20161123_1359.py deleted file mode 100644 index 450071cc8..000000000 --- a/sapl/norma/migrations/0023_auto_20161123_1359.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-23 13:59 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0022_auto_20161110_0910'), - ] - - operations = [ - migrations.AlterModelOptions( - name='vinculonormajuridica', - options={'verbose_name': 'Tipo de Vínculo entre Normas Jurídicas', 'verbose_name_plural': 'Tipos de Vínculos entre Normas Jurídicas'}, - ), - migrations.RemoveField( - model_name='vinculonormajuridica', - name='norma_referente', - ), - migrations.RemoveField( - model_name='vinculonormajuridica', - name='norma_referida', - ), - migrations.RemoveField( - model_name='vinculonormajuridica', - name='tipo_vinculo', - ), - migrations.AddField( - model_name='vinculonormajuridica', - name='descricao', - field=models.CharField(blank=True, max_length=20, verbose_name='Descrição'), - ), - migrations.AddField( - model_name='vinculonormajuridica', - name='sigla', - field=models.CharField(blank=True, max_length=1, verbose_name='Nome'), - ), - ] diff --git a/sapl/norma/migrations/0024_auto_20161123_1430.py b/sapl/norma/migrations/0024_auto_20161123_1430.py deleted file mode 100644 index e531c2a38..000000000 --- a/sapl/norma/migrations/0024_auto_20161123_1430.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-23 14:30 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0023_auto_20161123_1359'), - ] - - operations = [ - migrations.AlterField( - model_name='vinculonormajuridica', - name='descricao', - field=models.CharField(blank=True, max_length=50, verbose_name='Descrição'), - ), - migrations.AlterField( - model_name='vinculonormajuridica', - name='sigla', - field=models.CharField(blank=True, max_length=1, verbose_name='Sigla'), - ), - ] diff --git a/sapl/norma/migrations/0025_normarelacionada.py b/sapl/norma/migrations/0025_normarelacionada.py deleted file mode 100644 index 1cfafedb2..000000000 --- a/sapl/norma/migrations/0025_normarelacionada.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-23 14:44 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0024_auto_20161123_1430'), - ] - - operations = [ - migrations.CreateModel( - name='NormaRelacionada', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('norma_principal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='norma_principal', to='norma.NormaJuridica')), - ('norma_relacionada', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='norma_relacionada', to='norma.NormaJuridica')), - ('tipo_vinculo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='norma.VinculoNormaJuridica')), - ], - options={ - 'verbose_name': 'Norma Relacionada', - 'verbose_name_plural': 'Normas Relacionadas', - }, - ), - ] diff --git a/sapl/norma/migrations/0026_auto_20161123_1450.py b/sapl/norma/migrations/0026_auto_20161123_1450.py deleted file mode 100644 index 6fda19247..000000000 --- a/sapl/norma/migrations/0026_auto_20161123_1450.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-23 14:50 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0025_normarelacionada'), - ] - - operations = [ - migrations.AlterField( - model_name='normarelacionada', - name='tipo_vinculo', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='norma.VinculoNormaJuridica', verbose_name='Tipo de Vínculo'), - ), - ] diff --git a/sapl/norma/migrations/0027_auto_20161123_1538.py b/sapl/norma/migrations/0027_auto_20161123_1538.py deleted file mode 100644 index f44348b0e..000000000 --- a/sapl/norma/migrations/0027_auto_20161123_1538.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-23 15:38 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0026_auto_20161123_1450'), - ] - - operations = [ - migrations.AlterField( - model_name='normarelacionada', - name='norma_principal', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='norma_principal', to='norma.NormaJuridica', verbose_name='Norma Principal'), - ), - migrations.AlterField( - model_name='normarelacionada', - name='norma_relacionada', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='norma_relacionada', to='norma.NormaJuridica', verbose_name='Norma Relacionada'), - ), - ] diff --git a/sapl/norma/migrations/0028_auto_20161202_1025.py b/sapl/norma/migrations/0028_auto_20161202_1025.py deleted file mode 100644 index 2bfebb011..000000000 --- a/sapl/norma/migrations/0028_auto_20161202_1025.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-12-02 10:25 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0027_auto_20161123_1538'), - ] - - operations = [ - migrations.AlterField( - model_name='normajuridica', - name='materia', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='materia.MateriaLegislativa', verbose_name='Matéria'), - ), - ] diff --git a/sapl/norma/migrations/0029_auto_20161215_1652.py b/sapl/norma/migrations/0029_auto_20161215_1652.py deleted file mode 100644 index 9ef00a353..000000000 --- a/sapl/norma/migrations/0029_auto_20161215_1652.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-12-15 16:52 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0028_auto_20161202_1025'), - ] - - operations = [ - migrations.AlterModelOptions( - name='tiponormajuridica', - options={'ordering': ['descricao'], 'verbose_name': 'Tipo de Norma Jurídica', 'verbose_name_plural': 'Tipos de Norma Jurídica'}, - ), - ] diff --git a/sapl/norma/migrations/0029_auto_20161216_1640.py b/sapl/norma/migrations/0029_auto_20161216_1640.py deleted file mode 100644 index cfb965cc9..000000000 --- a/sapl/norma/migrations/0029_auto_20161216_1640.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.12 on 2016-12-16 16:40 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0028_auto_20161202_1025'), - ] - - operations = [ - migrations.AlterModelOptions( - name='tiponormajuridica', - options={'ordering': ['descricao'], 'verbose_name': 'Tipo de Norma Jurídica', 'verbose_name_plural': 'Tipos de Norma Jurídica'}, - ), - ] diff --git a/sapl/norma/migrations/0030_auto_20170102_0951.py b/sapl/norma/migrations/0030_auto_20170102_0951.py deleted file mode 100644 index ac8d9c443..000000000 --- a/sapl/norma/migrations/0030_auto_20170102_0951.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-01-02 09:51 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0029_auto_20161216_1640'), - ] - - operations = [ - migrations.AlterField( - model_name='normajuridica', - name='ano', - field=models.PositiveSmallIntegerField(choices=[('', 'Selecione'), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - ] diff --git a/sapl/norma/migrations/0030_merge.py b/sapl/norma/migrations/0030_merge.py deleted file mode 100644 index beb05625c..000000000 --- a/sapl/norma/migrations/0030_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-12-19 13:06 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0029_auto_20161216_1640'), - ('norma', '0029_auto_20161215_1652'), - ] - - operations = [ - ] diff --git a/sapl/norma/migrations/0031_auto_20161219_1324.py b/sapl/norma/migrations/0031_auto_20161219_1324.py deleted file mode 100644 index 27d77c035..000000000 --- a/sapl/norma/migrations/0031_auto_20161219_1324.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-12-19 13:24 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0030_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='normajuridica', - name='numero', - field=models.CharField(max_length=8, verbose_name='Número'), - ), - ] diff --git a/sapl/norma/migrations/0032_merge.py b/sapl/norma/migrations/0032_merge.py deleted file mode 100644 index ec812bf6c..000000000 --- a/sapl/norma/migrations/0032_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.11 on 2017-01-10 15:32 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0031_auto_20161219_1324'), - ('norma', '0030_auto_20170102_0951'), - ] - - operations = [ - ] diff --git a/sapl/norma/migrations/0033_auto_20170123_1548.py b/sapl/norma/migrations/0033_auto_20170123_1548.py deleted file mode 100644 index 918c476c9..000000000 --- a/sapl/norma/migrations/0033_auto_20170123_1548.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-01-23 15:48 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0032_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='normajuridica', - name='ano', - field=models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - ] diff --git a/sapl/norma/migrations/0033_auto_20170203_1019.py b/sapl/norma/migrations/0033_auto_20170203_1019.py deleted file mode 100644 index 22157ad6f..000000000 --- a/sapl/norma/migrations/0033_auto_20170203_1019.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-02-03 10:19 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0032_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='normajuridica', - name='ano', - field=models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - ] diff --git a/sapl/norma/migrations/0034_auto_20170222_1435.py b/sapl/norma/migrations/0034_auto_20170222_1435.py deleted file mode 100644 index 1fbb85152..000000000 --- a/sapl/norma/migrations/0034_auto_20170222_1435.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-02-22 14:35 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0033_auto_20170203_1019'), - ] - - operations = [ - migrations.RemoveField( - model_name='vinculonormajuridica', - name='descricao', - ), - migrations.AddField( - model_name='vinculonormajuridica', - name='descricao_ativa', - field=models.CharField(blank=True, max_length=50, verbose_name='Descrição Ativa'), - ), - migrations.AddField( - model_name='vinculonormajuridica', - name='descricao_passiva', - field=models.CharField(blank=True, max_length=50, verbose_name='Descrição Passiva'), - ), - ] diff --git a/sapl/norma/migrations/0035_auto_20170222_1438.py b/sapl/norma/migrations/0035_auto_20170222_1438.py deleted file mode 100644 index e8b1c0ddc..000000000 --- a/sapl/norma/migrations/0035_auto_20170222_1438.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-02-22 14:38 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0034_auto_20170222_1435'), - ] - - operations = [ - migrations.RenameModel( - old_name='VinculoNormaJuridica', - new_name='TipoVinculoNormaJuridica', - ), - ] diff --git a/sapl/norma/migrations/0036_merge.py b/sapl/norma/migrations/0036_merge.py deleted file mode 100644 index 207c3b3c0..000000000 --- a/sapl/norma/migrations/0036_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-03-03 16:34 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0035_auto_20170222_1438'), - ('norma', '0033_auto_20170123_1548'), - ] - - operations = [ - ] diff --git a/sapl/norma/migrations/0037_auto_20170325_1052.py b/sapl/norma/migrations/0037_auto_20170325_1052.py deleted file mode 100644 index 183da7713..000000000 --- a/sapl/norma/migrations/0037_auto_20170325_1052.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.12 on 2017-03-25 10:52 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('norma', '0036_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='legislacaocitada', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='legislacaocitada', - name='norma', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='norma.NormaJuridica'), - ), - migrations.AlterField( - model_name='normajuridica', - name='materia', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa', verbose_name='Matéria'), - ), - migrations.AlterField( - model_name='normajuridica', - name='tipo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='norma.TipoNormaJuridica', verbose_name='Tipo da Norma Juridica'), - ), - migrations.AlterField( - model_name='normarelacionada', - name='norma_principal', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='norma_principal', to='norma.NormaJuridica', verbose_name='Norma Principal'), - ), - migrations.AlterField( - model_name='normarelacionada', - name='norma_relacionada', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='norma_relacionada', to='norma.NormaJuridica', verbose_name='Norma Relacionada'), - ), - migrations.AlterField( - model_name='normarelacionada', - name='tipo_vinculo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='norma.TipoVinculoNormaJuridica', verbose_name='Tipo de Vínculo'), - ), - ] diff --git a/sapl/painel/migrations/0001_initial.py b/sapl/painel/migrations/0001_initial.py index 3b2dfa3c1..5bf809cf7 100644 --- a/sapl/painel/migrations/0001_initial.py +++ b/sapl/painel/migrations/0001_initial.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 11:14 from __future__ import unicode_literals from django.db import migrations, models @@ -6,6 +7,8 @@ from django.db import migrations, models class Migration(migrations.Migration): + initial = True + dependencies = [ ] @@ -13,19 +16,19 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Cronometro', fields=[ - ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)), - ('status', models.CharField(max_length=1, verbose_name='Status do cronômetro', choices=[('I', 'Start'), ('R', 'Reset'), ('S', 'Stop')], default='S')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('status', models.CharField(choices=[('I', 'Start'), ('R', 'Reset'), ('S', 'Stop')], default='S', max_length=1, verbose_name='Status do cronômetro')), ('data_cronometro', models.DateField(verbose_name='Data do cronômetro')), - ('tipo', models.CharField(max_length=1, verbose_name='Tipo Cronômetro', choices=[('A', 'Aparte'), ('D', 'Discurso'), ('O', 'Ordem do dia')])), + ('tipo', models.CharField(choices=[('A', 'Aparte'), ('D', 'Discurso'), ('O', 'Ordem do dia')], max_length=1, verbose_name='Tipo Cronômetro')), ], ), migrations.CreateModel( name='Painel', fields=[ - ('id', models.AutoField(serialize=False, verbose_name='ID', primary_key=True, auto_created=True)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('aberto', models.BooleanField(default=False, verbose_name='Abrir painel')), ('data_painel', models.DateField(verbose_name='Data painel')), - ('mostrar', models.CharField(max_length=1, choices=[('C', 'Completo'), ('P', 'Parlamentares'), ('V', 'Votação'), ('M', 'Mensagem')], default='C')), + ('mostrar', models.CharField(choices=[('C', 'Completo'), ('P', 'Parlamentares'), ('V', 'Votação'), ('M', 'Mensagem')], default='C', max_length=1)), ], ), ] diff --git a/sapl/parlamentares/migrations/0001_initial.py b/sapl/parlamentares/migrations/0001_initial.py index 152a92f82..4d9d88bbe 100644 --- a/sapl/parlamentares/migrations/0001_initial.py +++ b/sapl/parlamentares/migrations/0001_initial.py @@ -1,297 +1,343 @@ # -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 11:14 from __future__ import unicode_literals +from django.conf import settings from django.db import migrations, models +import django.db.models.deletion +import sapl.parlamentares.models +import sapl.utils class Migration(migrations.Migration): + initial = True + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='CargoMesa', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('descricao', models.CharField(max_length=50, verbose_name='Cargo na Mesa')), - ('unico', models.BooleanField(verbose_name='Cargo Único', choices=[(True, 'Sim'), (False, 'Não')])), + ('unico', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Cargo Único')), ], options={ - 'verbose_name_plural': 'Cargos na Mesa', 'verbose_name': 'Cargo na Mesa', + 'verbose_name_plural': 'Cargos na Mesa', }, ), migrations.CreateModel( name='Coligacao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nome', models.CharField(max_length=50, verbose_name='Nome')), - ('numero_votos', models.IntegerField(blank=True, null=True, verbose_name='Nº Votos Recebidos')), + ('numero_votos', models.PositiveIntegerField(blank=True, null=True, verbose_name='Nº Votos Recebidos')), ], options={ - 'verbose_name_plural': 'Coligações', 'verbose_name': 'Coligação', + 'verbose_name_plural': 'Coligações', }, ), migrations.CreateModel( name='ComposicaoColigacao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('coligacao', models.ForeignKey(to='parlamentares.Coligacao')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('coligacao', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Coligacao')), ], options={ - 'verbose_name_plural': 'Composição Coligações', 'verbose_name': 'Composição Coligação', + 'verbose_name_plural': 'Composição Coligações', }, ), migrations.CreateModel( name='ComposicaoMesa', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('cargo', models.ForeignKey(to='parlamentares.CargoMesa')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('cargo', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.CargoMesa')), ], options={ - 'verbose_name_plural': 'Ocupações de cargo na Mesa', 'verbose_name': 'Ocupação de cargo na Mesa', + 'verbose_name_plural': 'Ocupações de cargo na Mesa', }, ), migrations.CreateModel( name='Dependente', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nome', models.CharField(max_length=50, verbose_name='Nome')), ('sexo', models.CharField(choices=[('F', 'Feminino'), ('M', 'Masculino')], max_length=1, verbose_name='Sexo')), ('data_nascimento', models.DateField(blank=True, null=True, verbose_name='Data Nascimento')), - ('cpf', models.CharField(blank=True, max_length=14, null=True, verbose_name='CPF')), - ('rg', models.CharField(blank=True, max_length=15, null=True, verbose_name='RG')), - ('titulo_eleitor', models.CharField(blank=True, max_length=15, null=True, verbose_name='Nº Título Eleitor')), + ('cpf', models.CharField(blank=True, max_length=14, verbose_name='CPF')), + ('rg', models.CharField(blank=True, max_length=15, verbose_name='RG')), + ('titulo_eleitor', models.CharField(blank=True, max_length=15, verbose_name='Nº Título Eleitor')), ], options={ - 'verbose_name_plural': 'Dependentes', 'verbose_name': 'Dependente', + 'verbose_name_plural': 'Dependentes', }, ), migrations.CreateModel( name='Filiacao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('data', models.DateField(verbose_name='Data Filiação')), ('data_desfiliacao', models.DateField(blank=True, null=True, verbose_name='Data Desfiliação')), ], options={ - 'verbose_name_plural': 'Filiações', + 'ordering': ('parlamentar', '-data', '-data_desfiliacao'), 'verbose_name': 'Filiação', + 'verbose_name_plural': 'Filiações', + }, + ), + migrations.CreateModel( + name='Frente', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('nome', models.CharField(max_length=80, verbose_name='Nome da Frente')), + ('data_criacao', models.DateField(verbose_name='Data Criação')), + ('data_extincao', models.DateField(blank=True, null=True, verbose_name='Data Dissolução')), + ('descricao', models.TextField(blank=True, verbose_name='Descrição')), + ], + options={ + 'verbose_name': 'Frente', + 'verbose_name_plural': 'Frentes', }, ), migrations.CreateModel( name='Legislatura', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('numero', models.PositiveIntegerField(verbose_name='Número')), ('data_inicio', models.DateField(verbose_name='Data Início')), ('data_fim', models.DateField(verbose_name='Data Fim')), ('data_eleicao', models.DateField(verbose_name='Data Eleição')), ], options={ - 'verbose_name_plural': 'Legislaturas', + 'ordering': ['-data_inicio'], 'verbose_name': 'Legislatura', + 'verbose_name_plural': 'Legislaturas', }, ), migrations.CreateModel( name='Mandato', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('tipo_causa_fim_mandato', models.IntegerField(blank=True, null=True)), - ('data_fim_mandato', models.DateField(blank=True, null=True, verbose_name='Fim do Mandato')), - ('votos_recebidos', models.IntegerField(blank=True, null=True, verbose_name='Votos Recebidos')), - ('data_expedicao_diploma', models.DateField(blank=True, null=True, verbose_name='Expedição do Diploma')), - ('observacao', models.TextField(blank=True, null=True, verbose_name='Observação')), - ('coligacao', models.ForeignKey(blank=True, null=True, to='parlamentares.Coligacao', verbose_name='Coligação')), - ('legislatura', models.ForeignKey(to='parlamentares.Legislatura', verbose_name='Legislatura')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('tipo_causa_fim_mandato', models.PositiveIntegerField(blank=True, null=True)), + ('data_fim_mandato', models.DateField(verbose_name='Fim do Mandato')), + ('votos_recebidos', models.PositiveIntegerField(blank=True, null=True, verbose_name='Votos Recebidos')), + ('data_expedicao_diploma', models.DateField(verbose_name='Expedição do Diploma')), + ('titular', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], db_index=True, default=True, verbose_name='Vereador Titular')), + ('observacao', models.TextField(blank=True, verbose_name='Observação')), + ('coligacao', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Coligacao', verbose_name='Coligação')), + ('legislatura', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura')), ], options={ - 'verbose_name_plural': 'Mandatos', 'verbose_name': 'Mandato', + 'verbose_name_plural': 'Mandatos', }, ), migrations.CreateModel( name='Municipio', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('nome', models.CharField(blank=True, max_length=50, null=True)), - ('uf', models.CharField(blank=True, max_length=2, null=True, choices=[('AC', 'Acre'), ('AL', 'Alagoas'), ('AP', 'Amapá'), ('AM', 'Amazonas'), ('BA', 'Bahia'), ('CE', 'Ceará'), ('DF', 'Distrito Federal'), ('ES', 'Espírito Santo'), ('GO', 'Goiás'), ('MA', 'Maranhão'), ('MT', 'Mato Grosso'), ('MS', 'Mato Grosso do Sul'), ('MG', 'Minas Gerais'), ('PR', 'Paraná'), ('PB', 'Paraíba'), ('PA', 'Pará'), ('PE', 'Pernambuco'), ('PI', 'Piauí'), ('RJ', 'Rio de Janeiro'), ('RN', 'Rio Grande do Norte'), ('RS', 'Rio Grande do Sul'), ('RO', 'Rondônia'), ('RR', 'Roraima'), ('SC', 'Santa Catarina'), ('SE', 'Sergipe'), ('SP', 'São Paulo'), ('TO', 'Tocantins'), ('EX', 'Exterior')])), - ('regiao', models.CharField(blank=True, max_length=2, null=True, choices=[('CO', 'Centro-Oeste'), ('NE', 'Nordeste'), ('NO', 'Norte'), ('SE', 'Sudeste'), ('SL', 'Sul'), ('EX', 'Exterior')])), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('nome', models.CharField(blank=True, max_length=50)), + ('uf', models.CharField(blank=True, choices=[('AC', 'Acre'), ('AL', 'Alagoas'), ('AP', 'Amapá'), ('AM', 'Amazonas'), ('BA', 'Bahia'), ('CE', 'Ceará'), ('DF', 'Distrito Federal'), ('ES', 'Espírito Santo'), ('GO', 'Goiás'), ('MA', 'Maranhão'), ('MT', 'Mato Grosso'), ('MS', 'Mato Grosso do Sul'), ('MG', 'Minas Gerais'), ('PR', 'Paraná'), ('PB', 'Paraíba'), ('PA', 'Pará'), ('PE', 'Pernambuco'), ('PI', 'Piauí'), ('RJ', 'Rio de Janeiro'), ('RN', 'Rio Grande do Norte'), ('RS', 'Rio Grande do Sul'), ('RO', 'Rondônia'), ('RR', 'Roraima'), ('SC', 'Santa Catarina'), ('SE', 'Sergipe'), ('SP', 'São Paulo'), ('TO', 'Tocantins'), ('EX', 'Exterior')], max_length=2)), + ('regiao', models.CharField(blank=True, choices=[('CO', 'Centro-Oeste'), ('NE', 'Nordeste'), ('NO', 'Norte'), ('SE', 'Sudeste'), ('SL', 'Sul'), ('EX', 'Exterior')], max_length=2)), ], options={ - 'verbose_name_plural': 'Municípios', 'verbose_name': 'Município', + 'verbose_name_plural': 'Municípios', }, ), migrations.CreateModel( name='NivelInstrucao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('descricao', models.CharField(max_length=50, verbose_name='Nível de Instrução')), ], options={ - 'verbose_name_plural': 'Níveis Instrução', 'verbose_name': 'Nível Instrução', + 'verbose_name_plural': 'Níveis Instrução', }, ), migrations.CreateModel( name='Parlamentar', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nome_completo', models.CharField(max_length=50, verbose_name='Nome Completo')), - ('nome_parlamentar', models.CharField(blank=True, max_length=50, null=True, verbose_name='Nome Parlamentar')), + ('nome_parlamentar', models.CharField(max_length=50, verbose_name='Nome Parlamentar')), ('sexo', models.CharField(choices=[('F', 'Feminino'), ('M', 'Masculino')], max_length=1, verbose_name='Sexo')), ('data_nascimento', models.DateField(blank=True, null=True, verbose_name='Data Nascimento')), - ('cpf', models.CharField(blank=True, max_length=14, null=True, verbose_name='C.P.F')), - ('rg', models.CharField(blank=True, max_length=15, null=True, verbose_name='R.G.')), - ('titulo_eleitor', models.CharField(blank=True, max_length=15, null=True, verbose_name='Título de Eleitor')), - ('cod_casa', models.IntegerField()), - ('numero_gab_parlamentar', models.CharField(blank=True, max_length=10, null=True, verbose_name='Nº Gabinete')), - ('telefone', models.CharField(blank=True, max_length=50, null=True, verbose_name='Telefone')), - ('fax', models.CharField(blank=True, max_length=50, null=True, verbose_name='Fax')), - ('endereco_residencia', models.CharField(blank=True, max_length=100, null=True, verbose_name='Endereço Residencial')), - ('cep_residencia', models.CharField(blank=True, max_length=9, null=True, verbose_name='CEP')), - ('telefone_residencia', models.CharField(blank=True, max_length=50, null=True, verbose_name='Telefone Residencial')), - ('fax_residencia', models.CharField(blank=True, max_length=50, null=True, verbose_name='Fax Residencial')), - ('endereco_web', models.CharField(blank=True, max_length=100, null=True, verbose_name='HomePage')), - ('profissao', models.CharField(blank=True, max_length=50, null=True, verbose_name='Profissão')), - ('email', models.CharField(blank=True, max_length=100, null=True, verbose_name='Correio Eletrônico')), - ('locais_atuacao', models.CharField(blank=True, max_length=100, null=True, verbose_name='Locais de Atuação')), - ('ativo', models.BooleanField(verbose_name='Ativo na Casa?')), - ('biografia', models.TextField(blank=True, null=True, verbose_name='Biografia')), - ('unidade_deliberativa', models.BooleanField()), - ('municipio_residencia', models.ForeignKey(blank=True, null=True, to='parlamentares.Municipio', verbose_name='Município')), - ('nivel_instrucao', models.ForeignKey(blank=True, null=True, to='parlamentares.NivelInstrucao', verbose_name='Nível Instrução')), + ('cpf', models.CharField(blank=True, max_length=14, verbose_name='C.P.F')), + ('rg', models.CharField(blank=True, max_length=15, verbose_name='R.G.')), + ('titulo_eleitor', models.CharField(blank=True, max_length=15, verbose_name='Título de Eleitor')), + ('numero_gab_parlamentar', models.CharField(blank=True, max_length=10, verbose_name='Nº Gabinete')), + ('telefone', models.CharField(blank=True, max_length=50, verbose_name='Telefone')), + ('fax', models.CharField(blank=True, max_length=50, verbose_name='Fax')), + ('endereco_residencia', models.CharField(blank=True, max_length=100, verbose_name='Endereço Residencial')), + ('cep_residencia', models.CharField(blank=True, max_length=9, verbose_name='CEP')), + ('telefone_residencia', models.CharField(blank=True, max_length=50, verbose_name='Telefone Residencial')), + ('fax_residencia', models.CharField(blank=True, max_length=50, verbose_name='Fax Residencial')), + ('endereco_web', models.URLField(blank=True, max_length=100, verbose_name='HomePage')), + ('profissao', models.CharField(blank=True, max_length=50, verbose_name='Profissão')), + ('email', models.EmailField(blank=True, max_length=100, verbose_name='E-mail')), + ('locais_atuacao', models.CharField(blank=True, max_length=100, verbose_name='Locais de Atuação')), + ('ativo', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], db_index=True, default=False, verbose_name='Ativo na Casa?')), + ('biografia', models.TextField(blank=True, verbose_name='Biografia')), + ('fotografia', models.ImageField(blank=True, null=True, upload_to=sapl.parlamentares.models.foto_upload_path, validators=[sapl.utils.restringe_tipos_de_arquivo_img], verbose_name='Fotografia')), + ('municipio_residencia', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Municipio', verbose_name='Município')), + ('nivel_instrucao', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.NivelInstrucao', verbose_name='Nível Instrução')), ], options={ - 'verbose_name_plural': 'Parlamentares', + 'ordering': ['nome_parlamentar'], 'verbose_name': 'Parlamentar', + 'verbose_name_plural': 'Parlamentares', }, ), migrations.CreateModel( name='Partido', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('sigla', models.CharField(max_length=9, verbose_name='Sigla')), ('nome', models.CharField(max_length=50, verbose_name='Nome')), ('data_criacao', models.DateField(blank=True, null=True, verbose_name='Data Criação')), ('data_extincao', models.DateField(blank=True, null=True, verbose_name='Data Extinção')), + ('logo_partido', models.ImageField(blank=True, null=True, upload_to=sapl.parlamentares.models.logo_upload_path, validators=[sapl.utils.restringe_tipos_de_arquivo_img], verbose_name='Logo Partido')), ], options={ - 'verbose_name_plural': 'Partidos', 'verbose_name': 'Partido', + 'verbose_name_plural': 'Partidos', }, ), migrations.CreateModel( name='SessaoLegislativa', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('numero', models.IntegerField(verbose_name='Número')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('numero', models.PositiveIntegerField(verbose_name='Número')), ('tipo', models.CharField(choices=[('O', 'Ordinária'), ('E', 'Extraordinária')], max_length=1, verbose_name='Tipo')), ('data_inicio', models.DateField(verbose_name='Data Início')), ('data_fim', models.DateField(verbose_name='Data Fim')), ('data_inicio_intervalo', models.DateField(blank=True, null=True, verbose_name='Início Intervalo')), ('data_fim_intervalo', models.DateField(blank=True, null=True, verbose_name='Fim Intervalo')), - ('legislatura', models.ForeignKey(to='parlamentares.Legislatura')), + ('legislatura', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura')), ], options={ - 'verbose_name_plural': 'Sessões Legislativas', + 'ordering': ['-data_inicio', '-data_fim'], 'verbose_name': 'Sessão Legislativa', + 'verbose_name_plural': 'Sessões Legislativas', }, ), migrations.CreateModel( name='SituacaoMilitar', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('descricao', models.CharField(max_length=50, verbose_name='Situação Militar')), ], options={ - 'verbose_name_plural': 'Tipos Situações Militares', 'verbose_name': 'Tipo Situação Militar', + 'verbose_name_plural': 'Tipos Situações Militares', }, ), migrations.CreateModel( name='TipoAfastamento', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('descricao', models.CharField(max_length=50, verbose_name='Descrição')), - ('afastamento', models.BooleanField(verbose_name='Indicador')), - ('fim_mandato', models.BooleanField(verbose_name='Indicador')), - ('dispositivo', models.CharField(blank=True, max_length=50, null=True, verbose_name='Dispositivo')), + ('indicador', models.CharField(choices=[('A', 'Afastamento'), ('F', 'Fim de Mandato')], default='F', max_length=1, verbose_name='Indicador')), + ('dispositivo', models.CharField(blank=True, max_length=50, verbose_name='Dispositivo')), ], options={ - 'verbose_name_plural': 'Tipos de Afastamento', 'verbose_name': 'Tipo de Afastamento', + 'verbose_name_plural': 'Tipos de Afastamento', }, ), migrations.CreateModel( name='TipoDependente', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('descricao', models.CharField(max_length=50)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('descricao', models.CharField(max_length=50, verbose_name='Descrição')), ], options={ - 'verbose_name_plural': 'Tipos de Dependente', 'verbose_name': 'Tipo de Dependente', + 'verbose_name_plural': 'Tipos de Dependente', + }, + ), + migrations.CreateModel( + name='Votante', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('data', models.DateTimeField(auto_now_add=True, max_length=30, null=True, verbose_name='Data')), + ('parlamentar', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='parlamentar', to='parlamentares.Parlamentar', verbose_name='Parlamentar')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='user', to=settings.AUTH_USER_MODEL, verbose_name='User')), + ], + options={ + 'permissions': (('can_vote', 'Can Vote'),), + 'verbose_name': 'Usuário', + 'verbose_name_plural': 'Usuários', }, ), migrations.AddField( model_name='parlamentar', name='situacao_militar', - field=models.ForeignKey(blank=True, null=True, to='parlamentares.SituacaoMilitar', verbose_name='Situação Militar'), + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.SituacaoMilitar', verbose_name='Situação Militar'), ), migrations.AddField( model_name='mandato', name='parlamentar', - field=models.ForeignKey(to='parlamentares.Parlamentar'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), ), migrations.AddField( model_name='mandato', name='tipo_afastamento', - field=models.ForeignKey(blank=True, null=True, to='parlamentares.TipoAfastamento'), + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.TipoAfastamento'), + ), + migrations.AddField( + model_name='frente', + name='parlamentares', + field=models.ManyToManyField(blank=True, to='parlamentares.Parlamentar', verbose_name='Parlamentares'), ), migrations.AddField( model_name='filiacao', name='parlamentar', - field=models.ForeignKey(to='parlamentares.Parlamentar'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), ), migrations.AddField( model_name='filiacao', name='partido', - field=models.ForeignKey(to='parlamentares.Partido', verbose_name='Partido'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Partido', verbose_name='Partido'), ), migrations.AddField( model_name='dependente', name='parlamentar', - field=models.ForeignKey(to='parlamentares.Parlamentar'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), ), migrations.AddField( model_name='dependente', name='tipo', - field=models.ForeignKey(to='parlamentares.TipoDependente', verbose_name='Tipo'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.TipoDependente', verbose_name='Tipo'), ), migrations.AddField( model_name='composicaomesa', name='parlamentar', - field=models.ForeignKey(to='parlamentares.Parlamentar'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), ), migrations.AddField( model_name='composicaomesa', name='sessao_legislativa', - field=models.ForeignKey(to='parlamentares.SessaoLegislativa'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.SessaoLegislativa'), ), migrations.AddField( model_name='composicaocoligacao', name='partido', - field=models.ForeignKey(to='parlamentares.Partido'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Partido', verbose_name='Partidos da Coligação'), ), migrations.AddField( model_name='coligacao', name='legislatura', - field=models.ForeignKey(to='parlamentares.Legislatura', verbose_name='Legislatura'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura'), ), ] diff --git a/sapl/parlamentares/migrations/0002_auto_20150729_1310.py b/sapl/parlamentares/migrations/0002_auto_20150729_1310.py deleted file mode 100644 index 102db958e..000000000 --- a/sapl/parlamentares/migrations/0002_auto_20150729_1310.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='tipoafastamento', - name='afastamento', - field=models.BooleanField(verbose_name='Indicador', choices=[(True, 'Sim'), (False, 'Não')]), - ), - ] diff --git a/sapl/parlamentares/migrations/0003_auto_20150729_1717.py b/sapl/parlamentares/migrations/0003_auto_20150729_1717.py deleted file mode 100644 index 946e5bb4c..000000000 --- a/sapl/parlamentares/migrations/0003_auto_20150729_1717.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0002_auto_20150729_1310'), - ] - - operations = [ - migrations.AlterField( - model_name='coligacao', - name='numero_votos', - field=models.PositiveIntegerField(blank=True, verbose_name='Nº Votos Recebidos', null=True), - ), - migrations.AlterField( - model_name='mandato', - name='tipo_causa_fim_mandato', - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AlterField( - model_name='mandato', - name='votos_recebidos', - field=models.PositiveIntegerField(blank=True, verbose_name='Votos Recebidos', null=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='cod_casa', - field=models.PositiveIntegerField(), - ), - migrations.AlterField( - model_name='sessaolegislativa', - name='numero', - field=models.PositiveIntegerField(verbose_name='Número'), - ), - ] diff --git a/sapl/parlamentares/migrations/0004_auto_20150929_1425.py b/sapl/parlamentares/migrations/0004_auto_20150929_1425.py deleted file mode 100644 index ffb8ca672..000000000 --- a/sapl/parlamentares/migrations/0004_auto_20150929_1425.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0003_auto_20150729_1717'), - ] - - operations = [ - migrations.AlterModelOptions( - name='parlamentar', - options={'ordering': ['nome_parlamentar'], 'verbose_name': 'Parlamentar', 'verbose_name_plural': 'Parlamentares'}, - ), - ] diff --git a/sapl/parlamentares/migrations/0005_parlamentar_fotografia.py b/sapl/parlamentares/migrations/0005_parlamentar_fotografia.py deleted file mode 100644 index c7aff3aa3..000000000 --- a/sapl/parlamentares/migrations/0005_parlamentar_fotografia.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - -import sapl.parlamentares.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0004_auto_20150929_1425'), - ] - - operations = [ - migrations.AddField( - model_name='parlamentar', - name='fotografia', - field=models.FileField( - blank=True, null=True, verbose_name='Fotografia', upload_to=sapl.parlamentares.models.foto_upload_path), - ), - ] diff --git a/sapl/parlamentares/migrations/0006_auto_20151119_1318.py b/sapl/parlamentares/migrations/0006_auto_20151119_1318.py deleted file mode 100644 index 443dbcced..000000000 --- a/sapl/parlamentares/migrations/0006_auto_20151119_1318.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0005_parlamentar_fotografia'), - ] - - operations = [ - migrations.AlterField( - model_name='parlamentar', - name='unidade_deliberativa', - field=models.BooleanField(verbose_name='Unidade'), - ), - ] diff --git a/sapl/parlamentares/migrations/0007_auto_20151123_1258.py b/sapl/parlamentares/migrations/0007_auto_20151123_1258.py deleted file mode 100644 index e26a752ff..000000000 --- a/sapl/parlamentares/migrations/0007_auto_20151123_1258.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0006_auto_20151119_1318'), - ] - - operations = [ - migrations.AlterField( - model_name='parlamentar', - name='unidade_deliberativa', - field=models.BooleanField(), - ), - ] diff --git a/sapl/parlamentares/migrations/0008_auto_20151126_1332.py b/sapl/parlamentares/migrations/0008_auto_20151126_1332.py deleted file mode 100644 index 2bb2ed6c4..000000000 --- a/sapl/parlamentares/migrations/0008_auto_20151126_1332.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0007_auto_20151123_1258'), - ] - - operations = [ - migrations.AlterField( - model_name='parlamentar', - name='cod_casa', - field=models.PositiveIntegerField(blank=True, null=True, verbose_name='Cód. Casa'), - ), - migrations.AlterField( - model_name='parlamentar', - name='nome_parlamentar', - field=models.CharField(default=1, verbose_name='Nome Parlamentar', max_length=50), - preserve_default=False, - ), - ] diff --git a/sapl/parlamentares/migrations/0009_auto_20151126_1334.py b/sapl/parlamentares/migrations/0009_auto_20151126_1334.py deleted file mode 100644 index 839845351..000000000 --- a/sapl/parlamentares/migrations/0009_auto_20151126_1334.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0008_auto_20151126_1332'), - ] - - operations = [ - migrations.RemoveField( - model_name='parlamentar', - name='cod_casa', - ), - migrations.RemoveField( - model_name='parlamentar', - name='unidade_deliberativa', - ), - ] diff --git a/sapl/parlamentares/migrations/0010_auto_20160107_1850.py b/sapl/parlamentares/migrations/0010_auto_20160107_1850.py deleted file mode 100644 index bee171cd3..000000000 --- a/sapl/parlamentares/migrations/0010_auto_20160107_1850.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -import sapl.parlamentares.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0009_auto_20151126_1334'), - ] - - operations = [ - migrations.AlterField( - model_name='parlamentar', - name='fotografia', - field=models.ImageField(null=True, verbose_name='Fotografia', - blank=True, upload_to=sapl.parlamentares.models.foto_upload_path), - ), - ] diff --git a/sapl/parlamentares/migrations/0011_auto_20160216_1015.py b/sapl/parlamentares/migrations/0011_auto_20160216_1015.py deleted file mode 100644 index 4dacac89f..000000000 --- a/sapl/parlamentares/migrations/0011_auto_20160216_1015.py +++ /dev/null @@ -1,129 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0010_auto_20160107_1850'), - ] - - operations = [ - migrations.AlterField( - model_name='dependente', - name='cpf', - field=models.CharField(verbose_name='CPF', max_length=14, blank=True), - ), - migrations.AlterField( - model_name='dependente', - name='rg', - field=models.CharField(verbose_name='RG', max_length=15, blank=True), - ), - migrations.AlterField( - model_name='dependente', - name='titulo_eleitor', - field=models.CharField(verbose_name='Nº Título Eleitor', max_length=15, blank=True), - ), - migrations.AlterField( - model_name='mandato', - name='observacao', - field=models.TextField(verbose_name='Observação', blank=True), - ), - migrations.AlterField( - model_name='municipio', - name='nome', - field=models.CharField(max_length=50, blank=True), - ), - migrations.AlterField( - model_name='municipio', - name='regiao', - field=models.CharField(blank=True, choices=[('CO', 'Centro-Oeste'), ('NE', 'Nordeste'), ('NO', 'Norte'), ('SE', 'Sudeste'), ('SL', 'Sul'), ('EX', 'Exterior')], max_length=2), - ), - migrations.AlterField( - model_name='municipio', - name='uf', - field=models.CharField(blank=True, choices=[('AC', 'Acre'), ('AL', 'Alagoas'), ('AP', 'Amapá'), ('AM', 'Amazonas'), ('BA', 'Bahia'), ('CE', 'Ceará'), ('DF', 'Distrito Federal'), ('ES', 'Espírito Santo'), ('GO', 'Goiás'), ('MA', 'Maranhão'), ('MT', 'Mato Grosso'), ('MS', 'Mato Grosso do Sul'), ('MG', 'Minas Gerais'), ('PR', 'Paraná'), ('PB', 'Paraíba'), ('PA', 'Pará'), ('PE', 'Pernambuco'), ('PI', 'Piauí'), ('RJ', 'Rio de Janeiro'), ('RN', 'Rio Grande do Norte'), ('RS', 'Rio Grande do Sul'), ('RO', 'Rondônia'), ('RR', 'Roraima'), ('SC', 'Santa Catarina'), ('SE', 'Sergipe'), ('SP', 'São Paulo'), ('TO', 'Tocantins'), ('EX', 'Exterior')], max_length=2), - ), - migrations.AlterField( - model_name='parlamentar', - name='biografia', - field=models.TextField(verbose_name='Biografia', blank=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='cep_residencia', - field=models.CharField(verbose_name='CEP', max_length=9, blank=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='cpf', - field=models.CharField(verbose_name='C.P.F', max_length=14, blank=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='email', - field=models.CharField(verbose_name='Correio Eletrônico', max_length=100, blank=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='endereco_residencia', - field=models.CharField(verbose_name='Endereço Residencial', max_length=100, blank=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='endereco_web', - field=models.CharField(verbose_name='HomePage', max_length=100, blank=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='fax', - field=models.CharField(verbose_name='Fax', max_length=50, blank=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='fax_residencia', - field=models.CharField(verbose_name='Fax Residencial', max_length=50, blank=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='locais_atuacao', - field=models.CharField(verbose_name='Locais de Atuação', max_length=100, blank=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='numero_gab_parlamentar', - field=models.CharField(verbose_name='Nº Gabinete', max_length=10, blank=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='profissao', - field=models.CharField(verbose_name='Profissão', max_length=50, blank=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='rg', - field=models.CharField(verbose_name='R.G.', max_length=15, blank=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='telefone', - field=models.CharField(verbose_name='Telefone', max_length=50, blank=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='telefone_residencia', - field=models.CharField(verbose_name='Telefone Residencial', max_length=50, blank=True), - ), - migrations.AlterField( - model_name='parlamentar', - name='titulo_eleitor', - field=models.CharField(verbose_name='Título de Eleitor', max_length=15, blank=True), - ), - migrations.AlterField( - model_name='tipoafastamento', - name='dispositivo', - field=models.CharField(verbose_name='Dispositivo', max_length=50, blank=True), - ), - ] diff --git a/sapl/parlamentares/migrations/0012_auto_20160307_0905.py b/sapl/parlamentares/migrations/0012_auto_20160307_0905.py deleted file mode 100644 index c3d0cac90..000000000 --- a/sapl/parlamentares/migrations/0012_auto_20160307_0905.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-07 12:05 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0011_auto_20160216_1015'), - ] - - operations = [ - migrations.AlterField( - model_name='parlamentar', - name='email', - field=models.EmailField(blank=True, max_length=100, verbose_name='E-mail'), - ), - migrations.AlterField( - model_name='parlamentar', - name='endereco_web', - field=models.URLField(blank=True, max_length=100, verbose_name='HomePage'), - ), - ] diff --git a/sapl/parlamentares/migrations/0012_parlamentar_unidade_deliberativa.py b/sapl/parlamentares/migrations/0012_parlamentar_unidade_deliberativa.py deleted file mode 100644 index 6c6e63bcd..000000000 --- a/sapl/parlamentares/migrations/0012_parlamentar_unidade_deliberativa.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-07 17:58 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0011_auto_20160216_1015'), - ] - - operations = [ - migrations.AddField( - model_name='parlamentar', - name='unidade_deliberativa', - field=models.BooleanField(default=True, verbose_name='Unidade Deliberativa'), - preserve_default=False, - ), - ] diff --git a/sapl/parlamentares/migrations/0013_merge.py b/sapl/parlamentares/migrations/0013_merge.py deleted file mode 100644 index 0d555de78..000000000 --- a/sapl/parlamentares/migrations/0013_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-10 17:06 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0012_parlamentar_unidade_deliberativa'), - ('parlamentares', '0012_auto_20160307_0905'), - ] - - operations = [ - ] diff --git a/sapl/parlamentares/migrations/0014_auto_20160318_1504.py b/sapl/parlamentares/migrations/0014_auto_20160318_1504.py deleted file mode 100644 index 86170086d..000000000 --- a/sapl/parlamentares/migrations/0014_auto_20160318_1504.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-18 18:04 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0013_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='parlamentar', - name='unidade_deliberativa', - field=models.BooleanField(default=False, verbose_name='Unidade Deliberativa'), - ), - ] diff --git a/sapl/parlamentares/migrations/0015_auto_20160322_1401.py b/sapl/parlamentares/migrations/0015_auto_20160322_1401.py deleted file mode 100644 index 38df99e38..000000000 --- a/sapl/parlamentares/migrations/0015_auto_20160322_1401.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-22 17:01 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0014_auto_20160318_1504'), - ] - - operations = [ - migrations.AlterField( - model_name='mandato', - name='data_expedicao_diploma', - field=models.DateField(verbose_name='Expedição do Diploma'), - ), - migrations.AlterField( - model_name='mandato', - name='data_fim_mandato', - field=models.DateField(verbose_name='Fim do Mandato'), - ), - ] diff --git a/sapl/parlamentares/migrations/0016_auto_20160404_1409.py b/sapl/parlamentares/migrations/0016_auto_20160404_1409.py deleted file mode 100644 index a10fb6c38..000000000 --- a/sapl/parlamentares/migrations/0016_auto_20160404_1409.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-04-04 17:09 -from __future__ import unicode_literals - -from django.db import migrations, models -import sapl.parlamentares.models -import sapl.utils - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0015_auto_20160322_1401'), - ] - - operations = [ - migrations.AlterField( - model_name='parlamentar', - name='fotografia', - field=models.ImageField(blank=True, null=True, upload_to=sapl.parlamentares.models.foto_upload_path, validators=[ - sapl.utils.restringe_tipos_de_arquivo_img], verbose_name='Fotografia'), - ), - ] diff --git a/sapl/parlamentares/migrations/0017_remove_parlamentar_unidade_deliberativa.py b/sapl/parlamentares/migrations/0017_remove_parlamentar_unidade_deliberativa.py deleted file mode 100644 index be2e861fe..000000000 --- a/sapl/parlamentares/migrations/0017_remove_parlamentar_unidade_deliberativa.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-04-28 13:20 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0016_auto_20160404_1409'), - ] - - operations = [ - migrations.RemoveField( - model_name='parlamentar', - name='unidade_deliberativa', - ), - ] diff --git a/sapl/parlamentares/migrations/0018_auto_20160510_0943.py b/sapl/parlamentares/migrations/0018_auto_20160510_0943.py deleted file mode 100644 index 7546f4001..000000000 --- a/sapl/parlamentares/migrations/0018_auto_20160510_0943.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-10 12:43 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0017_remove_parlamentar_unidade_deliberativa'), - ] - - operations = [ - migrations.AlterModelOptions( - name='filiacao', - options={'ordering': ('parlamentar', '-data', '-data_desfiliacao'), 'verbose_name': 'Filiação', 'verbose_name_plural': 'Filiações'}, - ), - ] diff --git a/sapl/parlamentares/migrations/0019_auto_20160518_1136.py b/sapl/parlamentares/migrations/0019_auto_20160518_1136.py deleted file mode 100644 index f391c8be8..000000000 --- a/sapl/parlamentares/migrations/0019_auto_20160518_1136.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-18 14:36 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0018_auto_20160510_0943'), - ] - - operations = [ - migrations.AlterField( - model_name='composicaocoligacao', - name='partido', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='parlamentares.Partido', verbose_name='Partido'), - ), - ] diff --git a/sapl/parlamentares/migrations/0019_auto_20160518_1204.py b/sapl/parlamentares/migrations/0019_auto_20160518_1204.py deleted file mode 100644 index 573a5a3ab..000000000 --- a/sapl/parlamentares/migrations/0019_auto_20160518_1204.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-18 15:04 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0018_auto_20160510_0943'), - ] - - operations = [ - migrations.AlterModelOptions( - name='legislatura', - options={'ordering': ['-data_inicio'], 'verbose_name': 'Legislatura', 'verbose_name_plural': 'Legislaturas'}, - ), - ] diff --git a/sapl/parlamentares/migrations/0020_auto_20160518_1201.py b/sapl/parlamentares/migrations/0020_auto_20160518_1201.py deleted file mode 100644 index 2fb59f220..000000000 --- a/sapl/parlamentares/migrations/0020_auto_20160518_1201.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-18 15:01 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0019_auto_20160518_1136'), - ] - - operations = [ - migrations.AlterField( - model_name='composicaocoligacao', - name='partido', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='parlamentares.Partido', verbose_name='Partidos da Coligação'), - ), - ] diff --git a/sapl/parlamentares/migrations/0021_merge.py b/sapl/parlamentares/migrations/0021_merge.py deleted file mode 100644 index e29731513..000000000 --- a/sapl/parlamentares/migrations/0021_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-19 14:18 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0019_auto_20160518_1204'), - ('parlamentares', '0020_auto_20160518_1201'), - ] - - operations = [ - ] diff --git a/sapl/parlamentares/migrations/0022_auto_20160624_1124.py b/sapl/parlamentares/migrations/0022_auto_20160624_1124.py deleted file mode 100644 index a395bc806..000000000 --- a/sapl/parlamentares/migrations/0022_auto_20160624_1124.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-06-24 14:24 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion -import sapl.parlamentares.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0021_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='sessaolegislativa', - name='legislatura', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='parlamentares.Legislatura', verbose_name=sapl.parlamentares.models.Legislatura), - ), - ] diff --git a/sapl/parlamentares/migrations/0022_auto_20160702_1519.py b/sapl/parlamentares/migrations/0022_auto_20160702_1519.py deleted file mode 100644 index 6573268e1..000000000 --- a/sapl/parlamentares/migrations/0022_auto_20160702_1519.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-07-02 18:19 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0021_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='sessaolegislativa', - name='legislatura', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='parlamentares.Legislatura', verbose_name='Legislatura'), - ), - ] diff --git a/sapl/parlamentares/migrations/0023_auto_20160628_1247.py b/sapl/parlamentares/migrations/0023_auto_20160628_1247.py deleted file mode 100644 index d40680e48..000000000 --- a/sapl/parlamentares/migrations/0023_auto_20160628_1247.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-06-28 15:47 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0022_auto_20160624_1124'), - ] - - operations = [ - migrations.AlterField( - model_name='sessaolegislativa', - name='legislatura', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='parlamentares.Legislatura', verbose_name='Legislatura'), - ), - ] diff --git a/sapl/parlamentares/migrations/0024_merge.py b/sapl/parlamentares/migrations/0024_merge.py deleted file mode 100644 index f8e63c317..000000000 --- a/sapl/parlamentares/migrations/0024_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-08-18 21:39 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0022_auto_20160702_1519'), - ('parlamentares', '0023_auto_20160628_1247'), - ] - - operations = [ - ] diff --git a/sapl/parlamentares/migrations/0025_auto_20160916_1030.py b/sapl/parlamentares/migrations/0025_auto_20160916_1030.py deleted file mode 100644 index 7a8f3fabe..000000000 --- a/sapl/parlamentares/migrations/0025_auto_20160916_1030.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-16 13:30 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0024_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='parlamentar', - name='ativo', - field=models.BooleanField(db_index=True, verbose_name='Ativo na Casa?'), - ), - ] diff --git a/sapl/parlamentares/migrations/0025_frente.py b/sapl/parlamentares/migrations/0025_frente.py deleted file mode 100644 index 1ba6cdb15..000000000 --- a/sapl/parlamentares/migrations/0025_frente.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-16 13:25 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0024_merge'), - ] - - operations = [ - migrations.CreateModel( - name='Frente', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('nome', models.CharField(max_length=80, verbose_name='Nome da Frente')), - ('data_criacao', models.DateField(verbose_name='Data Criação')), - ('data_extincao', models.DateField(blank=True, verbose_name='Data Dissolução')), - ('descricao', models.TextField(blank=True, verbose_name='Descrição')), - ('parlamentares', models.ManyToManyField(blank=True, to='parlamentares.Parlamentar', verbose_name='Parlamentares')), - ], - options={ - 'verbose_name': 'Frente', - 'verbose_name_plural': 'Frentes', - }, - ), - ] diff --git a/sapl/parlamentares/migrations/0026_auto_20160916_1034.py b/sapl/parlamentares/migrations/0026_auto_20160916_1034.py deleted file mode 100644 index fecddb39a..000000000 --- a/sapl/parlamentares/migrations/0026_auto_20160916_1034.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-16 13:34 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0025_frente'), - ] - - operations = [ - migrations.AlterField( - model_name='frente', - name='data_extincao', - field=models.DateField(blank=True, null=True, verbose_name='Data Dissolução'), - ), - ] diff --git a/sapl/parlamentares/migrations/0027_merge.py b/sapl/parlamentares/migrations/0027_merge.py deleted file mode 100644 index f71a6160b..000000000 --- a/sapl/parlamentares/migrations/0027_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-16 14:44 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0026_auto_20160916_1034'), - ('parlamentares', '0025_auto_20160916_1030'), - ] - - operations = [ - ] diff --git a/sapl/parlamentares/migrations/0028_auto_20160922_1443.py b/sapl/parlamentares/migrations/0028_auto_20160922_1443.py deleted file mode 100644 index 23efc2489..000000000 --- a/sapl/parlamentares/migrations/0028_auto_20160922_1443.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-22 17:43 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0027_merge'), - ] - - operations = [ - migrations.RemoveField( - model_name='tipoafastamento', - name='afastamento', - ), - migrations.RemoveField( - model_name='tipoafastamento', - name='fim_mandato', - ), - migrations.AddField( - model_name='tipoafastamento', - name='indicador', - field=models.CharField(choices=[('A', 'Afastamento'), ('F', 'Fim de Mandato')], default='F', max_length=1, verbose_name='Indicador'), - ), - ] diff --git a/sapl/parlamentares/migrations/0028_legislatura_numero.py b/sapl/parlamentares/migrations/0028_legislatura_numero.py deleted file mode 100644 index 465c1b764..000000000 --- a/sapl/parlamentares/migrations/0028_legislatura_numero.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-21 15:03 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0027_merge'), - ] - - operations = [ - migrations.AddField( - model_name='legislatura', - name='numero', - field=models.PositiveIntegerField(default=1, verbose_name='Número'), - preserve_default=False, - ), - ] diff --git a/sapl/parlamentares/migrations/0029_merge.py b/sapl/parlamentares/migrations/0029_merge.py deleted file mode 100644 index 034f452a4..000000000 --- a/sapl/parlamentares/migrations/0029_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-22 20:52 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0028_auto_20160922_1443'), - ('parlamentares', '0028_legislatura_numero'), - ] - - operations = [ - ] diff --git a/sapl/parlamentares/migrations/0030_auto_20160928_0846.py b/sapl/parlamentares/migrations/0030_auto_20160928_0846.py deleted file mode 100644 index 04c88a009..000000000 --- a/sapl/parlamentares/migrations/0030_auto_20160928_0846.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-28 11:46 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0029_merge'), - ] - - operations = [ - migrations.AlterField( - model_name='tipodependente', - name='descricao', - field=models.CharField(max_length=50, verbose_name='Descrição'), - ), - ] diff --git a/sapl/parlamentares/migrations/0031_auto_20160929_1842.py b/sapl/parlamentares/migrations/0031_auto_20160929_1842.py deleted file mode 100644 index 6e920f5d5..000000000 --- a/sapl/parlamentares/migrations/0031_auto_20160929_1842.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-29 21:42 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0030_auto_20160928_0846'), - ] - - operations = [ - migrations.AlterModelOptions( - name='sessaolegislativa', - options={'ordering': ['-data_inicio', '-data_fim'], 'verbose_name': 'Sessão Legislativa', 'verbose_name_plural': 'Sessões Legislativas'}, - ), - ] diff --git a/sapl/parlamentares/migrations/0032_frenteproxymasterdetail.py b/sapl/parlamentares/migrations/0032_frenteproxymasterdetail.py deleted file mode 100644 index 8974be563..000000000 --- a/sapl/parlamentares/migrations/0032_frenteproxymasterdetail.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-30 20:09 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0031_auto_20160929_1842'), - ] - - operations = [ - migrations.CreateModel( - name='FrenteProxyMasterDetail', - fields=[ - ], - options={ - 'proxy': True, - }, - bases=('parlamentares.frente',), - ), - ] diff --git a/sapl/parlamentares/migrations/0033_auto_20160930_1715.py b/sapl/parlamentares/migrations/0033_auto_20160930_1715.py deleted file mode 100644 index 14591d16c..000000000 --- a/sapl/parlamentares/migrations/0033_auto_20160930_1715.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-30 20:15 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0032_frenteproxymasterdetail'), - ] - - operations = [ - migrations.DeleteModel( - name='FrenteProxyMasterDetail', - ), - migrations.CreateModel( - name='FrenteParlamentar', - fields=[ - ], - options={ - 'proxy': True, - 'verbose_name': 'Frente', - 'verbose_name_plural': 'Frentes', - }, - bases=('parlamentares.frente',), - ), - ] diff --git a/sapl/parlamentares/migrations/0034_delete_frenteparlamentar.py b/sapl/parlamentares/migrations/0034_delete_frenteparlamentar.py deleted file mode 100644 index 4c5e8d710..000000000 --- a/sapl/parlamentares/migrations/0034_delete_frenteparlamentar.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-30 21:43 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0033_auto_20160930_1715'), - ] - - operations = [ - migrations.DeleteModel( - name='FrenteParlamentar', - ), - ] diff --git a/sapl/parlamentares/migrations/0035_auto_20161011_0840.py b/sapl/parlamentares/migrations/0035_auto_20161011_0840.py deleted file mode 100644 index 0b324e3e5..000000000 --- a/sapl/parlamentares/migrations/0035_auto_20161011_0840.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-11 11:40 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0034_delete_frenteparlamentar'), - ] - - operations = [ - migrations.AlterField( - model_name='parlamentar', - name='ativo', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], db_index=True, default=False, verbose_name='Ativo na Casa?'), - ), - ] diff --git a/sapl/parlamentares/migrations/0036_partido_logo_partido.py b/sapl/parlamentares/migrations/0036_partido_logo_partido.py deleted file mode 100644 index a234fbf6c..000000000 --- a/sapl/parlamentares/migrations/0036_partido_logo_partido.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.12 on 2016-12-16 16:40 -from __future__ import unicode_literals - -from django.db import migrations, models -import sapl.parlamentares.models -import sapl.utils - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0035_auto_20161011_0840'), - ] - - operations = [ - migrations.AddField( - model_name='partido', - name='logo_partido', - field=models.ImageField(blank=True, null=True, upload_to=sapl.parlamentares.models.logo_upload_path, validators=[sapl.utils.restringe_tipos_de_arquivo_img], verbose_name='Logo Partido'), - ), - ] diff --git a/sapl/parlamentares/migrations/0037_votante.py b/sapl/parlamentares/migrations/0037_votante.py deleted file mode 100644 index fca67dec4..000000000 --- a/sapl/parlamentares/migrations/0037_votante.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-02-09 15:18 -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 = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('parlamentares', '0036_partido_logo_partido'), - ] - - operations = [ - migrations.CreateModel( - name='Votante', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('data', models.DateTimeField(auto_now_add=True, max_length=30, null=True, verbose_name='Data')), - ('ip', models.CharField(blank=True, max_length=30, null=True, verbose_name='IP')), - ('parlamentar', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='parlamentar', to='parlamentares.Parlamentar', verbose_name='Parlamentar')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user', to=settings.AUTH_USER_MODEL, verbose_name='User')), - ], - options={ - 'verbose_name': 'Votantes', - }, - ), - ] diff --git a/sapl/parlamentares/migrations/0038_auto_20170213_1425.py b/sapl/parlamentares/migrations/0038_auto_20170213_1425.py deleted file mode 100644 index 7134cef57..000000000 --- a/sapl/parlamentares/migrations/0038_auto_20170213_1425.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-02-13 14:25 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0037_votante'), - ] - - operations = [ - migrations.AlterModelOptions( - name='votante', - options={'verbose_name': 'Usuários'}, - ), - ] diff --git a/sapl/parlamentares/migrations/0039_remove_votante_ip.py b/sapl/parlamentares/migrations/0039_remove_votante_ip.py deleted file mode 100644 index 9ae65babd..000000000 --- a/sapl/parlamentares/migrations/0039_remove_votante_ip.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-02-13 14:26 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0038_auto_20170213_1425'), - ] - - operations = [ - migrations.RemoveField( - model_name='votante', - name='ip', - ), - ] diff --git a/sapl/parlamentares/migrations/0040_auto_20170214_1709.py b/sapl/parlamentares/migrations/0040_auto_20170214_1709.py deleted file mode 100644 index 5c28f30ca..000000000 --- a/sapl/parlamentares/migrations/0040_auto_20170214_1709.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.12 on 2017-02-14 17:09 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0039_remove_votante_ip'), - ] - - operations = [ - migrations.AlterModelOptions( - name='votante', - options={'permissions': (('can_vote', 'Can Vote'),), 'verbose_name': 'Usuário', 'verbose_name_plural': 'Usuários'}, - ), - ] diff --git a/sapl/parlamentares/migrations/0041_mandato_titular.py b/sapl/parlamentares/migrations/0041_mandato_titular.py deleted file mode 100644 index 69f0c768a..000000000 --- a/sapl/parlamentares/migrations/0041_mandato_titular.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-03-16 13:24 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0040_auto_20170214_1709'), - ] - - operations = [ - migrations.AddField( - model_name='mandato', - name='titular', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], db_index=True, default=True, verbose_name='Vereador Titular'), - ), - ] diff --git a/sapl/parlamentares/migrations/0042_auto_20170325_1052.py b/sapl/parlamentares/migrations/0042_auto_20170325_1052.py deleted file mode 100644 index d6d2e8736..000000000 --- a/sapl/parlamentares/migrations/0042_auto_20170325_1052.py +++ /dev/null @@ -1,117 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.12 on 2017-03-25 10:52 -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 = [ - ('parlamentares', '0041_mandato_titular'), - ] - - operations = [ - migrations.AlterField( - model_name='coligacao', - name='legislatura', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura'), - ), - migrations.AlterField( - model_name='composicaocoligacao', - name='coligacao', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Coligacao'), - ), - migrations.AlterField( - model_name='composicaocoligacao', - name='partido', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Partido', verbose_name='Partidos da Coligação'), - ), - migrations.AlterField( - model_name='composicaomesa', - name='cargo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.CargoMesa'), - ), - migrations.AlterField( - model_name='composicaomesa', - name='parlamentar', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), - ), - migrations.AlterField( - model_name='composicaomesa', - name='sessao_legislativa', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.SessaoLegislativa'), - ), - migrations.AlterField( - model_name='dependente', - name='parlamentar', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), - ), - migrations.AlterField( - model_name='dependente', - name='tipo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.TipoDependente', verbose_name='Tipo'), - ), - migrations.AlterField( - model_name='filiacao', - name='parlamentar', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), - ), - migrations.AlterField( - model_name='filiacao', - name='partido', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Partido', verbose_name='Partido'), - ), - migrations.AlterField( - model_name='mandato', - name='coligacao', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Coligacao', verbose_name='Coligação'), - ), - migrations.AlterField( - model_name='mandato', - name='legislatura', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura'), - ), - migrations.AlterField( - model_name='mandato', - name='parlamentar', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), - ), - migrations.AlterField( - model_name='mandato', - name='tipo_afastamento', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.TipoAfastamento'), - ), - migrations.AlterField( - model_name='parlamentar', - name='municipio_residencia', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Municipio', verbose_name='Município'), - ), - migrations.AlterField( - model_name='parlamentar', - name='nivel_instrucao', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.NivelInstrucao', verbose_name='Nível Instrução'), - ), - migrations.AlterField( - model_name='parlamentar', - name='situacao_militar', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.SituacaoMilitar', verbose_name='Situação Militar'), - ), - migrations.AlterField( - model_name='sessaolegislativa', - name='legislatura', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura'), - ), - migrations.AlterField( - model_name='votante', - name='parlamentar', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='parlamentar', to='parlamentares.Parlamentar', verbose_name='Parlamentar'), - ), - migrations.AlterField( - model_name='votante', - name='user', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='user', to=settings.AUTH_USER_MODEL, verbose_name='User'), - ), - ] diff --git a/sapl/protocoloadm/migrations/0001_initial.py b/sapl/protocoloadm/migrations/0001_initial.py index 5f9a851f8..c98e715bd 100644 --- a/sapl/protocoloadm/migrations/0001_initial.py +++ b/sapl/protocoloadm/migrations/0001_initial.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-06-24 14:31 +# Generated by Django 1.9.12 on 2017-03-25 11:14 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion -import sapl.protocoloadm.models +import sapl.utils class Migration(migrations.Migration): @@ -12,7 +12,8 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('materia', '0038_auto_20160612_1506'), + ('base', '0001_initial'), + ('materia', '0001_initial'), ] operations = [ @@ -21,7 +22,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nome', models.CharField(max_length=30, verbose_name='Nome')), - ('arquivo', models.FileField(blank=True, null=True, upload_to=sapl.protocoloadm.models.texto_upload_path, verbose_name='Arquivo')), + ('arquivo', models.FileField(blank=True, null=True, upload_to=sapl.utils.texto_upload_path, verbose_name='Arquivo')), ('data', models.DateField(blank=True, null=True, verbose_name='Data')), ('autor', models.CharField(blank=True, max_length=50, verbose_name='Autor')), ('assunto', models.TextField(blank=True, verbose_name='Assunto')), @@ -37,7 +38,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('numero', models.PositiveIntegerField(verbose_name='Número')), - ('ano', models.PositiveSmallIntegerField(choices=[(2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano')), + ('ano', models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano')), ('data', models.DateField(verbose_name='Data')), ('numero_protocolo', models.PositiveIntegerField(blank=True, null=True, verbose_name='Núm. Protocolo')), ('interessado', models.CharField(blank=True, max_length=50, verbose_name='Interessado')), @@ -46,8 +47,8 @@ class Migration(migrations.Migration): ('tramitacao', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Em Tramitação?')), ('assunto', models.TextField(verbose_name='Assunto')), ('observacao', models.TextField(blank=True, verbose_name='Observação')), - ('texto_integral', models.FileField(blank=True, null=True, upload_to=sapl.protocoloadm.models.texto_upload_path, verbose_name='Texto Integral')), - ('autor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='materia.Autor')), + ('texto_integral', models.FileField(blank=True, null=True, upload_to=sapl.utils.texto_upload_path, verbose_name='Texto Integral')), + ('autor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='base.Autor')), ], options={ 'verbose_name': 'Documento Administrativo', @@ -59,11 +60,11 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('numero', models.PositiveIntegerField(verbose_name='Número de Protocolo')), - ('ano', models.PositiveSmallIntegerField(choices=[(2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano do Protocolo')), + ('ano', models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano do Protocolo')), ('data', models.DateField()), ('hora', models.TimeField()), ('timestamp', models.DateTimeField()), - ('tipo_protocolo', models.PositiveIntegerField(verbose_name='Tipo de Protocolo')), + ('tipo_protocolo', models.PositiveIntegerField(blank=True, null=True, verbose_name='Tipo de Protocolo')), ('tipo_processo', models.PositiveIntegerField()), ('interessado', models.CharField(blank=True, max_length=60, verbose_name='Interessado')), ('assunto_ementa', models.TextField(blank=True)), @@ -74,9 +75,10 @@ class Migration(migrations.Migration): ('ip_anulacao', models.CharField(blank=True, max_length=15)), ('justificativa_anulacao', models.CharField(blank=True, max_length=60, verbose_name='Motivo')), ('timestamp_anulacao', models.DateTimeField(blank=True, null=True)), - ('autor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='materia.Autor')), + ('autor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='base.Autor')), ], options={ + 'permissions': (('action_anular_protocolo', 'Permissão para Anular Protocolo'),), 'verbose_name': 'Protocolo', 'verbose_name_plural': 'Protocolos', }, @@ -102,21 +104,11 @@ class Migration(migrations.Migration): ('descricao', models.CharField(max_length=50, verbose_name='Descrição')), ], options={ + 'ordering': ['descricao'], 'verbose_name': 'Tipo de Documento Administrativo', 'verbose_name_plural': 'Tipos de Documento Administrativo', }, ), - migrations.CreateModel( - name='TipoInstituicao', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('descricao', models.CharField(max_length=50, verbose_name='Descrição')), - ], - options={ - 'verbose_name': 'Tipo de Instituição', - 'verbose_name_plural': 'Tipos de Instituições', - }, - ), migrations.CreateModel( name='TramitacaoAdministrativo', fields=[ @@ -125,10 +117,10 @@ class Migration(migrations.Migration): ('data_encaminhamento', models.DateField(blank=True, null=True, verbose_name='Data Encaminhamento')), ('texto', models.TextField(blank=True, verbose_name='Texto da Ação')), ('data_fim_prazo', models.DateField(blank=True, null=True, verbose_name='Data Fim do Prazo')), - ('documento', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='protocoloadm.DocumentoAdministrativo')), - ('status', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='protocoloadm.StatusTramitacaoAdministrativo', verbose_name='Status')), - ('unidade_tramitacao_destino', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='adm_tramitacoes_destino', to='materia.UnidadeTramitacao', verbose_name='Unidade Destino')), - ('unidade_tramitacao_local', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='adm_tramitacoes_origem', to='materia.UnidadeTramitacao', verbose_name='Unidade Local')), + ('documento', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.DocumentoAdministrativo')), + ('status', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.StatusTramitacaoAdministrativo', verbose_name='Status')), + ('unidade_tramitacao_destino', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='adm_tramitacoes_destino', to='materia.UnidadeTramitacao', verbose_name='Unidade Destino')), + ('unidade_tramitacao_local', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='adm_tramitacoes_origem', to='materia.UnidadeTramitacao', verbose_name='Unidade Local')), ], options={ 'verbose_name': 'Tramitação de Documento Administrativo', @@ -138,26 +130,31 @@ class Migration(migrations.Migration): migrations.AddField( model_name='protocolo', name='tipo_documento', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='protocoloadm.TipoDocumentoAdministrativo', verbose_name='Tipo de documento'), + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.TipoDocumentoAdministrativo', verbose_name='Tipo de documento'), ), migrations.AddField( model_name='protocolo', name='tipo_materia', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='materia.TipoMateriaLegislativa', verbose_name='Tipo Matéria'), + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.TipoMateriaLegislativa', verbose_name='Tipo Matéria'), + ), + migrations.AddField( + model_name='documentoadministrativo', + name='protocolo', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.Protocolo', verbose_name='Protocolo'), ), migrations.AddField( model_name='documentoadministrativo', name='tipo', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='protocoloadm.TipoDocumentoAdministrativo', verbose_name='Tipo Documento'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.TipoDocumentoAdministrativo', verbose_name='Tipo Documento'), ), migrations.AddField( model_name='documentoacessorioadministrativo', name='documento', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='protocoloadm.DocumentoAdministrativo'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.DocumentoAdministrativo'), ), migrations.AddField( model_name='documentoacessorioadministrativo', name='tipo', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='protocoloadm.TipoDocumentoAdministrativo', verbose_name='Tipo'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.TipoDocumentoAdministrativo', verbose_name='Tipo'), ), ] diff --git a/sapl/protocoloadm/migrations/0002_delete_tipoinstituicao.py b/sapl/protocoloadm/migrations/0002_delete_tipoinstituicao.py deleted file mode 100644 index 064981161..000000000 --- a/sapl/protocoloadm/migrations/0002_delete_tipoinstituicao.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-05 17:42 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0001_initial'), - ] - - operations = [ - migrations.DeleteModel( - name='TipoInstituicao', - ), - ] diff --git a/sapl/protocoloadm/migrations/0003_auto_20161009_1222.py b/sapl/protocoloadm/migrations/0003_auto_20161009_1222.py deleted file mode 100644 index 4512ea548..000000000 --- a/sapl/protocoloadm/migrations/0003_auto_20161009_1222.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-09 15:22 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -def clear_field_autor_in_protocolo(apps, schema_editor): - Protocolo = apps.get_model("protocoloadm", "Protocolo") - for p in Protocolo.objects.all(): - p.autor = None - p.save() - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0002_delete_tipoinstituicao'), - ] - - operations = [ - migrations.RunPython(clear_field_autor_in_protocolo), - migrations.AlterField( - model_name='documentoadministrativo', - name='autor', - field=models.ForeignKey( - blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='base.Autor'), - ), - migrations.AlterField( - model_name='protocolo', - name='autor', - field=models.ForeignKey( - blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='base.Autor'), - ), - ] diff --git a/sapl/protocoloadm/migrations/0004_auto_20161023_1444.py b/sapl/protocoloadm/migrations/0004_auto_20161023_1444.py deleted file mode 100644 index 3900a64ff..000000000 --- a/sapl/protocoloadm/migrations/0004_auto_20161023_1444.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-23 14:44 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0003_auto_20161009_1222'), - ] - - operations = [ - migrations.AlterField( - model_name='tramitacaoadministrativo', - name='unidade_tramitacao_destino', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='adm_tramitacoes_destino', to='materia.UnidadeTramitacao', verbose_name='Unidade Destino'), - ), - ] diff --git a/sapl/protocoloadm/migrations/0005_auto_20161027_1741.py b/sapl/protocoloadm/migrations/0005_auto_20161027_1741.py deleted file mode 100644 index 891ff2a5e..000000000 --- a/sapl/protocoloadm/migrations/0005_auto_20161027_1741.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-27 17:41 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0004_auto_20161023_1444'), - ] - - operations = [ - migrations.AlterModelOptions( - name='protocolo', - options={'permissions': (('action_anular_protocolo', 'Permissão para Anular Protocolo'),), 'verbose_name': 'Protocolo', 'verbose_name_plural': 'Protocolos'}, - ), - ] diff --git a/sapl/protocoloadm/migrations/0006_auto_20161103_1721.py b/sapl/protocoloadm/migrations/0006_auto_20161103_1721.py deleted file mode 100644 index 4100f4157..000000000 --- a/sapl/protocoloadm/migrations/0006_auto_20161103_1721.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-03 17:21 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0005_auto_20161027_1741'), - ] - - operations = [ - migrations.AlterField( - model_name='protocolo', - name='tipo_protocolo', - field=models.PositiveIntegerField(blank=True, null=True, verbose_name='Tipo de Protocolo'), - ), - ] diff --git a/sapl/protocoloadm/migrations/0007_auto_20161110_0910.py b/sapl/protocoloadm/migrations/0007_auto_20161110_0910.py deleted file mode 100644 index 79aa42f23..000000000 --- a/sapl/protocoloadm/migrations/0007_auto_20161110_0910.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-11-10 09:10 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0006_auto_20161103_1721'), - ] - - operations = [ - migrations.AlterField( - model_name='documentoadministrativo', - name='ano', - field=models.PositiveSmallIntegerField(choices=[('', 'Selecione'), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - migrations.AlterField( - model_name='protocolo', - name='ano', - field=models.PositiveSmallIntegerField(choices=[('', 'Selecione'), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano do Protocolo'), - ), - ] diff --git a/sapl/protocoloadm/migrations/0008_auto_20161216_1640.py b/sapl/protocoloadm/migrations/0008_auto_20161216_1640.py deleted file mode 100644 index 1fd7dcbdc..000000000 --- a/sapl/protocoloadm/migrations/0008_auto_20161216_1640.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.12 on 2016-12-16 16:40 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0007_auto_20161110_0910'), - ] - - operations = [ - migrations.AlterModelOptions( - name='tipodocumentoadministrativo', - options={'ordering': ['descricao'], 'verbose_name': 'Tipo de Documento Administrativo', 'verbose_name_plural': 'Tipos de Documento Administrativo'}, - ), - ] diff --git a/sapl/protocoloadm/migrations/0009_auto_20170102_0951.py b/sapl/protocoloadm/migrations/0009_auto_20170102_0951.py deleted file mode 100644 index 770a84c17..000000000 --- a/sapl/protocoloadm/migrations/0009_auto_20170102_0951.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-01-02 09:51 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0008_auto_20161216_1640'), - ] - - operations = [ - migrations.AlterField( - model_name='documentoadministrativo', - name='ano', - field=models.PositiveSmallIntegerField(choices=[('', 'Selecione'), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - migrations.AlterField( - model_name='protocolo', - name='ano', - field=models.PositiveSmallIntegerField(choices=[('', 'Selecione'), (2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano do Protocolo'), - ), - ] diff --git a/sapl/protocoloadm/migrations/0010_auto_20170123_1548.py b/sapl/protocoloadm/migrations/0010_auto_20170123_1548.py deleted file mode 100644 index 05dafb21c..000000000 --- a/sapl/protocoloadm/migrations/0010_auto_20170123_1548.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-01-23 15:48 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0009_auto_20170102_0951'), - ] - - operations = [ - migrations.AlterField( - model_name='documentoadministrativo', - name='ano', - field=models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - migrations.AlterField( - model_name='protocolo', - name='ano', - field=models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano do Protocolo'), - ), - ] diff --git a/sapl/protocoloadm/migrations/0010_auto_20170203_1019.py b/sapl/protocoloadm/migrations/0010_auto_20170203_1019.py deleted file mode 100644 index dadc43244..000000000 --- a/sapl/protocoloadm/migrations/0010_auto_20170203_1019.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-02-03 10:19 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0009_auto_20170102_0951'), - ] - - operations = [ - migrations.AlterField( - model_name='documentoadministrativo', - name='ano', - field=models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano'), - ), - migrations.AlterField( - model_name='protocolo', - name='ano', - field=models.PositiveSmallIntegerField(choices=[(2017, 2017), (2016, 2016), (2015, 2015), (2014, 2014), (2013, 2013), (2012, 2012), (2011, 2011), (2010, 2010), (2009, 2009), (2008, 2008), (2007, 2007), (2006, 2006), (2005, 2005), (2004, 2004), (2003, 2003), (2002, 2002), (2001, 2001), (2000, 2000), (1999, 1999), (1998, 1998), (1997, 1997), (1996, 1996), (1995, 1995), (1994, 1994), (1993, 1993), (1992, 1992), (1991, 1991), (1990, 1990), (1989, 1989), (1988, 1988), (1987, 1987), (1986, 1986), (1985, 1985), (1984, 1984), (1983, 1983), (1982, 1982), (1981, 1981), (1980, 1980), (1979, 1979), (1978, 1978), (1977, 1977), (1976, 1976), (1975, 1975), (1974, 1974), (1973, 1973), (1972, 1972), (1971, 1971), (1970, 1970), (1969, 1969), (1968, 1968), (1967, 1967), (1966, 1966), (1965, 1965), (1964, 1964), (1963, 1963), (1962, 1962), (1961, 1961), (1960, 1960), (1959, 1959), (1958, 1958), (1957, 1957), (1956, 1956), (1955, 1955), (1954, 1954), (1953, 1953), (1952, 1952), (1951, 1951), (1950, 1950), (1949, 1949), (1948, 1948), (1947, 1947), (1946, 1946), (1945, 1945), (1944, 1944), (1943, 1943), (1942, 1942), (1941, 1941), (1940, 1940), (1939, 1939), (1938, 1938), (1937, 1937), (1936, 1936), (1935, 1935), (1934, 1934), (1933, 1933), (1932, 1932), (1931, 1931), (1930, 1930), (1929, 1929), (1928, 1928), (1927, 1927), (1926, 1926), (1925, 1925), (1924, 1924), (1923, 1923), (1922, 1922), (1921, 1921), (1920, 1920), (1919, 1919), (1918, 1918), (1917, 1917), (1916, 1916), (1915, 1915), (1914, 1914), (1913, 1913), (1912, 1912), (1911, 1911), (1910, 1910), (1909, 1909), (1908, 1908), (1907, 1907), (1906, 1906), (1905, 1905), (1904, 1904), (1903, 1903), (1902, 1902), (1901, 1901), (1900, 1900), (1899, 1899), (1898, 1898), (1897, 1897), (1896, 1896), (1895, 1895), (1894, 1894), (1893, 1893), (1892, 1892), (1891, 1891), (1890, 1890)], verbose_name='Ano do Protocolo'), - ), - ] diff --git a/sapl/protocoloadm/migrations/0011_merge.py b/sapl/protocoloadm/migrations/0011_merge.py deleted file mode 100644 index 10ea183c3..000000000 --- a/sapl/protocoloadm/migrations/0011_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-03-03 16:34 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0010_auto_20170203_1019'), - ('protocoloadm', '0010_auto_20170123_1548'), - ] - - operations = [ - ] diff --git a/sapl/protocoloadm/migrations/0012_auto_20170315_1211.py b/sapl/protocoloadm/migrations/0012_auto_20170315_1211.py deleted file mode 100644 index 25ffbdf7b..000000000 --- a/sapl/protocoloadm/migrations/0012_auto_20170315_1211.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-03-15 12:11 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0011_merge'), - ] - - operations = [ - migrations.AddField( - model_name='documentoadministrativo', - name='protocolo', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='protocoloadm.Protocolo'), - ), - migrations.AlterField( - model_name='documentoadministrativo', - name='observacao', - field=models.TextField(blank=True, null=True, verbose_name='Observação'), - ), - ] diff --git a/sapl/protocoloadm/migrations/0013_auto_20170320_1637.py b/sapl/protocoloadm/migrations/0013_auto_20170320_1637.py deleted file mode 100644 index f15b15de2..000000000 --- a/sapl/protocoloadm/migrations/0013_auto_20170320_1637.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.11 on 2017-03-20 16:37 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0012_auto_20170315_1211'), - ] - - operations = [ - migrations.AlterField( - model_name='documentoadministrativo', - name='observacao', - field=models.TextField(blank=True, default='', verbose_name='Observação'), - preserve_default=False, - ), - ] diff --git a/sapl/protocoloadm/migrations/0014_auto_20170321_1130.py b/sapl/protocoloadm/migrations/0014_auto_20170321_1130.py deleted file mode 100644 index 661d7242b..000000000 --- a/sapl/protocoloadm/migrations/0014_auto_20170321_1130.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-03-21 11:30 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0013_auto_20170320_1637'), - ] - - operations = [ - migrations.AlterField( - model_name='documentoadministrativo', - name='protocolo', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='protocoloadm.Protocolo', verbose_name='Protocolo'), - ), - ] diff --git a/sapl/protocoloadm/migrations/0015_auto_20170325_1052.py b/sapl/protocoloadm/migrations/0015_auto_20170325_1052.py deleted file mode 100644 index f080b796f..000000000 --- a/sapl/protocoloadm/migrations/0015_auto_20170325_1052.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.12 on 2017-03-25 10:52 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('protocoloadm', '0014_auto_20170321_1130'), - ] - - operations = [ - migrations.AlterField( - model_name='documentoacessorioadministrativo', - name='documento', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.DocumentoAdministrativo'), - ), - migrations.AlterField( - model_name='documentoacessorioadministrativo', - name='tipo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.TipoDocumentoAdministrativo', verbose_name='Tipo'), - ), - migrations.AlterField( - model_name='documentoadministrativo', - name='autor', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='base.Autor'), - ), - migrations.AlterField( - model_name='documentoadministrativo', - name='protocolo', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.Protocolo', verbose_name='Protocolo'), - ), - migrations.AlterField( - model_name='documentoadministrativo', - name='tipo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.TipoDocumentoAdministrativo', verbose_name='Tipo Documento'), - ), - migrations.AlterField( - model_name='protocolo', - name='autor', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='base.Autor'), - ), - migrations.AlterField( - model_name='protocolo', - name='tipo_documento', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.TipoDocumentoAdministrativo', verbose_name='Tipo de documento'), - ), - migrations.AlterField( - model_name='protocolo', - name='tipo_materia', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='materia.TipoMateriaLegislativa', verbose_name='Tipo Matéria'), - ), - migrations.AlterField( - model_name='tramitacaoadministrativo', - name='documento', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.DocumentoAdministrativo'), - ), - migrations.AlterField( - model_name='tramitacaoadministrativo', - name='status', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='protocoloadm.StatusTramitacaoAdministrativo', verbose_name='Status'), - ), - migrations.AlterField( - model_name='tramitacaoadministrativo', - name='unidade_tramitacao_destino', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='adm_tramitacoes_destino', to='materia.UnidadeTramitacao', verbose_name='Unidade Destino'), - ), - migrations.AlterField( - model_name='tramitacaoadministrativo', - name='unidade_tramitacao_local', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='adm_tramitacoes_origem', to='materia.UnidadeTramitacao', verbose_name='Unidade Local'), - ), - ] diff --git a/sapl/relatorios/migrations/__init__.py b/sapl/relatorios/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/sapl/rules/migrations/__init__.py b/sapl/rules/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/sapl/sessao/migrations/0001_initial.py b/sapl/sessao/migrations/0001_initial.py index fe4d09a66..1b23dc744 100644 --- a/sapl/sessao/migrations/0001_initial.py +++ b/sapl/sessao/migrations/0001_initial.py @@ -1,256 +1,336 @@ # -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-25 11:14 from __future__ import unicode_literals +from django.conf import settings from django.db import migrations, models +import django.db.models.deletion +import sapl.sessao.models +import sapl.utils class Migration(migrations.Migration): + initial = True + dependencies = [ ('parlamentares', '0001_initial'), ('materia', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ + migrations.CreateModel( + name='Bancada', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('nome', models.CharField(max_length=80, verbose_name='Nome da Bancada')), + ('data_criacao', models.DateField(blank=True, null=True, verbose_name='Data Criação')), + ('data_extincao', models.DateField(blank=True, null=True, verbose_name='Data Extinção')), + ('descricao', models.TextField(blank=True, verbose_name='Descrição')), + ('legislatura', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura')), + ('partido', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Partido', verbose_name='Partido')), + ], + options={ + 'ordering': ('-legislatura__numero',), + 'verbose_name': 'Bancada', + 'verbose_name_plural': 'Bancadas', + }, + ), + migrations.CreateModel( + name='Bloco', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('nome', models.CharField(max_length=80, verbose_name='Nome do Bloco')), + ('data_criacao', models.DateField(blank=True, null=True, verbose_name='Data Criação')), + ('data_extincao', models.DateField(blank=True, null=True, verbose_name='Data Dissolução')), + ('descricao', models.TextField(blank=True, verbose_name='Descrição')), + ('partidos', models.ManyToManyField(blank=True, to='parlamentares.Partido', verbose_name='Bancadas')), + ], + options={ + 'verbose_name': 'Bloco', + 'verbose_name_plural': 'Blocos', + }, + ), + migrations.CreateModel( + name='CargoBancada', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('nome_cargo', models.CharField(max_length=80, verbose_name='Cargo de Bancada')), + ('cargo_unico', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Cargo Único ?')), + ], + options={ + 'verbose_name': 'Cargo de Bancada', + 'verbose_name_plural': 'Cargos de Bancada', + }, + ), migrations.CreateModel( name='ExpedienteMateria', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('data_ordem', models.DateField(verbose_name='Data da Sessão')), - ('observacao', models.TextField(blank=True, null=True, verbose_name='Ementa')), - ('numero_ordem', models.IntegerField(verbose_name='Nº Ordem')), - ('resultado', models.TextField(blank=True, null=True)), - ('tipo_votacao', models.IntegerField(choices=[(1, 'Simbólica'), (2, 'Nominal'), (3, 'Secreta')], verbose_name='Tipo de votação')), - ('materia', models.ForeignKey(to='materia.MateriaLegislativa')), + ('observacao', models.TextField(blank=True, verbose_name='Ementa')), + ('numero_ordem', models.PositiveIntegerField(verbose_name='Nº Ordem')), + ('resultado', models.TextField(blank=True, verbose_name='Resultado')), + ('tipo_votacao', models.PositiveIntegerField(choices=[(1, 'Simbólica'), (2, 'Nominal'), (3, 'Secreta')], verbose_name='Tipo de votação')), + ('votacao_aberta', models.NullBooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Votação iniciada?')), + ('materia', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa', verbose_name='Matéria')), ], options={ - 'verbose_name_plural': 'Matérias do Expediente', + 'ordering': ['numero_ordem'], 'verbose_name': 'Matéria do Expediente', + 'verbose_name_plural': 'Matérias do Expediente', }, ), migrations.CreateModel( name='ExpedienteSessao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('conteudo', models.TextField(blank=True, null=True, verbose_name='Conteúdo do expediente')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('conteudo', models.TextField(blank=True, verbose_name='Conteúdo do expediente')), ], options={ - 'verbose_name_plural': 'Expedientes de Sessão Plenaria', 'verbose_name': 'Expediente de Sessão Plenaria', + 'verbose_name_plural': 'Expedientes de Sessão Plenaria', }, ), migrations.CreateModel( name='IntegranteMesa', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('cargo', models.ForeignKey(to='parlamentares.CargoMesa')), - ('parlamentar', models.ForeignKey(to='parlamentares.Parlamentar')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('cargo', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.CargoMesa')), + ('parlamentar', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar')), ], options={ - 'verbose_name_plural': 'Participações em Mesas de Sessão Plenaria', 'verbose_name': 'Participação em Mesa de Sessão Plenaria', + 'verbose_name_plural': 'Participações em Mesas de Sessão Plenaria', }, ), migrations.CreateModel( name='Orador', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('numero_ordem', models.IntegerField(verbose_name='Ordem de pronunciamento')), - ('url_discurso', models.CharField(blank=True, max_length=150, null=True, verbose_name='URL Vídeo')), - ('parlamentar', models.ForeignKey(to='parlamentares.Parlamentar', verbose_name='Parlamentar')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('numero_ordem', models.PositiveIntegerField(verbose_name='Ordem de pronunciamento')), + ('url_discurso', models.URLField(blank=True, max_length=150, verbose_name='URL Vídeo')), + ('observacao', models.CharField(blank=True, max_length=150, verbose_name='Observação')), + ('parlamentar', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar', verbose_name='Parlamentar')), ], options={ - 'verbose_name_plural': 'Oradores das Explicações Pessoais', 'verbose_name': 'Orador das Explicações Pessoais', + 'verbose_name_plural': 'Oradores das Explicações Pessoais', }, ), migrations.CreateModel( name='OradorExpediente', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('numero_ordem', models.IntegerField(verbose_name='Ordem de pronunciamento')), - ('url_discurso', models.CharField(blank=True, max_length=150, null=True, verbose_name='URL Vídeo')), - ('parlamentar', models.ForeignKey(to='parlamentares.Parlamentar', verbose_name='Parlamentar')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('numero_ordem', models.PositiveIntegerField(verbose_name='Ordem de pronunciamento')), + ('url_discurso', models.URLField(blank=True, max_length=150, verbose_name='URL Vídeo')), + ('observacao', models.CharField(blank=True, max_length=150, verbose_name='Observação')), + ('parlamentar', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar', verbose_name='Parlamentar')), ], options={ - 'verbose_name_plural': 'Oradores do Expediente', 'verbose_name': 'Orador do Expediente', + 'verbose_name_plural': 'Oradores do Expediente', }, ), migrations.CreateModel( name='OrdemDia', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('data_ordem', models.DateField(verbose_name='Data da Sessão')), - ('observacao', models.TextField(blank=True, null=True, verbose_name='Ementa')), - ('numero_ordem', models.IntegerField(verbose_name='Nº Ordem')), - ('resultado', models.TextField(blank=True, null=True)), - ('tipo_votacao', models.IntegerField(choices=[(1, 'Simbólica'), (2, 'Nominal'), (3, 'Secreta')], verbose_name='Tipo de votação')), - ('materia', models.ForeignKey(to='materia.MateriaLegislativa')), + ('observacao', models.TextField(blank=True, verbose_name='Ementa')), + ('numero_ordem', models.PositiveIntegerField(verbose_name='Nº Ordem')), + ('resultado', models.TextField(blank=True, verbose_name='Resultado')), + ('tipo_votacao', models.PositiveIntegerField(choices=[(1, 'Simbólica'), (2, 'Nominal'), (3, 'Secreta')], verbose_name='Tipo de votação')), + ('votacao_aberta', models.NullBooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Votação iniciada?')), + ('materia', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa', verbose_name='Matéria')), ], options={ - 'verbose_name_plural': 'Matérias da Ordem do Dia', + 'ordering': ['numero_ordem'], 'verbose_name': 'Matéria da Ordem do Dia', + 'verbose_name_plural': 'Matérias da Ordem do Dia', }, ), migrations.CreateModel( name='PresencaOrdemDia', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('data_ordem', models.DateField()), - ('parlamentar', models.ForeignKey(to='parlamentares.Parlamentar')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('parlamentar', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar')), ], options={ - 'verbose_name_plural': 'Presenças da Ordem do Dia', + 'ordering': ['parlamentar__nome_parlamentar'], 'verbose_name': 'Presença da Ordem do Dia', + 'verbose_name_plural': 'Presenças da Ordem do Dia', }, ), migrations.CreateModel( name='RegistroVotacao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('numero_votos_sim', models.IntegerField(verbose_name='Sim')), - ('numero_votos_nao', models.IntegerField(verbose_name='Não')), - ('numero_abstencoes', models.IntegerField(verbose_name='Abstenções')), - ('observacao', models.TextField(blank=True, null=True, verbose_name='Observações')), - ('materia', models.ForeignKey(to='materia.MateriaLegislativa')), - ('ordem', models.ForeignKey(to='sessao.OrdemDia')), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('numero_votos_sim', models.PositiveIntegerField(verbose_name='Sim')), + ('numero_votos_nao', models.PositiveIntegerField(verbose_name='Não')), + ('numero_abstencoes', models.PositiveIntegerField(verbose_name='Abstenções')), + ('observacao', models.TextField(blank=True, verbose_name='Observações')), + ('expediente', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='sessao.ExpedienteMateria')), + ('materia', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa')), + ('ordem', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='sessao.OrdemDia')), ], options={ - 'verbose_name_plural': 'Votações', 'verbose_name': 'Votação', + 'verbose_name_plural': 'Votações', }, ), migrations.CreateModel( name='SessaoPlenaria', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), - ('cod_andamento_sessao', models.IntegerField(blank=True, null=True)), - ('tipo_expediente', models.CharField(max_length=10)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('cod_andamento_sessao', models.PositiveIntegerField(blank=True, null=True)), ('data_inicio', models.DateField(verbose_name='Abertura')), - ('dia', models.CharField(max_length=15)), - ('hora_inicio', models.CharField(max_length=5, verbose_name='Horário')), - ('hora_fim', models.CharField(blank=True, max_length=5, null=True, verbose_name='Horário')), - ('numero', models.IntegerField(verbose_name='Número')), + ('hora_inicio', models.CharField(max_length=5, verbose_name='Horário (hh:mm)')), + ('hora_fim', models.CharField(blank=True, max_length=5, verbose_name='Horário (hh:mm)')), + ('numero', models.PositiveIntegerField(verbose_name='Número')), ('data_fim', models.DateField(blank=True, null=True, verbose_name='Encerramento')), - ('url_audio', models.CharField(blank=True, max_length=150, null=True, verbose_name='URL Arquivo Áudio (Formatos MP3 / AAC)')), - ('url_video', models.CharField(blank=True, max_length=150, null=True, verbose_name='URL Arquivo Vídeo (Formatos MP4 / FLV / WebM)')), - ('legislatura', models.ForeignKey(to='parlamentares.Legislatura', verbose_name='Legislatura')), - ('sessao_legislativa', models.ForeignKey(to='parlamentares.SessaoLegislativa', verbose_name='Sessão Legislativa')), + ('url_audio', models.URLField(blank=True, max_length=150, verbose_name='URL Arquivo Áudio (Formatos MP3 / AAC)')), + ('url_video', models.URLField(blank=True, max_length=150, verbose_name='URL Arquivo Vídeo (Formatos MP4 / FLV / WebM)')), + ('upload_pauta', models.FileField(blank=True, null=True, upload_to=sapl.sessao.models.pauta_upload_path, validators=[sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Pauta da Sessão')), + ('upload_ata', models.FileField(blank=True, null=True, upload_to=sapl.sessao.models.ata_upload_path, validators=[sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Ata da Sessão')), + ('upload_anexo', models.FileField(blank=True, null=True, upload_to=sapl.sessao.models.anexo_upload_path, verbose_name='Anexo da Sessão')), + ('iniciada', models.NullBooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Sessão iniciada?')), + ('finalizada', models.NullBooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Sessão finalizada?')), + ('legislatura', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura')), + ('sessao_legislativa', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.SessaoLegislativa', verbose_name='Sessão Legislativa')), ], options={ - 'verbose_name_plural': 'Sessões Plenárias', 'verbose_name': 'Sessão Plenária', + 'verbose_name_plural': 'Sessões Plenárias', }, ), migrations.CreateModel( name='SessaoPlenariaPresenca', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('data_sessao', models.DateField(blank=True, null=True)), - ('parlamentar', models.ForeignKey(to='parlamentares.Parlamentar')), - ('sessao_plen', models.ForeignKey(to='sessao.SessaoPlenaria')), + ('parlamentar', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar')), + ('sessao_plenaria', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria')), ], options={ - 'verbose_name_plural': 'Presenças em Sessões Plenárias', + 'ordering': ['parlamentar__nome_parlamentar'], 'verbose_name': 'Presença em Sessão Plenária', + 'verbose_name_plural': 'Presenças em Sessões Plenárias', }, ), migrations.CreateModel( name='TipoExpediente', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nome', models.CharField(max_length=100, verbose_name='Tipo')), ], options={ - 'verbose_name_plural': 'Tipos de Expediente', 'verbose_name': 'Tipo de Expediente', + 'verbose_name_plural': 'Tipos de Expediente', }, ), migrations.CreateModel( name='TipoResultadoVotacao', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nome', models.CharField(max_length=100, verbose_name='Tipo')), ], options={ - 'verbose_name_plural': 'Tipos de Resultado de Votação', 'verbose_name': 'Tipo de Resultado de Votação', + 'verbose_name_plural': 'Tipos de Resultado de Votação', }, ), migrations.CreateModel( name='TipoSessaoPlenaria', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('nome', models.CharField(max_length=30, verbose_name='Tipo')), - ('quorum_minimo', models.IntegerField(verbose_name='Quórum mínimo')), + ('quorum_minimo', models.PositiveIntegerField(verbose_name='Quórum mínimo')), ], options={ - 'verbose_name_plural': 'Tipos de Sessão Plenária', 'verbose_name': 'Tipo de Sessão Plenária', + 'verbose_name_plural': 'Tipos de Sessão Plenária', + }, + ), + migrations.CreateModel( + name='VotoNominal', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('voto', models.CharField(max_length=10, verbose_name='Voto')), + ('ip', models.CharField(max_length=30, verbose_name='IP')), + ('data_hora', models.DateTimeField(auto_now_add=True, verbose_name='Data/Hora')), + ('materia', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa')), + ('parlamentar', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar')), + ('sessao', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'Registro do Voto do Parlamentar', + 'verbose_name_plural': 'Registros dos Votos dos Parlamentares', }, ), migrations.CreateModel( name='VotoParlamentar', fields=[ - ('id', models.AutoField(primary_key=True, verbose_name='ID', auto_created=True, serialize=False)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('voto', models.CharField(max_length=10)), - ('parlamentar', models.ForeignKey(to='parlamentares.Parlamentar')), - ('votacao', models.ForeignKey(to='sessao.RegistroVotacao')), + ('parlamentar', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar')), + ('votacao', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.RegistroVotacao')), ], options={ - 'verbose_name_plural': 'Registros de Votações de Parlamentares', 'verbose_name': 'Registro de Votação de Parlamentar', + 'verbose_name_plural': 'Registros de Votações de Parlamentares', }, ), migrations.AddField( model_name='sessaoplenaria', name='tipo', - field=models.ForeignKey(to='sessao.TipoSessaoPlenaria', verbose_name='Tipo'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.TipoSessaoPlenaria', verbose_name='Tipo'), ), migrations.AddField( model_name='registrovotacao', name='tipo_resultado_votacao', - field=models.ForeignKey(to='sessao.TipoResultadoVotacao', verbose_name='Resultado da Votação'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.TipoResultadoVotacao', verbose_name='Resultado da Votação'), ), migrations.AddField( model_name='presencaordemdia', name='sessao_plenaria', - field=models.ForeignKey(to='sessao.SessaoPlenaria'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), ), migrations.AddField( model_name='ordemdia', name='sessao_plenaria', - field=models.ForeignKey(to='sessao.SessaoPlenaria'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), ), migrations.AddField( model_name='oradorexpediente', name='sessao_plenaria', - field=models.ForeignKey(to='sessao.SessaoPlenaria'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), ), migrations.AddField( model_name='orador', name='sessao_plenaria', - field=models.ForeignKey(to='sessao.SessaoPlenaria'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), ), migrations.AddField( model_name='integrantemesa', name='sessao_plenaria', - field=models.ForeignKey(to='sessao.SessaoPlenaria'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), ), migrations.AddField( model_name='expedientesessao', name='sessao_plenaria', - field=models.ForeignKey(to='sessao.SessaoPlenaria'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), ), migrations.AddField( model_name='expedientesessao', name='tipo', - field=models.ForeignKey(to='sessao.TipoExpediente'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.TipoExpediente'), ), migrations.AddField( model_name='expedientemateria', name='sessao_plenaria', - field=models.ForeignKey(to='sessao.SessaoPlenaria'), + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), ), ] diff --git a/sapl/sessao/migrations/0002_auto_20150729_1450.py b/sapl/sessao/migrations/0002_auto_20150729_1450.py deleted file mode 100644 index 6212c5f3f..000000000 --- a/sapl/sessao/migrations/0002_auto_20150729_1450.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0001_initial'), - ] - - operations = [ - migrations.RemoveField( - model_name='sessaoplenaria', - name='dia', - ), - migrations.AddField( - model_name='sessaoplenaria', - name='finalizada', - field=models.NullBooleanField(verbose_name='Sessão finalizada?', choices=[(True, 'Sim'), (False, 'Não')]), - ), - migrations.AddField( - model_name='sessaoplenaria', - name='iniciada', - field=models.NullBooleanField(verbose_name='Sessão iniciada?', choices=[(True, 'Sim'), (False, 'Não')]), - ), - migrations.AddField( - model_name='sessaoplenaria', - name='upload_ata', - field=models.FileField(verbose_name='Ata da Sessão', null=True, upload_to='', blank=True), - ), - migrations.AddField( - model_name='sessaoplenaria', - name='upload_pauta', - field=models.FileField(verbose_name='Pauta da Sessão', null=True, upload_to='', blank=True), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='hora_fim', - field=models.CharField(verbose_name='Horário (hh:mm)', null=True, max_length=5, blank=True), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='hora_inicio', - field=models.CharField(verbose_name='Horário (hh:mm)', max_length=5), - ), - ] diff --git a/sapl/sessao/migrations/0003_remove_sessaoplenaria_tipo_expediente.py b/sapl/sessao/migrations/0003_remove_sessaoplenaria_tipo_expediente.py deleted file mode 100644 index 71e92b3d2..000000000 --- a/sapl/sessao/migrations/0003_remove_sessaoplenaria_tipo_expediente.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0002_auto_20150729_1450'), - ] - - operations = [ - migrations.RemoveField( - model_name='sessaoplenaria', - name='tipo_expediente', - ), - ] diff --git a/sapl/sessao/migrations/0004_auto_20150806_1614.py b/sapl/sessao/migrations/0004_auto_20150806_1614.py deleted file mode 100644 index 7785125c8..000000000 --- a/sapl/sessao/migrations/0004_auto_20150806_1614.py +++ /dev/null @@ -1,92 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - -import sapl.sessao.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0003_remove_sessaoplenaria_tipo_expediente'), - ] - - operations = [ - migrations.AlterField( - model_name='expedientemateria', - name='numero_ordem', - field=models.PositiveIntegerField(verbose_name='Nº Ordem'), - ), - migrations.AlterField( - model_name='expedientemateria', - name='tipo_votacao', - field=models.PositiveIntegerField(choices=[( - 1, 'Simbólica'), (2, 'Nominal'), (3, 'Secreta')], verbose_name='Tipo de votação'), - ), - migrations.AlterField( - model_name='orador', - name='numero_ordem', - field=models.PositiveIntegerField( - verbose_name='Ordem de pronunciamento'), - ), - migrations.AlterField( - model_name='oradorexpediente', - name='numero_ordem', - field=models.PositiveIntegerField( - verbose_name='Ordem de pronunciamento'), - ), - migrations.AlterField( - model_name='ordemdia', - name='numero_ordem', - field=models.PositiveIntegerField(verbose_name='Nº Ordem'), - ), - migrations.AlterField( - model_name='ordemdia', - name='tipo_votacao', - field=models.PositiveIntegerField(choices=[( - 1, 'Simbólica'), (2, 'Nominal'), (3, 'Secreta')], verbose_name='Tipo de votação'), - ), - migrations.AlterField( - model_name='registrovotacao', - name='numero_abstencoes', - field=models.PositiveIntegerField(verbose_name='Abstenções'), - ), - migrations.AlterField( - model_name='registrovotacao', - name='numero_votos_nao', - field=models.PositiveIntegerField(verbose_name='Não'), - ), - migrations.AlterField( - model_name='registrovotacao', - name='numero_votos_sim', - field=models.PositiveIntegerField(verbose_name='Sim'), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='cod_andamento_sessao', - field=models.PositiveIntegerField(blank=True, null=True), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='numero', - field=models.PositiveIntegerField(verbose_name='Número'), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='upload_ata', - field=models.FileField( - blank=True, upload_to=sapl.sessao.models.ata_upload_path, null=True, verbose_name='Ata da Sessão'), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='upload_pauta', - field=models.FileField( - blank=True, upload_to=sapl.sessao.models.pauta_upload_path, null=True, verbose_name='Pauta da Sessão'), - ), - migrations.AlterField( - model_name='tiposessaoplenaria', - name='quorum_minimo', - field=models.PositiveIntegerField(verbose_name='Quórum mínimo'), - ), - ] diff --git a/sapl/sessao/migrations/0005_remove_presencaordemdia_data_ordem.py b/sapl/sessao/migrations/0005_remove_presencaordemdia_data_ordem.py deleted file mode 100644 index 8d73c542e..000000000 --- a/sapl/sessao/migrations/0005_remove_presencaordemdia_data_ordem.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0004_auto_20150806_1614'), - ] - - operations = [ - migrations.RemoveField( - model_name='presencaordemdia', - name='data_ordem', - ), - ] diff --git a/sapl/sessao/migrations/0006_auto_20150929_1425.py b/sapl/sessao/migrations/0006_auto_20150929_1425.py deleted file mode 100644 index 4b438a29f..000000000 --- a/sapl/sessao/migrations/0006_auto_20150929_1425.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0005_remove_presencaordemdia_data_ordem'), - ] - - operations = [ - migrations.AlterModelOptions( - name='expedientemateria', - options={'ordering': ['numero_ordem'], 'verbose_name': 'Matéria do Expediente', 'verbose_name_plural': 'Matérias do Expediente'}, - ), - migrations.AlterModelOptions( - name='ordemdia', - options={'ordering': ['numero_ordem'], 'verbose_name': 'Matéria da Ordem do Dia', 'verbose_name_plural': 'Matérias da Ordem do Dia'}, - ), - migrations.AlterModelOptions( - name='presencaordemdia', - options={'ordering': ['parlamentar__nome_parlamentar'], 'verbose_name': 'Presença da Ordem do Dia', 'verbose_name_plural': 'Presenças da Ordem do Dia'}, - ), - migrations.AlterModelOptions( - name='sessaoplenariapresenca', - options={'ordering': ['parlamentar__nome_parlamentar'], 'verbose_name': 'Presença em Sessão Plenária', 'verbose_name_plural': 'Presenças em Sessões Plenárias'}, - ), - ] diff --git a/sapl/sessao/migrations/0007_auto_20150929_1426.py b/sapl/sessao/migrations/0007_auto_20150929_1426.py deleted file mode 100644 index d97091ecb..000000000 --- a/sapl/sessao/migrations/0007_auto_20150929_1426.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0006_auto_20150929_1425'), - ] - - operations = [ - migrations.RenameField( - model_name='sessaoplenariapresenca', - old_name='sessao_plen', - new_name='sessao_plenaria', - ), - ] diff --git a/sapl/sessao/migrations/0008_auto_20151005_0814.py b/sapl/sessao/migrations/0008_auto_20151005_0814.py deleted file mode 100644 index 95cc5532a..000000000 --- a/sapl/sessao/migrations/0008_auto_20151005_0814.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0007_auto_20150929_1426'), - ] - - operations = [ - migrations.AddField( - model_name='expedientemateria', - name='votacao_iniciada', - field=models.NullBooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Votação iniciada?'), - ), - migrations.AddField( - model_name='ordemdia', - name='votacao_iniciada', - field=models.NullBooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Votação iniciada?'), - ), - ] diff --git a/sapl/sessao/migrations/0009_auto_20151005_0934.py b/sapl/sessao/migrations/0009_auto_20151005_0934.py deleted file mode 100644 index b4d6819d6..000000000 --- a/sapl/sessao/migrations/0009_auto_20151005_0934.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0008_auto_20151005_0814'), - ] - - operations = [ - migrations.RenameField( - model_name='expedientemateria', - old_name='votacao_iniciada', - new_name='votacao_aberta', - ), - migrations.RenameField( - model_name='ordemdia', - old_name='votacao_iniciada', - new_name='votacao_aberta', - ), - ] diff --git a/sapl/sessao/migrations/0010_acompanharmateria.py b/sapl/sessao/migrations/0010_acompanharmateria.py deleted file mode 100644 index 30e03f620..000000000 --- a/sapl/sessao/migrations/0010_acompanharmateria.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations -from django.conf import settings - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0013_remove_tramitacao_ultima'), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('sessao', '0009_auto_20151005_0934'), - ] - - operations = [ - migrations.CreateModel( - name='AcompanharMateria', - fields=[ - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)), - ('email', models.CharField(verbose_name='Endereço de email', max_length=50)), - ('data_cadastro', models.DateField(auto_now_add=True)), - ('materia_cadastrada', models.ForeignKey(to='materia.MateriaLegislativa')), - ('usuario', models.ForeignKey(to=settings.AUTH_USER_MODEL)), - ], - ), - ] diff --git a/sapl/sessao/migrations/0011_auto_20160113_1239.py b/sapl/sessao/migrations/0011_auto_20160113_1239.py deleted file mode 100644 index b740ae875..000000000 --- a/sapl/sessao/migrations/0011_auto_20160113_1239.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0010_acompanharmateria'), - ] - - operations = [ - migrations.AlterField( - model_name='acompanharmateria', - name='usuario', - field=models.CharField(max_length=50), - ), - ] diff --git a/sapl/sessao/migrations/0012_auto_20160120_1237.py b/sapl/sessao/migrations/0012_auto_20160120_1237.py deleted file mode 100644 index a72740276..000000000 --- a/sapl/sessao/migrations/0012_auto_20160120_1237.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0011_auto_20160113_1239'), - ] - - operations = [ - migrations.AddField( - model_name='registrovotacao', - name='expediente', - field=models.ForeignKey(blank=True, null=True, to='sessao.ExpedienteMateria'), - ), - migrations.AlterField( - model_name='registrovotacao', - name='ordem', - field=models.ForeignKey(blank=True, null=True, to='sessao.OrdemDia'), - ), - ] diff --git a/sapl/sessao/migrations/0013_auto_20160216_1015.py b/sapl/sessao/migrations/0013_auto_20160216_1015.py deleted file mode 100644 index 60d75bc31..000000000 --- a/sapl/sessao/migrations/0013_auto_20160216_1015.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0012_auto_20160120_1237'), - ] - - operations = [ - migrations.AlterField( - model_name='expedientemateria', - name='observacao', - field=models.TextField(verbose_name='Ementa', blank=True), - ), - migrations.AlterField( - model_name='expedientemateria', - name='resultado', - field=models.TextField(blank=True), - ), - migrations.AlterField( - model_name='expedientesessao', - name='conteudo', - field=models.TextField(verbose_name='Conteúdo do expediente', blank=True), - ), - migrations.AlterField( - model_name='orador', - name='url_discurso', - field=models.CharField(verbose_name='URL Vídeo', max_length=150, blank=True), - ), - migrations.AlterField( - model_name='oradorexpediente', - name='url_discurso', - field=models.CharField(verbose_name='URL Vídeo', max_length=150, blank=True), - ), - migrations.AlterField( - model_name='ordemdia', - name='observacao', - field=models.TextField(verbose_name='Ementa', blank=True), - ), - migrations.AlterField( - model_name='ordemdia', - name='resultado', - field=models.TextField(blank=True), - ), - migrations.AlterField( - model_name='registrovotacao', - name='observacao', - field=models.TextField(verbose_name='Observações', blank=True), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='hora_fim', - field=models.CharField(verbose_name='Horário (hh:mm)', max_length=5, blank=True), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='url_audio', - field=models.CharField(verbose_name='URL Arquivo Áudio (Formatos MP3 / AAC)', max_length=150, blank=True), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='url_video', - field=models.CharField(verbose_name='URL Arquivo Vídeo (Formatos MP4 / FLV / WebM)', max_length=150, blank=True), - ), - ] diff --git a/sapl/sessao/migrations/0014_auto_20160223_0813.py b/sapl/sessao/migrations/0014_auto_20160223_0813.py deleted file mode 100644 index fa1fc08f2..000000000 --- a/sapl/sessao/migrations/0014_auto_20160223_0813.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0013_auto_20160216_1015'), - ] - - operations = [ - migrations.RemoveField( - model_name='acompanharmateria', - name='materia_cadastrada', - ), - migrations.DeleteModel( - name='AcompanharMateria', - ), - ] diff --git a/sapl/sessao/migrations/0015_auto_20160307_0918.py b/sapl/sessao/migrations/0015_auto_20160307_0918.py deleted file mode 100644 index adc382bc7..000000000 --- a/sapl/sessao/migrations/0015_auto_20160307_0918.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-03-07 12:18 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0014_auto_20160223_0813'), - ] - - operations = [ - migrations.AlterField( - model_name='orador', - name='url_discurso', - field=models.URLField(blank=True, max_length=150, verbose_name='URL Vídeo'), - ), - migrations.AlterField( - model_name='oradorexpediente', - name='url_discurso', - field=models.URLField(blank=True, max_length=150, verbose_name='URL Vídeo'), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='url_audio', - field=models.URLField(blank=True, max_length=150, verbose_name='URL Arquivo Áudio (Formatos MP3 / AAC)'), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='url_video', - field=models.URLField(blank=True, max_length=150, verbose_name='URL Arquivo Vídeo (Formatos MP4 / FLV / WebM)'), - ), - ] diff --git a/sapl/sessao/migrations/0016_auto_20160404_1409.py b/sapl/sessao/migrations/0016_auto_20160404_1409.py deleted file mode 100644 index 88aa6a954..000000000 --- a/sapl/sessao/migrations/0016_auto_20160404_1409.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9 on 2016-04-04 17:09 -from __future__ import unicode_literals - -from django.db import migrations, models - -import sapl.sessao.models -import sapl.utils - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0015_auto_20160307_0918'), - ] - - operations = [ - migrations.AlterField( - model_name='sessaoplenaria', - name='upload_ata', - field=models.FileField(blank=True, null=True, upload_to=sapl.sessao.models.ata_upload_path, validators=[ - sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Ata da Sessão'), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='upload_pauta', - field=models.FileField(blank=True, null=True, upload_to=sapl.sessao.models.pauta_upload_path, validators=[ - sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Pauta da Sessão'), - ), - ] diff --git a/sapl/sessao/migrations/0017_bancada.py b/sapl/sessao/migrations/0017_bancada.py deleted file mode 100644 index 25770a220..000000000 --- a/sapl/sessao/migrations/0017_bancada.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-17 17:26 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0018_auto_20160510_0943'), - ('sessao', '0016_auto_20160404_1409'), - ] - - operations = [ - migrations.CreateModel( - name='Bancada', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('nome', models.CharField(max_length=80, verbose_name='Nome da Bancada, Bloco, Frente ou Grupo')), - ('data_criacao', models.DateField(blank=True, verbose_name='Data Criação')), - ('data_extincao', models.DateField(blank=True, verbose_name='Data Extinção')), - ('descricao', models.TextField(blank=True, verbose_name='Descrição')), - ('legislatura', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='parlamentares.Legislatura', verbose_name='Legislatura')), - ('partido', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='parlamentares.Partido', verbose_name='Partido')), - ], - options={ - 'verbose_name_plural': 'Bancadas', - 'verbose_name': 'Bancada', - }, - ), - ] diff --git a/sapl/sessao/migrations/0018_auto_20160517_1435.py b/sapl/sessao/migrations/0018_auto_20160517_1435.py deleted file mode 100644 index 849ccad31..000000000 --- a/sapl/sessao/migrations/0018_auto_20160517_1435.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-17 17:35 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0017_bancada'), - ] - - operations = [ - migrations.AlterField( - model_name='bancada', - name='data_criacao', - field=models.DateField(blank=True, null=True, verbose_name='Data Criação'), - ), - migrations.AlterField( - model_name='bancada', - name='data_extincao', - field=models.DateField(blank=True, null=True, verbose_name='Data Extinção'), - ), - migrations.AlterField( - model_name='bancada', - name='partido', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='parlamentares.Partido', verbose_name='Partido'), - ), - ] diff --git a/sapl/sessao/migrations/0019_cargobancada.py b/sapl/sessao/migrations/0019_cargobancada.py deleted file mode 100644 index 44a4db58a..000000000 --- a/sapl/sessao/migrations/0019_cargobancada.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-17 17:42 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0018_auto_20160517_1435'), - ] - - operations = [ - migrations.CreateModel( - name='CargoBancada', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('nome_cargo', models.CharField(max_length=80, verbose_name='Cargo de Bancada')), - ('cargo_unico', models.NullBooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Cargo Único')), - ], - options={ - 'verbose_name_plural': 'Cargos de Bancada', - 'verbose_name': 'Cargo de Bancada', - }, - ), - ] diff --git a/sapl/sessao/migrations/0020_auto_20160517_1450.py b/sapl/sessao/migrations/0020_auto_20160517_1450.py deleted file mode 100644 index 85004c22f..000000000 --- a/sapl/sessao/migrations/0020_auto_20160517_1450.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.5 on 2016-05-17 17:50 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0019_cargobancada'), - ] - - operations = [ - migrations.AlterField( - model_name='cargobancada', - name='cargo_unico', - field=models.CharField(choices=[(True, 'Sim'), (False, 'Não')], default=False, max_length=10, verbose_name='Cargo Único'), - ), - ] diff --git a/sapl/sessao/migrations/0021_adicionamultiplasmaterias.py b/sapl/sessao/migrations/0021_adicionamultiplasmaterias.py deleted file mode 100644 index 7eb3dbd48..000000000 --- a/sapl/sessao/migrations/0021_adicionamultiplasmaterias.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-08-03 14:27 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('materia', '0038_auto_20160612_1506'), - ('sessao', '0020_auto_20160517_1450'), - ] - - operations = [ - migrations.CreateModel( - name='AdicionaMultiplasMaterias', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('materia', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='materia.MateriaLegislativa')), - ], - options={ - 'verbose_name_plural': 'Tabela de Adicionar Várias Matérias', - 'verbose_name': 'Tabela de Adicionar Várias Matérias', - }, - ), - ] diff --git a/sapl/sessao/migrations/0022_auto_20160805_0943.py b/sapl/sessao/migrations/0022_auto_20160805_0943.py deleted file mode 100644 index 51acbf4ef..000000000 --- a/sapl/sessao/migrations/0022_auto_20160805_0943.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-08-05 12:43 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0021_adicionamultiplasmaterias'), - ] - - operations = [ - migrations.RemoveField( - model_name='adicionamultiplasmaterias', - name='materia', - ), - migrations.DeleteModel( - name='AdicionaMultiplasMaterias', - ), - ] diff --git a/sapl/sessao/migrations/0023_auto_20160915_1405.py b/sapl/sessao/migrations/0023_auto_20160915_1405.py deleted file mode 100644 index 10a1a0511..000000000 --- a/sapl/sessao/migrations/0023_auto_20160915_1405.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-15 17:05 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0022_auto_20160805_0943'), - ] - - operations = [ - migrations.AlterField( - model_name='bancada', - name='nome', - field=models.CharField(max_length=80, verbose_name='Nome da Bancada, Bloco, ou Frente'), - ), - ] diff --git a/sapl/sessao/migrations/0024_bloco.py b/sapl/sessao/migrations/0024_bloco.py deleted file mode 100644 index 5af326429..000000000 --- a/sapl/sessao/migrations/0024_bloco.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-19 12:03 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0023_auto_20160915_1405'), - ] - - operations = [ - migrations.CreateModel( - name='Bloco', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('nome', models.CharField(max_length=80, verbose_name='Nome do Bloco')), - ('data_criacao', models.DateField(blank=True, null=True, verbose_name='Data Criação')), - ('data_extincao', models.DateField(blank=True, null=True, verbose_name='Data Dissolução')), - ('descricao', models.TextField(blank=True, verbose_name='Descrição')), - ('bancadas', models.ManyToManyField(blank=True, to='sessao.Bancada', verbose_name='Bancadas')), - ], - options={ - 'verbose_name_plural': 'Blocos', - 'verbose_name': 'Bloco', - }, - ), - ] diff --git a/sapl/sessao/migrations/0025_auto_20160919_1503.py b/sapl/sessao/migrations/0025_auto_20160919_1503.py deleted file mode 100644 index fe7060645..000000000 --- a/sapl/sessao/migrations/0025_auto_20160919_1503.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-19 18:03 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('parlamentares', '0027_merge'), - ('sessao', '0024_bloco'), - ] - - operations = [ - migrations.RemoveField( - model_name='bloco', - name='bancadas', - ), - migrations.AddField( - model_name='bloco', - name='partidos', - field=models.ManyToManyField(blank=True, to='parlamentares.Partido', verbose_name='Bancadas'), - ), - ] diff --git a/sapl/sessao/migrations/0026_auto_20160926_1445.py b/sapl/sessao/migrations/0026_auto_20160926_1445.py deleted file mode 100644 index 6380bb8df..000000000 --- a/sapl/sessao/migrations/0026_auto_20160926_1445.py +++ /dev/null @@ -1,36 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-09-26 17:45 -from __future__ import unicode_literals - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0025_auto_20160919_1503'), - ] - - operations = [ - migrations.AlterField( - model_name='expedientemateria', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='materia.MateriaLegislativa', verbose_name='Matéria'), - ), - migrations.AlterField( - model_name='expedientemateria', - name='resultado', - field=models.TextField(blank=True, verbose_name='Resultado'), - ), - migrations.AlterField( - model_name='ordemdia', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='materia.MateriaLegislativa', verbose_name='Matéria'), - ), - migrations.AlterField( - model_name='ordemdia', - name='resultado', - field=models.TextField(blank=True, verbose_name='Resultado'), - ), - ] diff --git a/sapl/sessao/migrations/0027_auto_20161003_0417.py b/sapl/sessao/migrations/0027_auto_20161003_0417.py deleted file mode 100644 index 324cd919c..000000000 --- a/sapl/sessao/migrations/0027_auto_20161003_0417.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-03 07:17 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0026_auto_20160926_1445'), - ] - - operations = [ - migrations.AlterModelOptions( - name='bancada', - options={'ordering': ('-legislatura__numero',), 'verbose_name': 'Bancada', 'verbose_name_plural': 'Bancadas'}, - ), - ] diff --git a/sapl/sessao/migrations/0028_auto_20161004_0927.py b/sapl/sessao/migrations/0028_auto_20161004_0927.py deleted file mode 100644 index cd8f78f2f..000000000 --- a/sapl/sessao/migrations/0028_auto_20161004_0927.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-04 12:27 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0027_auto_20161003_0417'), - ] - - operations = [ - migrations.AlterField( - model_name='orador', - name='url_discurso', - field=models.CharField(blank=True, max_length=150, verbose_name='URL Vídeo ou Observação'), - ), - migrations.AlterField( - model_name='oradorexpediente', - name='url_discurso', - field=models.CharField(blank=True, max_length=150, verbose_name='URL Vídeo ou Observação'), - ), - ] diff --git a/sapl/sessao/migrations/0029_auto_20161004_1101.py b/sapl/sessao/migrations/0029_auto_20161004_1101.py deleted file mode 100644 index 070ef640c..000000000 --- a/sapl/sessao/migrations/0029_auto_20161004_1101.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-10-04 14:01 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0028_auto_20161004_0927'), - ] - - operations = [ - migrations.AddField( - model_name='orador', - name='observacao', - field=models.CharField(blank=True, max_length=150, verbose_name='Observação'), - ), - migrations.AddField( - model_name='oradorexpediente', - name='observacao', - field=models.CharField(blank=True, max_length=150, verbose_name='Observação'), - ), - migrations.AlterField( - model_name='orador', - name='url_discurso', - field=models.URLField(blank=True, max_length=150, verbose_name='URL Vídeo'), - ), - migrations.AlterField( - model_name='oradorexpediente', - name='url_discurso', - field=models.URLField(blank=True, max_length=150, verbose_name='URL Vídeo'), - ), - ] diff --git a/sapl/sessao/migrations/0030_auto_20161215_1652.py b/sapl/sessao/migrations/0030_auto_20161215_1652.py deleted file mode 100644 index a804fa820..000000000 --- a/sapl/sessao/migrations/0030_auto_20161215_1652.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-12-15 16:52 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0029_auto_20161004_1101'), - ] - - operations = [ - migrations.AlterField( - model_name='bancada', - name='nome', - field=models.CharField(max_length=80, verbose_name='Nome da Bancada'), - ), - ] diff --git a/sapl/sessao/migrations/0030_auto_20161216_1640.py b/sapl/sessao/migrations/0030_auto_20161216_1640.py deleted file mode 100644 index 0ae52641f..000000000 --- a/sapl/sessao/migrations/0030_auto_20161216_1640.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.12 on 2016-12-16 16:40 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0029_auto_20161004_1101'), - ] - - operations = [ - migrations.AlterField( - model_name='bancada', - name='nome', - field=models.CharField(max_length=80, verbose_name='Nome da Bancada'), - ), - ] diff --git a/sapl/sessao/migrations/0031_auto_20170102_0951.py b/sapl/sessao/migrations/0031_auto_20170102_0951.py deleted file mode 100644 index c3853373c..000000000 --- a/sapl/sessao/migrations/0031_auto_20170102_0951.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-01-02 09:51 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0030_auto_20161216_1640'), - ] - - operations = [ - migrations.AlterField( - model_name='cargobancada', - name='cargo_unico', - field=models.NullBooleanField(choices=[(True, 'Sim'), (False, 'Não')], verbose_name='Cargo Único ?'), - ), - ] diff --git a/sapl/sessao/migrations/0031_merge.py b/sapl/sessao/migrations/0031_merge.py deleted file mode 100644 index 409f8be4d..000000000 --- a/sapl/sessao/migrations/0031_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-12-19 13:06 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0030_auto_20161216_1640'), - ('sessao', '0030_auto_20161215_1652'), - ] - - operations = [ - ] diff --git a/sapl/sessao/migrations/0032_auto_20170102_0953.py b/sapl/sessao/migrations/0032_auto_20170102_0953.py deleted file mode 100644 index 7bb56bafa..000000000 --- a/sapl/sessao/migrations/0032_auto_20170102_0953.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-01-02 09:53 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0031_auto_20170102_0951'), - ] - - operations = [ - migrations.AlterField( - model_name='cargobancada', - name='cargo_unico', - field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Cargo Único ?'), - ), - ] diff --git a/sapl/sessao/migrations/0032_sessaoplenaria_upload_anexo.py b/sapl/sessao/migrations/0032_sessaoplenaria_upload_anexo.py deleted file mode 100644 index 9a846f587..000000000 --- a/sapl/sessao/migrations/0032_sessaoplenaria_upload_anexo.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2016-12-28 09:53 -from __future__ import unicode_literals - -from django.db import migrations, models -import sapl.sessao.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0031_merge'), - ] - - operations = [ - migrations.AddField( - model_name='sessaoplenaria', - name='upload_anexo', - field=models.FileField(blank=True, null=True, upload_to=sapl.sessao.models.anexo_upload_path, verbose_name='Anexo da Sessão'), - ), - ] diff --git a/sapl/sessao/migrations/0033_merge.py b/sapl/sessao/migrations/0033_merge.py deleted file mode 100644 index af3bd0492..000000000 --- a/sapl/sessao/migrations/0033_merge.py +++ /dev/null @@ -1,16 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.11 on 2017-01-10 15:32 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0032_sessaoplenaria_upload_anexo'), - ('sessao', '0032_auto_20170102_0953'), - ] - - operations = [ - ] diff --git a/sapl/sessao/migrations/0034_votonominal.py b/sapl/sessao/migrations/0034_votonominal.py deleted file mode 100644 index 37ab664c7..000000000 --- a/sapl/sessao/migrations/0034_votonominal.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-02-13 14:37 -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 = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('materia', '0075_auto_20170203_1019'), - ('parlamentares', '0039_remove_votante_ip'), - ('sessao', '0033_merge'), - ] - - operations = [ - migrations.CreateModel( - name='VotoNominal', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('voto', models.CharField(max_length=10, verbose_name='Voto')), - ('ip', models.CharField(max_length=30, verbose_name='IP')), - ('data_hora', models.DateTimeField(auto_now_add=True, verbose_name='Data/Hora')), - ('expediente', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='sessao.ExpedienteMateria')), - ('materia', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='materia.MateriaLegislativa')), - ('ordem', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='sessao.OrdemDia')), - ('parlamentar', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='parlamentares.Parlamentar')), - ('sessao', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sessao.SessaoPlenaria')), - ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), - ], - options={ - 'verbose_name': 'Registro do Voto do Parlamentar', - 'verbose_name_plural': 'Registros dos Votos dos Parlamentares', - }, - ), - ] diff --git a/sapl/sessao/migrations/0035_auto_20170213_1455.py b/sapl/sessao/migrations/0035_auto_20170213_1455.py deleted file mode 100644 index 391c293b0..000000000 --- a/sapl/sessao/migrations/0035_auto_20170213_1455.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.7 on 2017-02-13 14:55 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('sessao', '0034_votonominal'), - ] - - operations = [ - migrations.RemoveField( - model_name='votonominal', - name='expediente', - ), - migrations.RemoveField( - model_name='votonominal', - name='ordem', - ), - ] diff --git a/sapl/sessao/migrations/0036_auto_20170325_1052.py b/sapl/sessao/migrations/0036_auto_20170325_1052.py deleted file mode 100644 index 8fb9eb40d..000000000 --- a/sapl/sessao/migrations/0036_auto_20170325_1052.py +++ /dev/null @@ -1,177 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.12 on 2017-03-25 10:52 -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 = [ - ('sessao', '0035_auto_20170213_1455'), - ] - - operations = [ - migrations.AlterField( - model_name='bancada', - name='legislatura', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura'), - ), - migrations.AlterField( - model_name='bancada', - name='partido', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Partido', verbose_name='Partido'), - ), - migrations.AlterField( - model_name='expedientemateria', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa', verbose_name='Matéria'), - ), - migrations.AlterField( - model_name='expedientemateria', - name='sessao_plenaria', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), - ), - migrations.AlterField( - model_name='expedientesessao', - name='sessao_plenaria', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), - ), - migrations.AlterField( - model_name='expedientesessao', - name='tipo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.TipoExpediente'), - ), - migrations.AlterField( - model_name='integrantemesa', - name='cargo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.CargoMesa'), - ), - migrations.AlterField( - model_name='integrantemesa', - name='parlamentar', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), - ), - migrations.AlterField( - model_name='integrantemesa', - name='sessao_plenaria', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), - ), - migrations.AlterField( - model_name='orador', - name='parlamentar', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar', verbose_name='Parlamentar'), - ), - migrations.AlterField( - model_name='orador', - name='sessao_plenaria', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), - ), - migrations.AlterField( - model_name='oradorexpediente', - name='parlamentar', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar', verbose_name='Parlamentar'), - ), - migrations.AlterField( - model_name='oradorexpediente', - name='sessao_plenaria', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), - ), - migrations.AlterField( - model_name='ordemdia', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa', verbose_name='Matéria'), - ), - migrations.AlterField( - model_name='ordemdia', - name='sessao_plenaria', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), - ), - migrations.AlterField( - model_name='presencaordemdia', - name='parlamentar', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), - ), - migrations.AlterField( - model_name='presencaordemdia', - name='sessao_plenaria', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), - ), - migrations.AlterField( - model_name='registrovotacao', - name='expediente', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='sessao.ExpedienteMateria'), - ), - migrations.AlterField( - model_name='registrovotacao', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='registrovotacao', - name='ordem', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='sessao.OrdemDia'), - ), - migrations.AlterField( - model_name='registrovotacao', - name='tipo_resultado_votacao', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.TipoResultadoVotacao', verbose_name='Resultado da Votação'), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='legislatura', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Legislatura', verbose_name='Legislatura'), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='sessao_legislativa', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.SessaoLegislativa', verbose_name='Sessão Legislativa'), - ), - migrations.AlterField( - model_name='sessaoplenaria', - name='tipo', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.TipoSessaoPlenaria', verbose_name='Tipo'), - ), - migrations.AlterField( - model_name='sessaoplenariapresenca', - name='parlamentar', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), - ), - migrations.AlterField( - model_name='sessaoplenariapresenca', - name='sessao_plenaria', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), - ), - migrations.AlterField( - model_name='votonominal', - name='materia', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa'), - ), - migrations.AlterField( - model_name='votonominal', - name='parlamentar', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), - ), - migrations.AlterField( - model_name='votonominal', - name='sessao', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.SessaoPlenaria'), - ), - migrations.AlterField( - model_name='votonominal', - name='user', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), - ), - migrations.AlterField( - model_name='votoparlamentar', - name='parlamentar', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Parlamentar'), - ), - migrations.AlterField( - model_name='votoparlamentar', - name='votacao', - field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='sessao.RegistroVotacao'), - ), - ] From 5b5cf7424c027e2d6f7ba429203da944e3a7e95a Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Thu, 16 Mar 2017 16:42:43 -0300 Subject: [PATCH 014/140] Simplifica upload_to da logo da CasaLegislativa --- sapl/base/migrations/0001_initial.py | 2 +- sapl/base/models.py | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/sapl/base/migrations/0001_initial.py b/sapl/base/migrations/0001_initial.py index bcd9ae29d..dd61fdcf5 100644 --- a/sapl/base/migrations/0001_initial.py +++ b/sapl/base/migrations/0001_initial.py @@ -66,7 +66,7 @@ class Migration(migrations.Migration): ('uf', models.CharField(choices=[('AC', 'Acre'), ('AL', 'Alagoas'), ('AP', 'Amapá'), ('AM', 'Amazonas'), ('BA', 'Bahia'), ('CE', 'Ceará'), ('DF', 'Distrito Federal'), ('ES', 'Espírito Santo'), ('GO', 'Goiás'), ('MA', 'Maranhão'), ('MT', 'Mato Grosso'), ('MS', 'Mato Grosso do Sul'), ('MG', 'Minas Gerais'), ('PR', 'Paraná'), ('PB', 'Paraíba'), ('PA', 'Pará'), ('PE', 'Pernambuco'), ('PI', 'Piauí'), ('RJ', 'Rio de Janeiro'), ('RN', 'Rio Grande do Norte'), ('RS', 'Rio Grande do Sul'), ('RO', 'Rondônia'), ('RR', 'Roraima'), ('SC', 'Santa Catarina'), ('SE', 'Sergipe'), ('SP', 'São Paulo'), ('TO', 'Tocantins'), ('EX', 'Exterior')], max_length=100, verbose_name='UF')), ('telefone', models.CharField(blank=True, max_length=100, verbose_name='Telefone')), ('fax', models.CharField(blank=True, max_length=100, verbose_name='Fax')), - ('logotipo', models.ImageField(blank=True, upload_to=sapl.base.models.get_casa_media_path, verbose_name='Logotipo')), + ('logotipo', models.ImageField(blank=True, upload_to='sapl/casa/logotipo/', verbose_name='Logotipo')), ('endereco_web', models.URLField(blank=True, max_length=100, verbose_name='HomePage')), ('email', models.EmailField(blank=True, max_length=100, verbose_name='E-mail')), ('informacao_geral', models.TextField(blank=True, max_length=100, verbose_name='Informação Geral')), diff --git a/sapl/base/models.py b/sapl/base/models.py index 640bb7d52..8825ea2a4 100644 --- a/sapl/base/models.py +++ b/sapl/base/models.py @@ -13,14 +13,6 @@ SEQUENCIA_NUMERACAO = (('A', _('Sequencial por ano')), ('U', _('Sequencial único'))) -def get_sessao_media_path(instance, subpath, filename): - return './sapl/casa/%s/%s' % (subpath, filename) - - -def get_casa_media_path(instance, filename): - return get_sessao_media_path(instance, 'Logotipo', filename) - - @reversion.register() class CasaLegislativa(models.Model): # TODO ajustar todos os max_length !!!! @@ -41,7 +33,7 @@ class CasaLegislativa(models.Model): max_length=100, blank=True, verbose_name=_('Fax')) logotipo = models.ImageField( blank=True, - upload_to=get_casa_media_path, + upload_to='sapl/casa/logotipo/', verbose_name=_('Logotipo')) endereco_web = models.URLField( max_length=100, blank=True, verbose_name=_('HomePage')) From 2281c05f87b8f64153b38d604d2869384dce965e Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 17 Mar 2017 09:35:40 -0300 Subject: [PATCH 015/140] Migra logotipo da Casa --- sapl/legacy/migration.py | 43 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 379ac13ad..23cdec286 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -1,3 +1,4 @@ +import os import re from datetime import date from subprocess import PIPE, call @@ -16,6 +17,7 @@ from django.db.models.base import ModelBase from model_mommy import mommy from model_mommy.mommy import foreign_key_required, make +from sapl.base import CasaLegislativa from sapl.base.models import Autor, ProblemaMigracao from sapl.comissoes.models import Comissao, Composicao, Participacao from sapl.legacy.models import Protocolo as ProtocoloLegado @@ -27,7 +29,7 @@ from sapl.norma.models import (AssuntoNorma, NormaJuridica, from sapl.parlamentares.models import Parlamentar from sapl.protocoloadm.models import Protocolo, StatusTramitacaoAdministrativo from sapl.sessao.models import ExpedienteMateria, OrdemDia, SessaoPlenaria -from sapl.settings import PROJECT_DIR +from sapl.settings import MEDIA_ROOT, PROJECT_DIR from sapl.utils import normalize # BASE ###################################################################### @@ -732,3 +734,42 @@ def make_with_log(model, _quantity=None, make_m2m=False, **attrs): return stub make_with_log.required = foreign_key_required + +# MIGRAÇÃO DE DOCUMENTOS ################################################### + +DOCS = {'logotipo': ('props_sapl/logo_casa.gif', + 'casa/logotipo/logo_casa.gif')} + +DOCS = {k: (os.path.join('sapl_documentos', origem), + os.path.join('sapl', destino)) + for k, (origem, destino) in DOCS.items()} + + +def em_media(caminho): + return os.path.join(MEDIA_ROOT, caminho) + + +def mover_documento(origem, destino): + origem, destino = map(em_media, (origem, destino)) + os.makedirs(os.path.dirname(destino), exist_ok=True) + os.rename(origem, destino) + + +def migrar_docs_logo(): + origem, destino = DOCS['logotipo'] + props_sapl = os.path.dirname(origem) + # a pasta props_sapl deve conter apenas o origem e metadatas! + assert set(os.listdir(em_media(props_sapl))) == { + 'logo_casa.gif', '.metadata', 'logo_casa.gif.metadata'} + mover_documento(origem, destino) + casa = CasaLegislativa.objects.first() + casa.logotipo = destino + casa.save() + + +def migrar_documentos(): + # aqui supomos que uma pasta chamada sapl_documentos está em MEDIA_ROOT + # com o conteúdo da pasta de mesmo nome do zope + # Os arquivos da pasta serão movidos para a nova estrutura e a pasta será + # apagada + migrar_docs_logo() From 50e44c5545bb7edb31117d696ff8e6f3d88d37a2 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 17 Mar 2017 16:47:51 -0300 Subject: [PATCH 016/140] =?UTF-8?q?Retorna=20settings=20de=20migra=C3=A7?= =?UTF-8?q?=C3=A3o=20para=20o=20modo=20DEBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy_migration_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapl/legacy_migration_settings.py b/sapl/legacy_migration_settings.py index 2b7366fc2..b9d2cefc2 100644 --- a/sapl/legacy_migration_settings.py +++ b/sapl/legacy_migration_settings.py @@ -23,7 +23,7 @@ if DATABASE_NAME_OVERRIDE: DATABASE_ROUTERS = ['sapl.legacy.router.LegacyRouter', ] -DEBUG = False +DEBUG = True MOMMY_CUSTOM_FIELDS_GEN = { 'django.db.models.ForeignKey': 'sapl.legacy.migration.make_with_log' From 6be75a03b247c186a4e0ca988506dbb68865dcc5 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 17 Mar 2017 18:08:16 -0300 Subject: [PATCH 017/140] Migra fotos dos parlamentares --- sapl/legacy/migration.py | 43 +++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 23cdec286..86cd48793 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -1,6 +1,7 @@ import os import re from datetime import date +from glob import glob from subprocess import PIPE, call import pkg_resources @@ -737,12 +738,21 @@ make_with_log.required = foreign_key_required # MIGRAÇÃO DE DOCUMENTOS ################################################### -DOCS = {'logotipo': ('props_sapl/logo_casa.gif', - 'casa/logotipo/logo_casa.gif')} +DOCS = { + CasaLegislativa: ( + 'logotipo', + 'props_sapl/logo_casa.gif', + 'casa/logotipo/logo_casa.gif'), + Parlamentar: ( + 'fotografia', + 'parlamentar/fotos/{}_foto_parlamentar', + 'parlamentar/{0}/{0}_foto_parlamentar'), +} -DOCS = {k: (os.path.join('sapl_documentos', origem), - os.path.join('sapl', destino)) - for k, (origem, destino) in DOCS.items()} +DOCS = {tipo: (campo, + os.path.join('sapl_documentos', origem), + os.path.join('sapl', destino)) + for tipo, (campo, origem, destino) in DOCS.items()} def em_media(caminho): @@ -750,13 +760,14 @@ def em_media(caminho): def mover_documento(origem, destino): - origem, destino = map(em_media, (origem, destino)) + origem, destino = [em_media(c) if not os.path.isabs(c) else c + for c in (origem, destino)] os.makedirs(os.path.dirname(destino), exist_ok=True) os.rename(origem, destino) def migrar_docs_logo(): - origem, destino = DOCS['logotipo'] + _, origem, destino = DOCS[CasaLegislativa] props_sapl = os.path.dirname(origem) # a pasta props_sapl deve conter apenas o origem e metadatas! assert set(os.listdir(em_media(props_sapl))) == { @@ -767,9 +778,27 @@ def migrar_docs_logo(): casa.save() +def migrar_docs_por_ids(tipo): + campo, base_origem, base_destino = DOCS[tipo] + origens = glob.glob(em_media(base_origem.format('*'))) + + def get_id(caminho): + match = re.match('.*/' + base_origem.format('(\d+)'), caminho) + return int(match.group(1)) + + for origem in origens: + id = get_id(origem) + destino = base_destino.format(id) + mover_documento(origem, destino) + obj = tipo.objects.get(pk=id) + setattr(obj, campo, destino) + obj.save() + + def migrar_documentos(): # aqui supomos que uma pasta chamada sapl_documentos está em MEDIA_ROOT # com o conteúdo da pasta de mesmo nome do zope # Os arquivos da pasta serão movidos para a nova estrutura e a pasta será # apagada migrar_docs_logo() + migrar_docs_por_ids(Parlamentar) From 26cefd3ba12d1727d1930526475cc84b4df86fe8 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Sat, 18 Mar 2017 10:35:41 -0300 Subject: [PATCH 018/140] =?UTF-8?q?Move=20migracao=20de=20documentos=20par?= =?UTF-8?q?a=20m=C3=B3dulo=20=C3=A0=20parte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migracao_documentos.py | 74 ++++++++++++++++++++++++++++++ sapl/legacy/migration.py | 72 +---------------------------- 2 files changed, 75 insertions(+), 71 deletions(-) create mode 100644 sapl/legacy/migracao_documentos.py diff --git a/sapl/legacy/migracao_documentos.py b/sapl/legacy/migracao_documentos.py new file mode 100644 index 000000000..d9cb3c086 --- /dev/null +++ b/sapl/legacy/migracao_documentos.py @@ -0,0 +1,74 @@ +import os +import re +from glob import glob + +from sapl.base.models import CasaLegislativa +from sapl.parlamentares.models import Parlamentar +from sapl.settings import MEDIA_ROOT + +# MIGRAÇÃO DE DOCUMENTOS ################################################### + +DOCS = { + CasaLegislativa: ( + 'logotipo', + 'props_sapl/logo_casa.gif', + 'casa/logotipo/logo_casa.gif'), + Parlamentar: ( + 'fotografia', + 'parlamentar/fotos/{}_foto_parlamentar', + 'parlamentar/{0}/{0}_foto_parlamentar'), +} + +DOCS = {tipo: (campo, + os.path.join('sapl_documentos', origem), + os.path.join('sapl', destino)) + for tipo, (campo, origem, destino) in DOCS.items()} + + +def em_media(caminho): + return os.path.join(MEDIA_ROOT, caminho) + + +def mover_documento(origem, destino): + origem, destino = [em_media(c) if not os.path.isabs(c) else c + for c in (origem, destino)] + os.makedirs(os.path.dirname(destino), exist_ok=True) + os.rename(origem, destino) + + +def migrar_docs_logo(): + _, origem, destino = DOCS[CasaLegislativa] + props_sapl = os.path.dirname(origem) + # a pasta props_sapl deve conter apenas o origem e metadatas! + assert set(os.listdir(em_media(props_sapl))) == { + 'logo_casa.gif', '.metadata', 'logo_casa.gif.metadata'} + mover_documento(origem, destino) + casa = CasaLegislativa.objects.first() + casa.logotipo = destino + casa.save() + + +def migrar_docs_por_ids(tipo): + campo, base_origem, base_destino = DOCS[tipo] + origens = glob.glob(em_media(base_origem.format('*'))) + + def get_id(caminho): + match = re.match('.*/' + base_origem.format('(\d+)'), caminho) + return int(match.group(1)) + + for origem in origens: + id = get_id(origem) + destino = base_destino.format(id) + mover_documento(origem, destino) + obj = tipo.objects.get(pk=id) + setattr(obj, campo, destino) + obj.save() + + +def migrar_documentos(): + # aqui supomos que uma pasta chamada sapl_documentos está em MEDIA_ROOT + # com o conteúdo da pasta de mesmo nome do zope + # Os arquivos da pasta serão movidos para a nova estrutura e a pasta será + # apagada + migrar_docs_logo() + migrar_docs_por_ids(Parlamentar) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 86cd48793..379ac13ad 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -1,7 +1,5 @@ -import os import re from datetime import date -from glob import glob from subprocess import PIPE, call import pkg_resources @@ -18,7 +16,6 @@ from django.db.models.base import ModelBase from model_mommy import mommy from model_mommy.mommy import foreign_key_required, make -from sapl.base import CasaLegislativa from sapl.base.models import Autor, ProblemaMigracao from sapl.comissoes.models import Comissao, Composicao, Participacao from sapl.legacy.models import Protocolo as ProtocoloLegado @@ -30,7 +27,7 @@ from sapl.norma.models import (AssuntoNorma, NormaJuridica, from sapl.parlamentares.models import Parlamentar from sapl.protocoloadm.models import Protocolo, StatusTramitacaoAdministrativo from sapl.sessao.models import ExpedienteMateria, OrdemDia, SessaoPlenaria -from sapl.settings import MEDIA_ROOT, PROJECT_DIR +from sapl.settings import PROJECT_DIR from sapl.utils import normalize # BASE ###################################################################### @@ -735,70 +732,3 @@ def make_with_log(model, _quantity=None, make_m2m=False, **attrs): return stub make_with_log.required = foreign_key_required - -# MIGRAÇÃO DE DOCUMENTOS ################################################### - -DOCS = { - CasaLegislativa: ( - 'logotipo', - 'props_sapl/logo_casa.gif', - 'casa/logotipo/logo_casa.gif'), - Parlamentar: ( - 'fotografia', - 'parlamentar/fotos/{}_foto_parlamentar', - 'parlamentar/{0}/{0}_foto_parlamentar'), -} - -DOCS = {tipo: (campo, - os.path.join('sapl_documentos', origem), - os.path.join('sapl', destino)) - for tipo, (campo, origem, destino) in DOCS.items()} - - -def em_media(caminho): - return os.path.join(MEDIA_ROOT, caminho) - - -def mover_documento(origem, destino): - origem, destino = [em_media(c) if not os.path.isabs(c) else c - for c in (origem, destino)] - os.makedirs(os.path.dirname(destino), exist_ok=True) - os.rename(origem, destino) - - -def migrar_docs_logo(): - _, origem, destino = DOCS[CasaLegislativa] - props_sapl = os.path.dirname(origem) - # a pasta props_sapl deve conter apenas o origem e metadatas! - assert set(os.listdir(em_media(props_sapl))) == { - 'logo_casa.gif', '.metadata', 'logo_casa.gif.metadata'} - mover_documento(origem, destino) - casa = CasaLegislativa.objects.first() - casa.logotipo = destino - casa.save() - - -def migrar_docs_por_ids(tipo): - campo, base_origem, base_destino = DOCS[tipo] - origens = glob.glob(em_media(base_origem.format('*'))) - - def get_id(caminho): - match = re.match('.*/' + base_origem.format('(\d+)'), caminho) - return int(match.group(1)) - - for origem in origens: - id = get_id(origem) - destino = base_destino.format(id) - mover_documento(origem, destino) - obj = tipo.objects.get(pk=id) - setattr(obj, campo, destino) - obj.save() - - -def migrar_documentos(): - # aqui supomos que uma pasta chamada sapl_documentos está em MEDIA_ROOT - # com o conteúdo da pasta de mesmo nome do zope - # Os arquivos da pasta serão movidos para a nova estrutura e a pasta será - # apagada - migrar_docs_logo() - migrar_docs_por_ids(Parlamentar) From c0fe1794f8d45a6ea57ba5eaeba0e6a55bd9d16c Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Sat, 18 Mar 2017 10:50:51 -0300 Subject: [PATCH 019/140] =?UTF-8?q?Cria=20CasaLegislativa=20se=20necess?= =?UTF-8?q?=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migracao_documentos.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sapl/legacy/migracao_documentos.py b/sapl/legacy/migracao_documentos.py index d9cb3c086..5d03b47d3 100644 --- a/sapl/legacy/migracao_documentos.py +++ b/sapl/legacy/migracao_documentos.py @@ -36,6 +36,15 @@ def mover_documento(origem, destino): os.rename(origem, destino) +def get_casa_legislativa(): + casa = CasaLegislativa.objects.first() + if not casa: + casa = CasaLegislativa.objects.create(**{k: 'PREENCHER...' for k in [ + 'codigo', 'nome', 'sigla', 'endereco', 'cep', 'municipio', 'uf', + ]}) + return casa + + def migrar_docs_logo(): _, origem, destino = DOCS[CasaLegislativa] props_sapl = os.path.dirname(origem) @@ -43,14 +52,14 @@ def migrar_docs_logo(): assert set(os.listdir(em_media(props_sapl))) == { 'logo_casa.gif', '.metadata', 'logo_casa.gif.metadata'} mover_documento(origem, destino) - casa = CasaLegislativa.objects.first() + casa = get_casa_legislativa() casa.logotipo = destino casa.save() def migrar_docs_por_ids(tipo): campo, base_origem, base_destino = DOCS[tipo] - origens = glob.glob(em_media(base_origem.format('*'))) + origens = glob(em_media(base_origem.format('*'))) def get_id(caminho): match = re.match('.*/' + base_origem.format('(\d+)'), caminho) From 899838a096308bf6380c7ba16a32e1d2cacbab66 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 21 Mar 2017 11:49:31 -0300 Subject: [PATCH 020/140] =?UTF-8?q?Migra=20texto=20integral=20de=20Mat?= =?UTF-8?q?=C3=A9ria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migracao_documentos.py | 41 +++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/sapl/legacy/migracao_documentos.py b/sapl/legacy/migracao_documentos.py index 5d03b47d3..a81196e2f 100644 --- a/sapl/legacy/migracao_documentos.py +++ b/sapl/legacy/migracao_documentos.py @@ -1,12 +1,28 @@ +import mimetypes import os import re from glob import glob +import magic + from sapl.base.models import CasaLegislativa +from sapl.materia.models import MateriaLegislativa from sapl.parlamentares.models import Parlamentar from sapl.settings import MEDIA_ROOT # MIGRAÇÃO DE DOCUMENTOS ################################################### +EXTENSOES = { + 'application/msword': '.doc', + 'application/pdf': '.pdf', + 'application/vnd.oasis.opendocument.text': '.odt', + 'application/vnd.openxmlformats-' + 'officedocument.wordprocessingml.document': '.docx', + 'application/xml': '.xml', + 'application/zip': '.zip', + 'image/jpeg': '.jpeg', + 'image/png': '.png', + 'text/html': '.html', +} DOCS = { CasaLegislativa: ( @@ -16,7 +32,12 @@ DOCS = { Parlamentar: ( 'fotografia', 'parlamentar/fotos/{}_foto_parlamentar', - 'parlamentar/{0}/{0}_foto_parlamentar'), + 'parlamentar/{0}/{0}_foto_parlamentar{1}'), + MateriaLegislativa: ( + 'texto_original', + 'materia/{}_texto_integral', + 'materialegislativa/{0}/{0}_texto_integral{1}', + ) } DOCS = {tipo: (campo, @@ -57,6 +78,19 @@ def migrar_docs_logo(): casa.save() +def get_extensao(caminho): + mime = magic.from_file(caminho, mime=True) + try: + return EXTENSOES[mime] + except KeyError as e: + raise Exception('\n'.join([ + 'Extensão não conhecida. Algumas possibilidades são:', ] + + [" '{}': '{}',".format(mime, ext) + for ext in mimetypes.guess_all_extensions(mime)] + + ['Atualize o código do dicionário EXTENSOES!'] + )) from e + + def migrar_docs_por_ids(tipo): campo, base_origem, base_destino = DOCS[tipo] origens = glob(em_media(base_origem.format('*'))) @@ -66,8 +100,8 @@ def migrar_docs_por_ids(tipo): return int(match.group(1)) for origem in origens: - id = get_id(origem) - destino = base_destino.format(id) + id, extensao = get_id(origem), get_extensao(origem) + destino = base_destino.format(id, extensao) mover_documento(origem, destino) obj = tipo.objects.get(pk=id) setattr(obj, campo, destino) @@ -81,3 +115,4 @@ def migrar_documentos(): # apagada migrar_docs_logo() migrar_docs_por_ids(Parlamentar) + migrar_docs_por_ids(MateriaLegislativa) From eab4eac7094bb322de864d384baf6460d9c28fc6 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 21 Mar 2017 13:31:59 -0300 Subject: [PATCH 021/140] Adiciona folhas XSLT usadas em documentos --- sapl/static/XSLT/HTML/.objects | 11 +++ sapl/static/XSLT/HTML/estilo.css | 95 +++++++++++++++++++++ sapl/static/XSLT/HTML/indicacao.xsl | 51 ++++++++++++ sapl/static/XSLT/HTML/mocao.xsl | 41 +++++++++ sapl/static/XSLT/HTML/mocao2.xsl | 45 ++++++++++ sapl/static/XSLT/HTML/parecer.xsl | 41 +++++++++ sapl/static/XSLT/HTML/pedido.xsl | 47 +++++++++++ sapl/static/XSLT/HTML/pedido2.xsl | 53 ++++++++++++ sapl/static/XSLT/HTML/pl.xsl | 105 ++++++++++++++++++++++++ sapl/static/XSLT/HTML/pl2.xsl | 100 ++++++++++++++++++++++ sapl/static/XSLT/HTML/requerimento.xsl | 52 ++++++++++++ sapl/static/XSLT/HTML/requerimento2.xsl | 57 +++++++++++++ sapl/urls.py | 4 + 13 files changed, 702 insertions(+) create mode 100644 sapl/static/XSLT/HTML/.objects create mode 100644 sapl/static/XSLT/HTML/estilo.css create mode 100644 sapl/static/XSLT/HTML/indicacao.xsl create mode 100644 sapl/static/XSLT/HTML/mocao.xsl create mode 100644 sapl/static/XSLT/HTML/mocao2.xsl create mode 100644 sapl/static/XSLT/HTML/parecer.xsl create mode 100644 sapl/static/XSLT/HTML/pedido.xsl create mode 100644 sapl/static/XSLT/HTML/pedido2.xsl create mode 100644 sapl/static/XSLT/HTML/pl.xsl create mode 100644 sapl/static/XSLT/HTML/pl2.xsl create mode 100644 sapl/static/XSLT/HTML/requerimento.xsl create mode 100644 sapl/static/XSLT/HTML/requerimento2.xsl diff --git a/sapl/static/XSLT/HTML/.objects b/sapl/static/XSLT/HTML/.objects new file mode 100644 index 000000000..ca1ce01f2 --- /dev/null +++ b/sapl/static/XSLT/HTML/.objects @@ -0,0 +1,11 @@ +estilo.css:DTML Method +indicacao.xsl:File +mocao.xsl:File +mocao2.xsl:File +parecer.xsl:File +pedido.xsl:File +pedido2.xsl:File +pl.xsl:File +pl2.xsl:File +requerimento.xsl:File +requerimento2.xsl:File diff --git a/sapl/static/XSLT/HTML/estilo.css b/sapl/static/XSLT/HTML/estilo.css new file mode 100644 index 000000000..aac85f176 --- /dev/null +++ b/sapl/static/XSLT/HTML/estilo.css @@ -0,0 +1,95 @@ + body { + font-family: Times; + text-align: justify; + font-size: 12 pt; + margin: 5px 1cm 20px 2cm; +} + + p, + .p{ + font-family: Times; + text-align: justify; + font-size: 12pt; + text-indent: 1.5cm; + margin: 40px 0 20px 0; + } + + .pequeno { + font-family: Times; + text-align: left; + font-size: 13pt; + margin: 0px 0 0px 0; + } + + .cabecalho { + font-family: Times; + font-weight:bold; + text-align: left; + font-size: 15pt; + margin: 10px 0 0px 0; + } + + .texto { + font-family: Times; + text-align: justify; + font-size: 12pt; + margin: 0px 0px 0px 0px; + } + + .data { + text-align: right; + } + + .autor { + text-align: center; + } + + .center { + text-align: center; + } + + .semrecuo { + text-indent: 0; + } + + .ementa { + text-align: justify; + margin-left: 50%; + text-indent: 0; + } + + .titulos1 { + text-align: center; + margin: 10px 0 0px 0; + } + + .titulos2 { + text-align: center; + margin: 0px 0 0px 0; + } + + p.artigo { + text-align: justify; + text-indent: 1cm; + margin: 10px 0 0px 0; +} + + +#imagem { + float:left; + } + +#autores + { + -moz-column-count:3; /* Firefox */ + -webkit-column-count:3; /* Safari and Chrome */ + width:50px; + + } + +#col1 { width: 33%; float: left; center: 10px; } +#col2 { width: 33%; float: left; center: 10px; } +#col3 { width: 33%; float: left; center: 10px; } + + + diff --git a/sapl/static/XSLT/HTML/indicacao.xsl b/sapl/static/XSLT/HTML/indicacao.xsl new file mode 100644 index 000000000..edb4575c7 --- /dev/null +++ b/sapl/static/XSLT/HTML/indicacao.xsl @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + +
+
+

+


+

Cmara Municipal de Agudo

+

Estado do Rio Grande do Sul





+
+

+ +
+ +

+
+ + +

+
+ + +

+ +
+ +

+
+ + +

+
+ +
diff --git a/sapl/static/XSLT/HTML/mocao.xsl b/sapl/static/XSLT/HTML/mocao.xsl new file mode 100644 index 000000000..adb7ef3c9 --- /dev/null +++ b/sapl/static/XSLT/HTML/mocao.xsl @@ -0,0 +1,41 @@ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/sapl/static/XSLT/HTML/mocao2.xsl b/sapl/static/XSLT/HTML/mocao2.xsl new file mode 100644 index 000000000..14f71c982 --- /dev/null +++ b/sapl/static/XSLT/HTML/mocao2.xsl @@ -0,0 +1,45 @@ + + + + + + + + + + +
+
+ +


+

Cmara Municipal de Agudo

+

Estado do Rio Grande do Sul





+
+ + + +
+ + +

+
+ + +

+
+ + +

+
+ + +

+
+ + +

+
+ +
\ No newline at end of file diff --git a/sapl/static/XSLT/HTML/parecer.xsl b/sapl/static/XSLT/HTML/parecer.xsl new file mode 100644 index 000000000..14100320e --- /dev/null +++ b/sapl/static/XSLT/HTML/parecer.xsl @@ -0,0 +1,41 @@ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/sapl/static/XSLT/HTML/pedido.xsl b/sapl/static/XSLT/HTML/pedido.xsl new file mode 100644 index 000000000..9e5002d01 --- /dev/null +++ b/sapl/static/XSLT/HTML/pedido.xsl @@ -0,0 +1,47 @@ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/sapl/static/XSLT/HTML/pedido2.xsl b/sapl/static/XSLT/HTML/pedido2.xsl new file mode 100644 index 000000000..facc154c6 --- /dev/null +++ b/sapl/static/XSLT/HTML/pedido2.xsl @@ -0,0 +1,53 @@ + + + + + + + + + + +
+
+ +


+

Cmara Municipal de Agudo

+

Estado do Rio Grande do Sul





+
+ + + +
+ + +

+
+ + +

+
+ + +

+
+ + +

+
+ + +

+
+ + +

+
+ + +

+
+ +
\ No newline at end of file diff --git a/sapl/static/XSLT/HTML/pl.xsl b/sapl/static/XSLT/HTML/pl.xsl new file mode 100644 index 000000000..0da6eddb4 --- /dev/null +++ b/sapl/static/XSLT/HTML/pl.xsl @@ -0,0 +1,105 @@ + + + + + + + + <xsl:value-of select="@id"/> + + + + + + + + + +
+

PROPOSIO

+
+ +
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +

+ +

+
+ +
+

JUSTIFICATIVA

+
+

+ +

+
+ +
+

MENSAGEM

+
+

+ +

+
+
\ No newline at end of file diff --git a/sapl/static/XSLT/HTML/pl2.xsl b/sapl/static/XSLT/HTML/pl2.xsl new file mode 100644 index 000000000..f68506f95 --- /dev/null +++ b/sapl/static/XSLT/HTML/pl2.xsl @@ -0,0 +1,100 @@ + + + + + + + + + + +
+
+ +


+

Cmara Municipal de Agudo

+

Estado do Rio Grande do Sul





+
+ + + + +
+ + +

+
+ + +

+
+ + +

+
+ + +

+

+
+ + +

+

+
+ + +

+

+
+ + +

+

+
+ + +

+

+
+ + +

+

+
+ + +

+
+ + +

+
+ + +

+
+ + +

+
+ + +

+
+ + +

+
+ + +

+
+ + +

+
+ +
\ No newline at end of file diff --git a/sapl/static/XSLT/HTML/requerimento.xsl b/sapl/static/XSLT/HTML/requerimento.xsl new file mode 100644 index 000000000..58f202b09 --- /dev/null +++ b/sapl/static/XSLT/HTML/requerimento.xsl @@ -0,0 +1,52 @@ + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/sapl/static/XSLT/HTML/requerimento2.xsl b/sapl/static/XSLT/HTML/requerimento2.xsl new file mode 100644 index 000000000..3d63f6cf8 --- /dev/null +++ b/sapl/static/XSLT/HTML/requerimento2.xsl @@ -0,0 +1,57 @@ + + + + + + + + + + +
+
+ +


+

Cmara Municipal de Agudo

+

Estado do Rio Grande do Sul





+
+ + + +
+ + +

+
+ + +

+
+ + +

+
+ + +

+
+ + +

+ +
+ +

+ +
+ +

+
+ + +

+
+ +
\ No newline at end of file diff --git a/sapl/urls.py b/sapl/urls.py index 58deafa3a..fe6bcc71e 100644 --- a/sapl/urls.py +++ b/sapl/urls.py @@ -57,6 +57,10 @@ urlpatterns = [ url(r'^favicon\.ico$', RedirectView.as_view( url='/static/img/favicon.ico', permanent=True)), + + # Folhas XSLT e extras referenciadas por documentos migrados do sapl 2.5 + url(r'^XSLT/HTML/(?P.*)$', RedirectView.as_view( + url='/static/XSLT/HTML/%(path)s', permanent=False)), ] From a0eb77d197575f894a472e952a2e785053528cd9 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 21 Mar 2017 15:17:15 -0300 Subject: [PATCH 022/140] =?UTF-8?q?Migra=20documentos=20acess=C3=B3rios=20?= =?UTF-8?q?de=20mat=C3=A9ria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migracao_documentos.py | 35 +++++++++++++++++------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/sapl/legacy/migracao_documentos.py b/sapl/legacy/migracao_documentos.py index a81196e2f..778e2d52c 100644 --- a/sapl/legacy/migracao_documentos.py +++ b/sapl/legacy/migracao_documentos.py @@ -1,12 +1,11 @@ import mimetypes import os import re -from glob import glob import magic from sapl.base.models import CasaLegislativa -from sapl.materia.models import MateriaLegislativa +from sapl.materia.models import DocumentoAcessorio, MateriaLegislativa from sapl.parlamentares.models import Parlamentar from sapl.settings import MEDIA_ROOT @@ -36,8 +35,11 @@ DOCS = { MateriaLegislativa: ( 'texto_original', 'materia/{}_texto_integral', - 'materialegislativa/{0}/{0}_texto_integral{1}', - ) + 'materialegislativa/{0}/{0}_texto_integral{1}'), + DocumentoAcessorio: ( + 'arquivo', + 'materia/{}', + 'documentoacessorio/{0}/{0}{1}'), } DOCS = {tipo: (campo, @@ -93,19 +95,21 @@ def get_extensao(caminho): def migrar_docs_por_ids(tipo): campo, base_origem, base_destino = DOCS[tipo] - origens = glob(em_media(base_origem.format('*'))) - def get_id(caminho): - match = re.match('.*/' + base_origem.format('(\d+)'), caminho) - return int(match.group(1)) + dir_origem, nome_origem = os.path.split(em_media(base_origem)) + pat = re.compile('^{}$'.format(nome_origem.format('(\d+)'))) + for arq in os.listdir(dir_origem): + match = pat.match(arq) + if match: + origem = os.path.join(dir_origem, match.group(0)) + id = match.group(1) + extensao = get_extensao(origem) + destino = base_destino.format(id, extensao) + mover_documento(origem, destino) - for origem in origens: - id, extensao = get_id(origem), get_extensao(origem) - destino = base_destino.format(id, extensao) - mover_documento(origem, destino) - obj = tipo.objects.get(pk=id) - setattr(obj, campo, destino) - obj.save() + obj = tipo.objects.get(pk=id) + setattr(obj, campo, destino) + obj.save() def migrar_documentos(): @@ -116,3 +120,4 @@ def migrar_documentos(): migrar_docs_logo() migrar_docs_por_ids(Parlamentar) migrar_docs_por_ids(MateriaLegislativa) + migrar_docs_por_ids(DocumentoAcessorio) From 51623e8b130f6779677a02035de0ab60186d8d56 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Wed, 22 Mar 2017 17:53:11 -0300 Subject: [PATCH 023/140] =?UTF-8?q?Migra=20texto=20integral=20de=20norma?= =?UTF-8?q?=20jur=C3=ADdica?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migracao_documentos.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sapl/legacy/migracao_documentos.py b/sapl/legacy/migracao_documentos.py index 778e2d52c..148f2a03d 100644 --- a/sapl/legacy/migracao_documentos.py +++ b/sapl/legacy/migracao_documentos.py @@ -6,6 +6,7 @@ import magic from sapl.base.models import CasaLegislativa from sapl.materia.models import DocumentoAcessorio, MateriaLegislativa +from sapl.norma.models import NormaJuridica from sapl.parlamentares.models import Parlamentar from sapl.settings import MEDIA_ROOT @@ -14,13 +15,17 @@ EXTENSOES = { 'application/msword': '.doc', 'application/pdf': '.pdf', 'application/vnd.oasis.opendocument.text': '.odt', - 'application/vnd.openxmlformats-' - 'officedocument.wordprocessingml.document': '.docx', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': '.docx', # noqa 'application/xml': '.xml', 'application/zip': '.zip', 'image/jpeg': '.jpeg', 'image/png': '.png', 'text/html': '.html', + 'text/rtf': '.rtf', + + # sem extensao + 'application/octet-stream': '', # binário + 'inode/x-empty': '', # vazio } DOCS = { @@ -40,6 +45,10 @@ DOCS = { 'arquivo', 'materia/{}', 'documentoacessorio/{0}/{0}{1}'), + NormaJuridica: ( + 'texto_original', + 'norma_juridica/{}_texto_integral', + 'normajuridica/{0}/{0}_texto_integral{1}'), } DOCS = {tipo: (campo, @@ -86,7 +95,11 @@ def get_extensao(caminho): return EXTENSOES[mime] except KeyError as e: raise Exception('\n'.join([ - 'Extensão não conhecida. Algumas possibilidades são:', ] + + 'Extensão não conhecida para o arquivo:', + caminho, + 'E mimetype:', + mime, + ' Algumas possibilidades são:', ] + [" '{}': '{}',".format(mime, ext) for ext in mimetypes.guess_all_extensions(mime)] + ['Atualize o código do dicionário EXTENSOES!'] @@ -121,3 +134,4 @@ def migrar_documentos(): migrar_docs_por_ids(Parlamentar) migrar_docs_por_ids(MateriaLegislativa) migrar_docs_por_ids(DocumentoAcessorio) + migrar_docs_por_ids(NormaJuridica) From 8572fa44694b6a449d055d10526a193553d0cd08 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 24 Mar 2017 11:12:58 -0300 Subject: [PATCH 024/140] =?UTF-8?q?Migra=20ata=20de=20sess=C3=A3o=20plen?= =?UTF-8?q?=C3=A1ria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migracao_documentos.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sapl/legacy/migracao_documentos.py b/sapl/legacy/migracao_documentos.py index 148f2a03d..b1360c6cc 100644 --- a/sapl/legacy/migracao_documentos.py +++ b/sapl/legacy/migracao_documentos.py @@ -8,6 +8,7 @@ from sapl.base.models import CasaLegislativa from sapl.materia.models import DocumentoAcessorio, MateriaLegislativa from sapl.norma.models import NormaJuridica from sapl.parlamentares.models import Parlamentar +from sapl.sessao.models import SessaoPlenaria from sapl.settings import MEDIA_ROOT # MIGRAÇÃO DE DOCUMENTOS ################################################### @@ -49,6 +50,10 @@ DOCS = { 'texto_original', 'norma_juridica/{}_texto_integral', 'normajuridica/{0}/{0}_texto_integral{1}'), + SessaoPlenaria: ( + 'upload_ata', + 'ata_sessao/{}_ata_sessao', + 'sessaoplenaria/{0}/ata/{0}_ata_sessao{1}'), } DOCS = {tipo: (campo, @@ -135,3 +140,4 @@ def migrar_documentos(): migrar_docs_por_ids(MateriaLegislativa) migrar_docs_por_ids(DocumentoAcessorio) migrar_docs_por_ids(NormaJuridica) + migrar_docs_por_ids(SessaoPlenaria) From ef12da1598d64e4cffd114ee8de2f985419dabd4 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Tue, 28 Mar 2017 14:41:15 -0300 Subject: [PATCH 025/140] =?UTF-8?q?Transfere=20textos=20de=20documento=20e?= =?UTF-8?q?=20proposi=C3=A7=C3=A3o=20para=20pasta=20private?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/utils.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/sapl/utils.py b/sapl/utils.py index d957add71..c40160958 100644 --- a/sapl/utils.py +++ b/sapl/utils.py @@ -608,10 +608,20 @@ def texto_upload_path(instance, filename, subpath=''): filename = re.sub('[^a-zA-Z0-9.]', '-', filename).strip('-').lower() filename = re.sub('[-]+', '-', filename) - path = './sapl/%(model_name)s/%(pk)s/%(subpath)s%(filename)s' % { - 'model_name': instance._meta.model_name, - 'pk': instance.pk, - 'subpath': subpath, - 'filename': filename} + prefix = 'public' + + from sapl.materia.models import Proposicao + from sapl.protocoloadm.models import DocumentoAdministrativo + if isinstance(instance, (DocumentoAdministrativo, Proposicao)): + prefix = 'private' + + path = './sapl/%(prefix)s/%(model_name)s/%(pk)s/%(subpath)s%(filename)s' %\ + { + 'prefix': prefix, + 'model_name': instance._meta.model_name, + 'pk': instance.pk, + 'subpath': subpath, + 'filename': filename + } return path From 56e6bf0c09084602a5e03c531ab1c9e3f4c019c2 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 28 Mar 2017 14:43:06 -0300 Subject: [PATCH 026/140] =?UTF-8?q?Ignora=20objeto=20n=C3=A3o=20existente?= =?UTF-8?q?=20para=20documento?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migracao_documentos.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sapl/legacy/migracao_documentos.py b/sapl/legacy/migracao_documentos.py index b1360c6cc..b2c008fa1 100644 --- a/sapl/legacy/migracao_documentos.py +++ b/sapl/legacy/migracao_documentos.py @@ -125,9 +125,15 @@ def migrar_docs_por_ids(tipo): destino = base_destino.format(id, extensao) mover_documento(origem, destino) - obj = tipo.objects.get(pk=id) - setattr(obj, campo, destino) - obj.save() + # associa documento ao objeto + try: + obj = tipo.objects.get(pk=id) + setattr(obj, campo, destino) + obj.save() + except tipo.DoesNotExist: + msg = 'Objeto do tipo {} não encontrado para documento em [{}]' + print(msg.format( + tipo.__name__, destino)) def migrar_documentos(): From e588862a0255cd231c851e5446fe679277d5b0d3 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 28 Mar 2017 14:57:09 -0300 Subject: [PATCH 027/140] =?UTF-8?q?Migra=20texto=20original=20de=20Proposi?= =?UTF-8?q?=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migracao_documentos.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sapl/legacy/migracao_documentos.py b/sapl/legacy/migracao_documentos.py index b2c008fa1..e259a55cd 100644 --- a/sapl/legacy/migracao_documentos.py +++ b/sapl/legacy/migracao_documentos.py @@ -5,7 +5,8 @@ import re import magic from sapl.base.models import CasaLegislativa -from sapl.materia.models import DocumentoAcessorio, MateriaLegislativa +from sapl.materia.models import (DocumentoAcessorio, MateriaLegislativa, + Proposicao) from sapl.norma.models import NormaJuridica from sapl.parlamentares.models import Parlamentar from sapl.sessao.models import SessaoPlenaria @@ -54,6 +55,10 @@ DOCS = { 'upload_ata', 'ata_sessao/{}_ata_sessao', 'sessaoplenaria/{0}/ata/{0}_ata_sessao{1}'), + Proposicao: ( + 'texto_original', + 'proposicao/{}', + 'proposicao/{0}/{0}{1}'), } DOCS = {tipo: (campo, @@ -147,3 +152,4 @@ def migrar_documentos(): migrar_docs_por_ids(DocumentoAcessorio) migrar_docs_por_ids(NormaJuridica) migrar_docs_por_ids(SessaoPlenaria) + migrar_docs_por_ids(Proposicao) From eced69037f4706d77e5d27decb3256fb8c5ad516 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 28 Mar 2017 15:13:46 -0300 Subject: [PATCH 028/140] Migra texto integral de Documento Administrativo --- sapl/legacy/migracao_documentos.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/sapl/legacy/migracao_documentos.py b/sapl/legacy/migracao_documentos.py index e259a55cd..58833e6a4 100644 --- a/sapl/legacy/migracao_documentos.py +++ b/sapl/legacy/migracao_documentos.py @@ -9,6 +9,7 @@ from sapl.materia.models import (DocumentoAcessorio, MateriaLegislativa, Proposicao) from sapl.norma.models import NormaJuridica from sapl.parlamentares.models import Parlamentar +from sapl.protocoloadm.models import DocumentoAdministrativo from sapl.sessao.models import SessaoPlenaria from sapl.settings import MEDIA_ROOT @@ -24,6 +25,7 @@ EXTENSOES = { 'image/png': '.png', 'text/html': '.html', 'text/rtf': '.rtf', + 'text/x-python': '.py', # sem extensao 'application/octet-stream': '', # binário @@ -59,6 +61,10 @@ DOCS = { 'texto_original', 'proposicao/{}', 'proposicao/{0}/{0}{1}'), + DocumentoAdministrativo: ( + 'texto_integral', + 'administrativo/{}_texto_integral', + 'documentoadministrativo/{0}/{0}_texto_integral{1}'), } DOCS = {tipo: (campo, @@ -136,9 +142,9 @@ def migrar_docs_por_ids(tipo): setattr(obj, campo, destino) obj.save() except tipo.DoesNotExist: - msg = 'Objeto do tipo {} não encontrado para documento em [{}]' + msg = '{} (pk={}) não encontrado para documento em [{}]' print(msg.format( - tipo.__name__, destino)) + tipo.__name__, id, destino)) def migrar_documentos(): @@ -147,9 +153,13 @@ def migrar_documentos(): # Os arquivos da pasta serão movidos para a nova estrutura e a pasta será # apagada migrar_docs_logo() - migrar_docs_por_ids(Parlamentar) - migrar_docs_por_ids(MateriaLegislativa) - migrar_docs_por_ids(DocumentoAcessorio) - migrar_docs_por_ids(NormaJuridica) - migrar_docs_por_ids(SessaoPlenaria) - migrar_docs_por_ids(Proposicao) + for tipo in [ + Parlamentar, + MateriaLegislativa, + DocumentoAcessorio, + NormaJuridica, + SessaoPlenaria, + Proposicao, + DocumentoAdministrativo, + ]: + migrar_docs_por_ids(tipo) From 682a3cbb96a6b3ac0c93d40851ac646ce7a1a818 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 28 Mar 2017 15:37:33 -0300 Subject: [PATCH 029/140] =?UTF-8?q?Melhora=20feedback=20da=20migra=C3=A7?= =?UTF-8?q?=C3=A3o=20de=20documentos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migracao_documentos.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sapl/legacy/migracao_documentos.py b/sapl/legacy/migracao_documentos.py index 58833e6a4..63091171a 100644 --- a/sapl/legacy/migracao_documentos.py +++ b/sapl/legacy/migracao_documentos.py @@ -94,10 +94,11 @@ def get_casa_legislativa(): def migrar_docs_logo(): + print('Migrando logotipo da casa') _, origem, destino = DOCS[CasaLegislativa] props_sapl = os.path.dirname(origem) # a pasta props_sapl deve conter apenas o origem e metadatas! - assert set(os.listdir(em_media(props_sapl))) == { + assert set(os.listdir(em_media(props_sapl))) < { 'logo_casa.gif', '.metadata', 'logo_casa.gif.metadata'} mover_documento(origem, destino) casa = get_casa_legislativa() @@ -124,6 +125,7 @@ def get_extensao(caminho): def migrar_docs_por_ids(tipo): campo, base_origem, base_destino = DOCS[tipo] + print('Migrando {} de {}'.format(campo, tipo.__name__)) dir_origem, nome_origem = os.path.split(em_media(base_origem)) pat = re.compile('^{}$'.format(nome_origem.format('(\d+)'))) @@ -163,3 +165,12 @@ def migrar_documentos(): DocumentoAdministrativo, ]: migrar_docs_por_ids(tipo) + + sobrando = [os.path.join(dir, file) + for (dir, _, files) in os.walk(em_media('sapl_documentos')) + for file in files] + if sobrando: + print('{} documentos sobraram sem ser migrados!!!'.format( + len(sobrando))) + for doc in sobrando: + print(' {}'. format(doc)) From 6fa7f206e6f21b1d14a0bb4ba090c1dbbeb492df Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Tue, 28 Mar 2017 16:43:47 -0300 Subject: [PATCH 030/140] =?UTF-8?q?Migra=20anexo=20de=20sess=C3=A3o=20plen?= =?UTF-8?q?=C3=A1ria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/migracao_documentos.py | 110 ++++++++++++++++------------- 1 file changed, 61 insertions(+), 49 deletions(-) diff --git a/sapl/legacy/migracao_documentos.py b/sapl/legacy/migracao_documentos.py index 63091171a..4d9877fa7 100644 --- a/sapl/legacy/migracao_documentos.py +++ b/sapl/legacy/migracao_documentos.py @@ -33,44 +33,49 @@ EXTENSOES = { } DOCS = { - CasaLegislativa: ( + CasaLegislativa: [( 'logotipo', 'props_sapl/logo_casa.gif', - 'casa/logotipo/logo_casa.gif'), - Parlamentar: ( + 'casa/logotipo/logo_casa.gif')], + Parlamentar: [( 'fotografia', 'parlamentar/fotos/{}_foto_parlamentar', - 'parlamentar/{0}/{0}_foto_parlamentar{1}'), - MateriaLegislativa: ( + 'parlamentar/{0}/{0}_foto_parlamentar{1}')], + MateriaLegislativa: [( 'texto_original', 'materia/{}_texto_integral', - 'materialegislativa/{0}/{0}_texto_integral{1}'), - DocumentoAcessorio: ( + 'materialegislativa/{0}/{0}_texto_integral{1}')], + DocumentoAcessorio: [( 'arquivo', 'materia/{}', - 'documentoacessorio/{0}/{0}{1}'), - NormaJuridica: ( + 'documentoacessorio/{0}/{0}{1}')], + NormaJuridica: [( 'texto_original', 'norma_juridica/{}_texto_integral', - 'normajuridica/{0}/{0}_texto_integral{1}'), - SessaoPlenaria: ( - 'upload_ata', - 'ata_sessao/{}_ata_sessao', - 'sessaoplenaria/{0}/ata/{0}_ata_sessao{1}'), - Proposicao: ( + 'normajuridica/{0}/{0}_texto_integral{1}')], + SessaoPlenaria: [ + ('upload_ata', + 'ata_sessao/{}_ata_sessao', + 'sessaoplenaria/{0}/ata/{0}_ata_sessao{1}'), + ('upload_anexo', + 'anexo_sessao/{}_texto_anexado', + 'sessaoplenaria/{0}/anexo/{0}_texto_anexado{1}') + ], + Proposicao: [( 'texto_original', 'proposicao/{}', - 'proposicao/{0}/{0}{1}'), - DocumentoAdministrativo: ( + 'proposicao/{0}/{0}{1}')], + DocumentoAdministrativo: [( 'texto_integral', 'administrativo/{}_texto_integral', - 'documentoadministrativo/{0}/{0}_texto_integral{1}'), + 'documentoadministrativo/{0}/{0}_texto_integral{1}')], } -DOCS = {tipo: (campo, - os.path.join('sapl_documentos', origem), - os.path.join('sapl', destino)) - for tipo, (campo, origem, destino) in DOCS.items()} +DOCS = {tipo: [(campo, + os.path.join('sapl_documentos', origem), + os.path.join('sapl', destino)) + for campo, origem, destino in campos] + for tipo, campos in DOCS.items()} def em_media(caminho): @@ -94,8 +99,8 @@ def get_casa_legislativa(): def migrar_docs_logo(): - print('Migrando logotipo da casa') - _, origem, destino = DOCS[CasaLegislativa] + print('#### Migrando logotipo da casa ####') + [(_, origem, destino)] = DOCS[CasaLegislativa] props_sapl = os.path.dirname(origem) # a pasta props_sapl deve conter apenas o origem e metadatas! assert set(os.listdir(em_media(props_sapl))) < { @@ -124,29 +129,35 @@ def get_extensao(caminho): def migrar_docs_por_ids(tipo): - campo, base_origem, base_destino = DOCS[tipo] - print('Migrando {} de {}'.format(campo, tipo.__name__)) - - dir_origem, nome_origem = os.path.split(em_media(base_origem)) - pat = re.compile('^{}$'.format(nome_origem.format('(\d+)'))) - for arq in os.listdir(dir_origem): - match = pat.match(arq) - if match: - origem = os.path.join(dir_origem, match.group(0)) - id = match.group(1) - extensao = get_extensao(origem) - destino = base_destino.format(id, extensao) - mover_documento(origem, destino) - - # associa documento ao objeto - try: - obj = tipo.objects.get(pk=id) - setattr(obj, campo, destino) - obj.save() - except tipo.DoesNotExist: - msg = '{} (pk={}) não encontrado para documento em [{}]' - print(msg.format( - tipo.__name__, id, destino)) + for campo, base_origem, base_destino in DOCS[tipo]: + print('#### Migrando {} de {} ####'.format(campo, tipo.__name__)) + + dir_origem, nome_origem = os.path.split(em_media(base_origem)) + pat = re.compile('^{}$'.format(nome_origem.format('(\d+)'))) + + if not os.path.isdir(dir_origem): + print(' >>> O diretório {} não existe! Abortado.'.format( + dir_origem)) + continue + + for arq in os.listdir(dir_origem): + match = pat.match(arq) + if match: + origem = os.path.join(dir_origem, match.group(0)) + id = match.group(1) + extensao = get_extensao(origem) + destino = base_destino.format(id, extensao) + mover_documento(origem, destino) + + # associa documento ao objeto + try: + obj = tipo.objects.get(pk=id) + setattr(obj, campo, destino) + obj.save() + except tipo.DoesNotExist: + msg = ' {} (pk={}) não encontrado para documento em [{}]' + print(msg.format( + tipo.__name__, id, destino)) def migrar_documentos(): @@ -170,7 +181,8 @@ def migrar_documentos(): for (dir, _, files) in os.walk(em_media('sapl_documentos')) for file in files] if sobrando: - print('{} documentos sobraram sem ser migrados!!!'.format( - len(sobrando))) + print('\n#### Encerrado ####\n\n' + '{} documentos sobraram sem ser migrados!!!'.format( + len(sobrando))) for doc in sobrando: print(' {}'. format(doc)) From 98f08d0cb8dbd7f6bfdeb42a129d9861296976e9 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Wed, 29 Mar 2017 14:38:03 -0300 Subject: [PATCH 031/140] Fix #981 --- sapl/templates/parlamentares/public_composicaomesa_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapl/templates/parlamentares/public_composicaomesa_form.html b/sapl/templates/parlamentares/public_composicaomesa_form.html index ef04f6a3c..2dd31ff2b 100644 --- a/sapl/templates/parlamentares/public_composicaomesa_form.html +++ b/sapl/templates/parlamentares/public_composicaomesa_form.html @@ -50,7 +50,7 @@ {% else %} {% endif %} - {{p.parlamentar.nome_parlamentar}} + {{p.parlamentar.nome_parlamentar}} {{p.parlamentar.filiacao_set.last.partido.sigla}} {{p.cargo}} From af22b1e276be16f386468048bcb3352c1f1ed274 Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Wed, 29 Mar 2017 14:41:10 -0300 Subject: [PATCH 032/140] Fix #981 --- sapl/templates/parlamentares/public_composicaomesa_form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapl/templates/parlamentares/public_composicaomesa_form.html b/sapl/templates/parlamentares/public_composicaomesa_form.html index 2dd31ff2b..15c62ab28 100644 --- a/sapl/templates/parlamentares/public_composicaomesa_form.html +++ b/sapl/templates/parlamentares/public_composicaomesa_form.html @@ -50,7 +50,7 @@ {% else %} {% endif %} - {{p.parlamentar.nome_parlamentar}} + {{p.parlamentar.nome_parlamentar}} {{p.parlamentar.filiacao_set.last.partido.sigla}} {{p.cargo}} From fb0753d0909556ec87d3cad71822cf3bd5a71dad Mon Sep 17 00:00:00 2001 From: eduardocalil Date: Thu, 30 Mar 2017 14:44:40 -0300 Subject: [PATCH 033/140] Fix #809 full text search (#980) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Inicia a pesquisa textual * Melhora o front-end da pesquisa textual * Bug fix * Ajusta alguns detalhes e cria botão de acesso a pesquisa * Adiciona signals para atualizar o index * Inicia a pesquisa textual * Melhora o front-end da pesquisa textual * Bug fix * Ajusta alguns detalhes e cria botão de acesso a pesquisa * Adiciona signals para atualizar o index * Insere ao README o comando de indexação * Atualiza versão do Haystack * Remove pacote haystack antigo Coloca url de search no padrão --- .gitignore | 1 + docs/instacao31.rst | 3 + requirements/requirements.txt | 3 + sapl/base/search_indexes.py | 58 +++++++++++ sapl/base/templatetags/common_tags.py | 13 ++- sapl/base/urls.py | 2 + sapl/materia/apps.py | 3 + sapl/materia/signals.py | 29 ++++++ sapl/settings.py | 11 +++ .../materia/materialegislativa_filter.html | 4 + .../materia/documentoacessorio_text.txt | 7 ++ .../materia/materialegislativa_text.txt | 7 ++ sapl/templates/search/search.html | 95 +++++++++++++++++++ 13 files changed, 235 insertions(+), 1 deletion(-) create mode 100644 sapl/base/search_indexes.py create mode 100644 sapl/materia/signals.py create mode 100644 sapl/templates/search/indexes/materia/documentoacessorio_text.txt create mode 100644 sapl/templates/search/indexes/materia/materialegislativa_text.txt create mode 100644 sapl/templates/search/search.html diff --git a/.gitignore b/.gitignore index 38805b350..83de47a86 100644 --- a/.gitignore +++ b/.gitignore @@ -92,3 +92,4 @@ collected_static bower bower_components media +whoosh/ \ No newline at end of file diff --git a/docs/instacao31.rst b/docs/instacao31.rst index 3d921a4a6..3d6a8b3eb 100644 --- a/docs/instacao31.rst +++ b/docs/instacao31.rst @@ -187,6 +187,9 @@ Copie a chave que aparecerá, edite o arquivo .env e altere o valor do parâmetr ./manage.py collectstatic --noinput +* Preparar o ambiente para indexação de arquivos:: + ./manage.py rebuild_index + * Subir o servidor do django:: ./manage.py runserver 0.0.0.0:8001 diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 36ed3844b..6d7592cda 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,4 +1,5 @@ dj-database-url==0.4.1 +django-haystack==2.6.0 django>=1.9,<1.10 # TODO O django-admin-bootstrapped 2.5.7 não inseriu a mudança que permite # a compatibilidade com Django 1.9+. A linha abaixo será mudada quando uma @@ -25,7 +26,9 @@ python-decouple==3.0 pytz==2016.4 pyyaml==3.11 rtyaml==0.0.3 +textract==1.5.0 unipath==1.1 python-magic==0.4.12 gunicorn==19.6.0 django-reversion==2.0.8 +whoosh==2.7.4 diff --git a/sapl/base/search_indexes.py b/sapl/base/search_indexes.py new file mode 100644 index 000000000..1bb379091 --- /dev/null +++ b/sapl/base/search_indexes.py @@ -0,0 +1,58 @@ +import textract + +from haystack import indexes +from sapl.materia.models import DocumentoAcessorio, MateriaLegislativa +from django.template import Context, loader + + +class DocumentoAcessorioIndex(indexes.SearchIndex, indexes.Indexable): + text = indexes.CharField(document=True, use_template=True) + + filename = 'arquivo' + model = DocumentoAcessorio + template_name = 'materia/documentoacessorio_text.txt' + + def get_model(self): + return self.model + + def index_queryset(self, using=None): + return self.get_model().objects.all() + + def prepare(self, obj): + if not self.filename or not self.model or not self.template_name: + raise Exception + + data = super(DocumentoAcessorioIndex, self).prepare(obj) + + arquivo = getattr(obj, self.filename) + + if arquivo: + try: + arquivo.open() + except OSError: + return self.prepared_data + + extracted_data = textract.process( + arquivo.path).decode( + 'utf-8').replace('\n', ' ') + + extracted_data = extracted_data.replace('\t', ' ') + + # Now we'll finally perform the template processing to render the + # text field with *all* of our metadata visible for templating: + t = loader.select_template(( + 'search/indexes/' + self.template_name, )) + data['text'] = t.render(Context({'object': obj, + 'extracted': extracted_data})) + + return data + + return self.prepared_data + + +class MateriaLegislativaIndex(DocumentoAcessorioIndex): + text = indexes.CharField(document=True, use_template=True) + + filename = 'texto_original' + model = MateriaLegislativa + template_name = 'materia/materialegislativa_text.txt' diff --git a/sapl/base/templatetags/common_tags.py b/sapl/base/templatetags/common_tags.py index 9d643e70c..a908b7396 100644 --- a/sapl/base/templatetags/common_tags.py +++ b/sapl/base/templatetags/common_tags.py @@ -2,6 +2,7 @@ from compressor.utils import get_class from django import template from sapl.base.models import AppConfig +from sapl.materia.models import DocumentoAcessorio, MateriaLegislativa from sapl.parlamentares.models import Filiacao register = template.Library() @@ -124,7 +125,7 @@ def url(value): @register.filter -def cronometro_to_seconds(value): +def cronometro_to_seconds(value): if not AppConfig.attr('cronometro_' + value): return 0 @@ -137,3 +138,13 @@ def cronometro_to_seconds(value): @register.filter def to_list_pk(object_list): return [o.pk for o in object_list] + + +@register.filter +def search_get_model(object): + if type(object) == MateriaLegislativa: + return 'm' + elif type(object) == DocumentoAcessorio: + return 'd' + + return None diff --git a/sapl/base/urls.py b/sapl/base/urls.py index 361ab2cda..d5e4ae98a 100644 --- a/sapl/base/urls.py +++ b/sapl/base/urls.py @@ -99,4 +99,6 @@ urlpatterns = [ name='login'), url(r'^logout/$', views.logout, {'next_page': '/login'}, name='logout'), + url(r'^sistema/search/', include('haystack.urls')), + ] + recuperar_senha diff --git a/sapl/materia/apps.py b/sapl/materia/apps.py index 3ac053d1b..ecc8d09de 100644 --- a/sapl/materia/apps.py +++ b/sapl/materia/apps.py @@ -6,3 +6,6 @@ class AppConfig(apps.AppConfig): name = 'sapl.materia' label = 'materia' verbose_name = _('Matéria') + + def ready(self): + from . import signals diff --git a/sapl/materia/signals.py b/sapl/materia/signals.py new file mode 100644 index 000000000..96ff85dea --- /dev/null +++ b/sapl/materia/signals.py @@ -0,0 +1,29 @@ +from django.db.models.signals import post_delete, post_save +from sapl.settings import PROJECT_DIR +from subprocess import PIPE, call +from threading import Thread + + +from .models import MateriaLegislativa, DocumentoAcessorio + + +class UpdateIndexCommand(Thread): + def run(self): + call([PROJECT_DIR.child('manage.py'), 'update_index'], + stdout=PIPE) + + +def save_texto(sender, instance, **kwargs): + update_index = UpdateIndexCommand() + update_index.start() + + +def delete_texto(sender, instance, **kwargs): + update_index = UpdateIndexCommand() + update_index.start() + + +post_save.connect(save_texto, sender=MateriaLegislativa) +post_save.connect(save_texto, sender=DocumentoAcessorio) +post_delete.connect(delete_texto, sender=MateriaLegislativa) +post_delete.connect(delete_texto, sender=DocumentoAcessorio) diff --git a/sapl/settings.py b/sapl/settings.py index 37646e675..d9875994b 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -76,12 +76,23 @@ INSTALLED_APPS = ( 'crispy_forms', 'easy_thumbnails', 'floppyforms', + 'haystack', 'sass_processor', 'rest_framework', 'reversion', + 'whoosh', ) + SAPL_APPS + +HAYSTACK_CONNECTIONS = { + 'default': { + 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', + 'PATH': PROJECT_DIR.child('whoosh'), + }, +} + + if DEBUG: INSTALLED_APPS += ('debug_toolbar', 'rest_framework_docs',) diff --git a/sapl/templates/materia/materialegislativa_filter.html b/sapl/templates/materia/materialegislativa_filter.html index 639031d16..cd459c61c 100644 --- a/sapl/templates/materia/materialegislativa_filter.html +++ b/sapl/templates/materia/materialegislativa_filter.html @@ -4,6 +4,10 @@ {% block actions %}
+ + Pesquisa Textual + + {% if perms.materia %} {% blocktrans with verbose_name=view.verbose_name %} Adicionar Matéria Legislativa {% endblocktrans %} diff --git a/sapl/templates/search/indexes/materia/documentoacessorio_text.txt b/sapl/templates/search/indexes/materia/documentoacessorio_text.txt new file mode 100644 index 000000000..0f9218324 --- /dev/null +++ b/sapl/templates/search/indexes/materia/documentoacessorio_text.txt @@ -0,0 +1,7 @@ +{% for k, v in extracted.metadata.items %} + {% for val in v %} + {{ k }}: {{ val|safe }} + {% endfor %} +{% endfor %} + +{{ extracted|striptags|safe }} \ No newline at end of file diff --git a/sapl/templates/search/indexes/materia/materialegislativa_text.txt b/sapl/templates/search/indexes/materia/materialegislativa_text.txt new file mode 100644 index 000000000..0f9218324 --- /dev/null +++ b/sapl/templates/search/indexes/materia/materialegislativa_text.txt @@ -0,0 +1,7 @@ +{% for k, v in extracted.metadata.items %} + {% for val in v %} + {{ k }}: {{ val|safe }} + {% endfor %} +{% endfor %} + +{{ extracted|striptags|safe }} \ No newline at end of file diff --git a/sapl/templates/search/search.html b/sapl/templates/search/search.html new file mode 100644 index 000000000..bd925d37c --- /dev/null +++ b/sapl/templates/search/search.html @@ -0,0 +1,95 @@ +{% extends 'crud/form.html' %} +{% load crispy_forms_tags %} +{% load common_tags %} + +{% block base_content %} +

Pesquisa Textual

+ +
+ +
+
+ +
+
+ {{ form.q|as_crispy_field }} +
+
+ +
+
+
+

Em quais tipos de documento deseja pesquisar?

+
+
+ +
+
+ {{ form.models }} +
+
+ + +
+
+ +
+
+ +
+ +
+ {% if query %} + + + + + + {% for result in page.object_list %} + + + + + {% empty %} +

Nenhum texto encontrado!

+ + + + {% endfor %} +

Resultados

+ {% if result.object|search_get_model == 'm' %} +

+ Matéria Legislativa: {{ result.object }}
+ + {% if result.object.texto_original %} + Texto Original: Clique aqui
+ {% else %} + O texto desta matéria foi removido recentemente. Em breve ela sairá desta listagem.
+ {% endif %} +

+ + {% elif result.object|search_get_model == 'd' %} +

+ Documento Acessório: {{ result.object }}
+ {% if result.object.arquivo %} + Texto Original: Clique aqui
+ {% else %} + O texto deste documento foi removido recentemente. Em breve ele sairá desta listagem.
+ {% endif %} +

+ {% endif %} +
+
+ + {% if page.has_previous or page.has_next %} +
+ {% endif %} + {% else %} + {# Show some example queries to run, maybe query syntax, something else? #} + {% endif %} +
+{% endblock %} From 985a6eb3796ae92fdf8316b4e62d5be1983d0292 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Thu, 30 Mar 2017 15:55:24 -0300 Subject: [PATCH 034/140] =?UTF-8?q?Adiciona=20command=20para=20migra=C3=A7?= =?UTF-8?q?=C3=A3o=20de=20documentos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legacy/management/commands/migracao_documentos.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sapl/legacy/management/commands/migracao_documentos.py diff --git a/sapl/legacy/management/commands/migracao_documentos.py b/sapl/legacy/management/commands/migracao_documentos.py new file mode 100644 index 000000000..c096e2905 --- /dev/null +++ b/sapl/legacy/management/commands/migracao_documentos.py @@ -0,0 +1,11 @@ +from django.core.management.base import BaseCommand + +from sapl.legacy.migracao_documentos import migrar_documentos + + +class Command(BaseCommand): + + help = u'Migração documentos do SAPL 2.5 para o SAPL 3.1' + + def handle(self, *args, **options): + migrar_documentos() From 95227452ba4fcbe1f10eed0cfa1e33e33ddd764a Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 30 Mar 2017 14:41:32 -0300 Subject: [PATCH 035/140] Substitui tela amarela por mensagem de erro ao remover campo referenciado. --- sapl/crud/base.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sapl/crud/base.py b/sapl/crud/base.py index b70e7a54a..f33d610d5 100644 --- a/sapl/crud/base.py +++ b/sapl/crud/base.py @@ -840,6 +840,22 @@ class CrudDeleteView(PermissionRequiredContainerCrudMixin, def get_success_url(self): return self.list_url + def delete(self, request, *args, **kwargs): + try: + super(CrudDeleteView, self).delete(request, args, kwargs) + except models.ProtectedError as err: + error_msg = 'Registro não pode ser removido, pois\ + é referenciado por outros registros:
\ +
    ' + for i in err.protected_objects: + error_msg += '
  • ' + i.__str__() + '
  • ' + error_msg += '
' + + messages.add_message(request, + messages.ERROR, + error_msg) + return self.render_to_response(self.get_context_data()) + class Crud: BaseMixin = CrudBaseMixin From 5245b34e6a1b938cdb5c15ccda84023e9a52945f Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Fri, 24 Mar 2017 17:07:05 -0300 Subject: [PATCH 036/140] =?UTF-8?q?Corrige=20problema=20da=20exclus=C3=A3o?= =?UTF-8?q?=20de=20objetos=20protegidos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luciano Almeida --- sapl/legacy/migration.py | 38 +++++++++++----------- sapl/legacy/scripts/shell_para_migracao.sh | 1 + 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 379ac13ad..1342009b8 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -246,14 +246,12 @@ def recreate_constraints(): unique_constraints.clear() -def stub_desnecessario(obj): +def obj_desnecessario(obj): lista_fields = [ f for f in obj._meta.get_fields() - if (f.one_to_many or f.one_to_one) and f.auto_created - ] - desnecessario = not any( - rr.related_model.objects.filter(**{rr.field.name: obj}).exists() - for rr in lista_fields) + if (f.one_to_many or f.one_to_one) and f.auto_created] + desnecessario = not any(rr.related_model.objects.filter( + **{rr.field.name: obj}).exists() for rr in lista_fields) return desnecessario @@ -424,16 +422,25 @@ class DataMigrator: info('Deletando models com ind_excluido...') while self.to_delete: for obj in self.to_delete: - try: - obj.delete() - self.to_delete.remove(obj) - except ProtectedError: + if obj_desnecessario(obj): + try: + obj.delete() + self.to_delete.remove(obj) + except ProtectedError: + msg = 'A entrada de PK %s da model %s não pode ser ' \ + 'excluida' % (obj.pk, obj._meta.model_name) + descricao = 'Um ou mais objetos protegidos ' + warn(msg + ' => ' + descricao) + save_relation(obj=obj, problema=msg, + descricao=descricao, eh_stub=False) + else: msg = 'A entrada de PK %s da model %s não pode ser ' \ 'excluida' % (obj.pk, obj._meta.model_name) - descricao = 'Um ou mais objetos protegidos ' + descricao = 'Outros objetos dependem dessa entrada' warn(msg + ' => ' + descricao) save_relation(obj=obj, problema=msg, descricao=descricao, eh_stub=False) + self.to_delete.remove(obj) info('Deletando stubs desnecessários...') while self.delete_stubs(): @@ -468,13 +475,6 @@ class DataMigrator: legacy_model = legacy_app.get_model(legacy_model_name) legacy_pk_name = legacy_model._meta.pk.name - # Clear all model entries - # They may have been created in a previous migration attempt - try: - model.objects.all().delete() - except ProtectedError: - Proposicao.objects.all().delete() - model.objects.all().delete() delete_constraints(model) # setup migration strategy for tables with or without a pk @@ -520,7 +520,7 @@ class DataMigrator: if obj.content_object and obj.eh_stub: original = obj.content_type.get_all_objects_for_this_type( id=obj.object_id) - if stub_desnecessario(original[0]): + if obj_desnecessario(original[0]): qtd_exclusoes, *_ = original.delete() assert qtd_exclusoes == 1 qtd_exclusoes, *_ = obj.delete() diff --git a/sapl/legacy/scripts/shell_para_migracao.sh b/sapl/legacy/scripts/shell_para_migracao.sh index fb0f3c6de..5f5ea97b7 100755 --- a/sapl/legacy/scripts/shell_para_migracao.sh +++ b/sapl/legacy/scripts/shell_para_migracao.sh @@ -5,4 +5,5 @@ # Rode esse script a partir da raiz do projeto +DATABASE_NAME=$1 ./manage.py migrate --settings sapl.legacy_migration_settings DATABASE_NAME=$1 ./manage.py shell_plus --settings sapl.legacy_migration_settings From a0042b1700f85c83ffa3dd29b77b09f3ba4295d3 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Wed, 29 Mar 2017 16:32:56 -0300 Subject: [PATCH 037/140] =?UTF-8?q?Arruma=20loop=20infinto=20na=20prote?= =?UTF-8?q?=C3=A7=C3=A3o=20contra=20exclus=C3=A3o.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luciano Almeida --- sapl/legacy/migration.py | 66 +++++++++++----------- sapl/legacy/scripts/fix_tables.sql | 4 +- sapl/legacy/scripts/shell_para_migracao.sh | 1 - 3 files changed, 34 insertions(+), 37 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 1342009b8..5b326897f 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -26,7 +26,7 @@ from sapl.norma.models import (AssuntoNorma, NormaJuridica, TipoVinculoNormaJuridica) from sapl.parlamentares.models import Parlamentar from sapl.protocoloadm.models import Protocolo, StatusTramitacaoAdministrativo -from sapl.sessao.models import ExpedienteMateria, OrdemDia, SessaoPlenaria +from sapl.sessao.models import ExpedienteMateria, OrdemDia from sapl.settings import PROJECT_DIR from sapl.utils import normalize @@ -247,12 +247,12 @@ def recreate_constraints(): def obj_desnecessario(obj): - lista_fields = [ + relacoes = [ f for f in obj._meta.get_fields() if (f.one_to_many or f.one_to_one) and f.auto_created] - desnecessario = not any(rr.related_model.objects.filter( - **{rr.field.name: obj}).exists() for rr in lista_fields) - return desnecessario + sem_referencia = not any(rr.related_model.objects.filter( + **{rr.field.name: obj}).exists() for rr in relacoes) + return sem_referencia def get_last_value(model): @@ -413,34 +413,23 @@ class DataMigrator: return 0 info('Excluindo entradas antigas do banco.') call([PROJECT_DIR.child('manage.py'), 'flush', - '--settings=sapl.settings', '--database=default', '--no-input'], - stdout=PIPE) + '--database=default', '--no-input'], stdout=PIPE) info('Começando migração: %s...' % obj) self._do_migrate(obj) - # exclude logically deleted in legacy base + + # Itera várias vezes na lista excluindo o que for possível info('Deletando models com ind_excluido...') - while self.to_delete: - for obj in self.to_delete: - if obj_desnecessario(obj): - try: - obj.delete() - self.to_delete.remove(obj) - except ProtectedError: - msg = 'A entrada de PK %s da model %s não pode ser ' \ - 'excluida' % (obj.pk, obj._meta.model_name) - descricao = 'Um ou mais objetos protegidos ' - warn(msg + ' => ' + descricao) - save_relation(obj=obj, problema=msg, - descricao=descricao, eh_stub=False) - else: - msg = 'A entrada de PK %s da model %s não pode ser ' \ - 'excluida' % (obj.pk, obj._meta.model_name) - descricao = 'Outros objetos dependem dessa entrada' - warn(msg + ' => ' + descricao) - save_relation(obj=obj, problema=msg, - descricao=descricao, eh_stub=False) - self.to_delete.remove(obj) + while self.delete_ind_excluido(): + pass + # Salva o que não pôde ser excluido da lista no problema da migração + for obj in self.to_delete: + msg = 'A entrada de PK %s da model %s não pode ser ' \ + 'excluida' % (obj.pk, obj._meta.model_name) + descricao = 'Um ou mais objetos protegidos ' + warn(msg + ' => ' + descricao) + save_relation(obj=obj, problema=msg, + descricao=descricao, eh_stub=False) info('Deletando stubs desnecessários...') while self.delete_stubs(): @@ -514,6 +503,20 @@ class DataMigrator: if getattr(old, 'ind_excluido', False): self.to_delete.append(new) + def delete_ind_excluido(self): + excluidos = 0 + for obj in self.to_delete: + if obj_desnecessario(obj): + try: + obj.delete() + except ProtectedError: + pass + else: + self.to_delete.remove(obj) + excluidos += 1 + + return excluidos + def delete_stubs(self): excluidos = 0 for obj in ProblemaMigracao.objects.all(): @@ -589,10 +592,6 @@ def adjust_protocolo(new, old): new.numero = p['numero__max'] + 1 -def adjust_sessaoplenaria(new, old): - assert not old.tip_expediente - - def adjust_tipoproposicao(new, old): if old.ind_mat_ou_doc == 'M': new.tipo_conteudo_related = TipoMateriaLegislativa.objects.get( @@ -689,7 +688,6 @@ AJUSTE_ANTES_SALVAR = { Parlamentar: adjust_parlamentar, Participacao: adjust_participacao, Protocolo: adjust_protocolo, - SessaoPlenaria: adjust_sessaoplenaria, TipoProposicao: adjust_tipoproposicao, StatusTramitacao: adjust_statustramitacao, StatusTramitacaoAdministrativo: adjust_statustramitacaoadm, diff --git a/sapl/legacy/scripts/fix_tables.sql b/sapl/legacy/scripts/fix_tables.sql index a112775b5..479a2ed5e 100644 --- a/sapl/legacy/scripts/fix_tables.sql +++ b/sapl/legacy/scripts/fix_tables.sql @@ -1,5 +1,5 @@ -- Apaga as restrições somente para essa sessão -SET SESSION sql_mode = ''; +SELECT REPLACE(@@sql_mode,'STRICT_TRANS_TABLES,',''); -- Exclui procedures caso já existam DROP PROCEDURE IF EXISTS verifica_campos_proposicao; DROP PROCEDURE IF EXISTS verifica_campos_sessao_plenaria_presenca; @@ -9,7 +9,7 @@ CREATE PROCEDURE verifica_campos_proposicao() BEGIN IF NOT EXISTS (SELECT * FROM -- Procedure para criar campos cod_presenca_sessao (sendo a nova PK da tabela) e dat_sessao em sessao_plenaria_presenca CREATE PROCEDURE verifica_campos_sessao_plenaria_presenca() BEGIN IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='sessao_plenaria_presenca' AND column_name='cod_presenca_sessao') THEN ALTER TABLE sessao_plenaria_presenca DROP PRIMARY KEY, ADD cod_presenca_sessao INT AUTO_INCREMENT PRIMARY KEY FIRST; END IF; IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='sessao_plenaria_presenca' AND column_name='dat_sessao') THEN ALTER TABLE sessao_plenaria_presenca ADD COLUMN dat_sessao DATE NULL after cod_parlamentar; END IF; END; -- Procedure para criar tabela lexml_registro_provedor e lexml_registro_publicador -CREATE PROCEDURE cria_lexml_registro_provedor_e_publicador() BEGIN CREATE TABLE IF NOT EXISTS lexml_registro_publicador (cod_publicador INT AUTO_INCREMENT NOT NULL, id_publicador INT, nom_publicador VARCHAR(255), adm_email VARCHAR(50), sigla VARCHAR(255), nom_responsavel VARCHAR(255), tipo VARCHAR(50), id_responsavel INT, PRIMARY KEY (cod_publicador)); CREATE TABLE IF NOT EXISTS lexml_registro_provedor (cod_provedor INT AUTO_INCREMENT NOT NULL, id_provedor INT, nom_provedor VARCHAR(255), sgl_provedor VARCHAR(15), adm_email VARCHAR(50), nom_responsavel VARCHAR(255), tipo VARCHAR(50), id_responsavel INT, xml_provedor LONGTEXT, PRIMARY KEY (cod_provedor)); END; +CREATE PROCEDURE cria_lexml_registro_provedor_e_publicador() BEGIN IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='lexml_registro_publicador') THEN CREATE TABLE lexml_registro_publicador (cod_publicador INT AUTO_INCREMENT NOT NULL, id_publicador INT, nom_publicador VARCHAR(255), adm_email VARCHAR(50), sigla VARCHAR(255), nom_responsavel VARCHAR(255), tipo VARCHAR(50), id_responsavel INT, PRIMARY KEY (cod_publicador)); END IF; IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='lexml_registro_provedor') THEN CREATE TABLE lexml_registro_provedor (cod_provedor INT AUTO_INCREMENT NOT NULL, id_provedor INT, nom_provedor VARCHAR(255), sgl_provedor VARCHAR(15), adm_email VARCHAR(50), nom_responsavel VARCHAR(255), tipo VARCHAR(50), id_responsavel INT, xml_provedor LONGTEXT, PRIMARY KEY (cod_provedor)); END IF; END; -- Executa as procedures criadas acima CALL verifica_campos_proposicao; CALL verifica_campos_sessao_plenaria_presenca; diff --git a/sapl/legacy/scripts/shell_para_migracao.sh b/sapl/legacy/scripts/shell_para_migracao.sh index 5f5ea97b7..fb0f3c6de 100755 --- a/sapl/legacy/scripts/shell_para_migracao.sh +++ b/sapl/legacy/scripts/shell_para_migracao.sh @@ -5,5 +5,4 @@ # Rode esse script a partir da raiz do projeto -DATABASE_NAME=$1 ./manage.py migrate --settings sapl.legacy_migration_settings DATABASE_NAME=$1 ./manage.py shell_plus --settings sapl.legacy_migration_settings From 26b936de06235dd5d557e9c36dd468d0d14ce6a8 Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Mon, 3 Apr 2017 10:15:20 -0300 Subject: [PATCH 038/140] =?UTF-8?q?Impede=20o=20upload=20de=20arquivos=20s?= =?UTF-8?q?em=20extens=C3=A3o=20nome?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/base/search_indexes.py | 6 +++++- sapl/utils.py | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sapl/base/search_indexes.py b/sapl/base/search_indexes.py index 1bb379091..18401b868 100644 --- a/sapl/base/search_indexes.py +++ b/sapl/base/search_indexes.py @@ -1,8 +1,9 @@ +import os.path import textract +from django.template import Context, loader from haystack import indexes from sapl.materia.models import DocumentoAcessorio, MateriaLegislativa -from django.template import Context, loader class DocumentoAcessorioIndex(indexes.SearchIndex, indexes.Indexable): @@ -32,6 +33,9 @@ class DocumentoAcessorioIndex(indexes.SearchIndex, indexes.Indexable): except OSError: return self.prepared_data + if not os.path.splitext(arquivo.path)[1][:1]: + return self.prepared_data + extracted_data = textract.process( arquivo.path).decode( 'utf-8').replace('\n', ' ') diff --git a/sapl/utils.py b/sapl/utils.py index c40160958..3a857f337 100644 --- a/sapl/utils.py +++ b/sapl/utils.py @@ -1,5 +1,6 @@ import hashlib import logging +import os import re from datetime import date from functools import wraps @@ -364,6 +365,10 @@ TIPOS_IMG_PERMITIDOS = ( def fabrica_validador_de_tipos_de_arquivo(lista, nome): def restringe_tipos_de_arquivo(value): + if not os.path.splitext(value.path)[1][:1]: + raise ValidationError(_( + 'Não é possível fazer upload de arquivos sem extensão.')) + mime = magic.from_buffer(value.read(), mime=True) if mime not in lista: raise ValidationError(_('Tipo de arquivo não suportado')) @@ -371,6 +376,7 @@ def fabrica_validador_de_tipos_de_arquivo(lista, nome): restringe_tipos_de_arquivo.__name__ = nome return restringe_tipos_de_arquivo + restringe_tipos_de_arquivo_txt = fabrica_validador_de_tipos_de_arquivo( TIPOS_TEXTO_PERMITIDOS, 'restringe_tipos_de_arquivo_txt') restringe_tipos_de_arquivo_img = fabrica_validador_de_tipos_de_arquivo( @@ -382,6 +388,7 @@ def intervalos_tem_intersecao(a_inicio, a_fim, b_inicio, b_fim): menor_fim = min(a_fim, b_fim) return maior_inicio <= menor_fim + """ def permissoes(nome_grupo, app_label): lista_permissoes = [] From 886707899b0eb2e7e580ffcb11891250f0d2a5da Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Mon, 3 Apr 2017 11:01:17 -0300 Subject: [PATCH 039/140] Implementa pesquisa textual para Normas Juridicas --- sapl/base/search_indexes.py | 9 +++++++ sapl/base/templatetags/common_tags.py | 3 +++ sapl/norma/apps.py | 3 +++ sapl/norma/models.py | 6 +++-- sapl/norma/signals.py | 27 +++++++++++++++++++ .../indexes/norma/normajuridica_text.txt | 7 +++++ sapl/templates/search/search.html | 10 +++++++ 7 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 sapl/norma/signals.py create mode 100644 sapl/templates/search/indexes/norma/normajuridica_text.txt diff --git a/sapl/base/search_indexes.py b/sapl/base/search_indexes.py index 18401b868..1b2944f48 100644 --- a/sapl/base/search_indexes.py +++ b/sapl/base/search_indexes.py @@ -4,6 +4,7 @@ import textract from django.template import Context, loader from haystack import indexes from sapl.materia.models import DocumentoAcessorio, MateriaLegislativa +from sapl.norma.models import NormaJuridica class DocumentoAcessorioIndex(indexes.SearchIndex, indexes.Indexable): @@ -60,3 +61,11 @@ class MateriaLegislativaIndex(DocumentoAcessorioIndex): filename = 'texto_original' model = MateriaLegislativa template_name = 'materia/materialegislativa_text.txt' + + +class NormaJuridicaIndex(DocumentoAcessorioIndex): + text = indexes.CharField(document=True, use_template=True) + + filename = 'texto_integral' + model = NormaJuridica + template_name = 'norma/normajuridica_text.txt' diff --git a/sapl/base/templatetags/common_tags.py b/sapl/base/templatetags/common_tags.py index a908b7396..419899632 100644 --- a/sapl/base/templatetags/common_tags.py +++ b/sapl/base/templatetags/common_tags.py @@ -3,6 +3,7 @@ from django import template from sapl.base.models import AppConfig from sapl.materia.models import DocumentoAcessorio, MateriaLegislativa +from sapl.norma.models import NormaJuridica from sapl.parlamentares.models import Filiacao register = template.Library() @@ -146,5 +147,7 @@ def search_get_model(object): return 'm' elif type(object) == DocumentoAcessorio: return 'd' + elif type(object) == NormaJuridica: + return 'n' return None diff --git a/sapl/norma/apps.py b/sapl/norma/apps.py index effd4f271..c4d55ade0 100644 --- a/sapl/norma/apps.py +++ b/sapl/norma/apps.py @@ -6,3 +6,6 @@ class AppConfig(apps.AppConfig): name = 'sapl.norma' label = 'norma' verbose_name = _('Norma Jurídica') + + def ready(self): + from . import signals diff --git a/sapl/norma/models.py b/sapl/norma/models.py index 24e56dcb9..20b59956f 100644 --- a/sapl/norma/models.py +++ b/sapl/norma/models.py @@ -7,7 +7,8 @@ from model_utils import Choices from sapl.compilacao.models import TextoArticulado from sapl.materia.models import MateriaLegislativa -from sapl.utils import RANGE_ANOS, YES_NO_CHOICES, texto_upload_path +from sapl.utils import (RANGE_ANOS, YES_NO_CHOICES, texto_upload_path, + restringe_tipos_de_arquivo_txt) @reversion.register() @@ -70,7 +71,8 @@ class NormaJuridica(models.Model): blank=True, null=True, upload_to=texto_upload_path, - verbose_name=_('Texto Integral')) + verbose_name=_('Texto Integral'), + validators=[restringe_tipos_de_arquivo_txt]) tipo = models.ForeignKey( TipoNormaJuridica, on_delete=models.PROTECT, diff --git a/sapl/norma/signals.py b/sapl/norma/signals.py new file mode 100644 index 000000000..fc16f89b4 --- /dev/null +++ b/sapl/norma/signals.py @@ -0,0 +1,27 @@ +from django.db.models.signals import post_delete, post_save +from sapl.settings import PROJECT_DIR +from subprocess import PIPE, call +from threading import Thread + + +from .models import NormaJuridica + + +class UpdateIndexCommand(Thread): + def run(self): + call([PROJECT_DIR.child('manage.py'), 'update_index'], + stdout=PIPE) + + +def save_texto(sender, instance, **kwargs): + update_index = UpdateIndexCommand() + update_index.start() + + +def delete_texto(sender, instance, **kwargs): + update_index = UpdateIndexCommand() + update_index.start() + + +post_save.connect(save_texto, sender=NormaJuridica) +post_delete.connect(delete_texto, sender=NormaJuridica) diff --git a/sapl/templates/search/indexes/norma/normajuridica_text.txt b/sapl/templates/search/indexes/norma/normajuridica_text.txt new file mode 100644 index 000000000..0f9218324 --- /dev/null +++ b/sapl/templates/search/indexes/norma/normajuridica_text.txt @@ -0,0 +1,7 @@ +{% for k, v in extracted.metadata.items %} + {% for val in v %} + {{ k }}: {{ val|safe }} + {% endfor %} +{% endfor %} + +{{ extracted|striptags|safe }} \ No newline at end of file diff --git a/sapl/templates/search/search.html b/sapl/templates/search/search.html index bd925d37c..4efae2cc5 100644 --- a/sapl/templates/search/search.html +++ b/sapl/templates/search/search.html @@ -68,6 +68,16 @@ O texto deste documento foi removido recentemente. Em breve ele sairá desta listagem.
{% endif %}

+ + {% elif result.object|search_get_model == 'n' %} +

+ Norma Jurídica: {{ result.object }}
+ {% if result.object.texto_integral %} + Texto Original: Clique aqui
+ {% else %} + O texto desta norma foi removido recentemente. Em breve ela sairá desta listagem.
+ {% endif %} +

{% endif %} From 2e2112b60c0e799a63d145cbbf1251c2d641a940 Mon Sep 17 00:00:00 2001 From: LeandroRoberto Date: Mon, 3 Apr 2017 11:25:46 -0300 Subject: [PATCH 040/140] Corrige url_tag e campo em model DocumentoAcessorio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No Sapl 2.5, a tabela documento_acessorio, campo nom_documento possui tamanho 50 e não 30. Em testes de migração em minha base ocorreram erros devido a diferença. Veja aqui o sql de instalação 2.5 https://colab.interlegis.leg.br/browser/publico/ILSAPL/trunk/instalacao/sapl.sql#L469. --- .../migrations/0002_auto_20170330_1513.py | 20 +++++++++++++++++++ sapl/materia/models.py | 5 +++-- sapl/norma/urls.py | 2 +- .../norma/normarelacionada_form.html | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 sapl/materia/migrations/0002_auto_20170330_1513.py diff --git a/sapl/materia/migrations/0002_auto_20170330_1513.py b/sapl/materia/migrations/0002_auto_20170330_1513.py new file mode 100644 index 000000000..72345fc62 --- /dev/null +++ b/sapl/materia/migrations/0002_auto_20170330_1513.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-30 15:13 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('materia', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='documentoacessorio', + name='nome', + field=models.CharField(max_length=50, verbose_name='Nome'), + ), + ] diff --git a/sapl/materia/models.py b/sapl/materia/models.py index 372efadf0..2f3ee70c3 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -1,6 +1,5 @@ from datetime import datetime -import reversion from django.contrib.auth.models import Group from django.contrib.contenttypes.fields import GenericRelation from django.contrib.contenttypes.models import ContentType @@ -8,6 +7,7 @@ from django.db import models from django.utils import formats from django.utils.translation import ugettext_lazy as _ from model_utils import Choices +import reversion from sapl.base.models import Autor from sapl.comissoes.models import Comissao @@ -18,6 +18,7 @@ from sapl.utils import (RANGE_ANOS, YES_NO_CHOICES, SaplGenericForeignKey, SaplGenericRelation, restringe_tipos_de_arquivo_txt, texto_upload_path) + EM_TRAMITACAO = [(1, 'Sim'), (0, 'Não')] @@ -361,7 +362,7 @@ class DocumentoAcessorio(models.Model): tipo = models.ForeignKey(TipoDocumento, on_delete=models.PROTECT, verbose_name=_('Tipo')) - nome = models.CharField(max_length=30, verbose_name=_('Nome')) + nome = models.CharField(max_length=50, verbose_name=_('Nome')) data = models.DateField(blank=True, null=True, verbose_name=_('Data')) autor = models.CharField( max_length=50, blank=True, verbose_name=_('Autor')) diff --git a/sapl/norma/urls.py b/sapl/norma/urls.py index 4d434d42b..abf13c276 100644 --- a/sapl/norma/urls.py +++ b/sapl/norma/urls.py @@ -24,6 +24,6 @@ urlpatterns = [ url(r'^norma/pesquisar$', NormaPesquisaView.as_view(), name='norma_pesquisa'), - url(r'^norma/recuperar-norma/', recuperar_norma), + url(r'^norma/recuperar-norma$', recuperar_norma, name="recuperar_norma"), ] diff --git a/sapl/templates/norma/normarelacionada_form.html b/sapl/templates/norma/normarelacionada_form.html index 300f7e3b3..7fbd03c45 100644 --- a/sapl/templates/norma/normarelacionada_form.html +++ b/sapl/templates/norma/normarelacionada_form.html @@ -11,7 +11,7 @@ var ano = $("#id_ano").val() if (tipo && numero && ano) { - $.get("/norma/recuperar-norma",{tipo: tipo, + $.get("{% url 'sapl.norma:recuperar_norma' %}",{tipo: tipo, numero: numero, ano: ano}, function(data, status) { From 402cb7725a204a31c155b37f166c5e29e54fd1e5 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 3 Apr 2017 12:45:32 -0300 Subject: [PATCH 041/140] HOT-FIX: conserta retorno de DeleteView no CRUD --- sapl/crud/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sapl/crud/base.py b/sapl/crud/base.py index f33d610d5..fc735570d 100644 --- a/sapl/crud/base.py +++ b/sapl/crud/base.py @@ -843,6 +843,7 @@ class CrudDeleteView(PermissionRequiredContainerCrudMixin, def delete(self, request, *args, **kwargs): try: super(CrudDeleteView, self).delete(request, args, kwargs) + return self.list_url except models.ProtectedError as err: error_msg = 'Registro não pode ser removido, pois\ é referenciado por outros registros:
\ From eaf5389f256a54d1d76ad022c5be922d768ef2e4 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 3 Apr 2017 12:51:07 -0300 Subject: [PATCH 042/140] =?UTF-8?q?Solu=C3=A7=C3=A3o=20correta=20para=20De?= =?UTF-8?q?leteView=20em=20CRUD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/crud/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sapl/crud/base.py b/sapl/crud/base.py index fc735570d..b2223c31f 100644 --- a/sapl/crud/base.py +++ b/sapl/crud/base.py @@ -842,8 +842,7 @@ class CrudDeleteView(PermissionRequiredContainerCrudMixin, def delete(self, request, *args, **kwargs): try: - super(CrudDeleteView, self).delete(request, args, kwargs) - return self.list_url + return super(CrudDeleteView, self).delete(request, args, kwargs) except models.ProtectedError as err: error_msg = 'Registro não pode ser removido, pois\ é referenciado por outros registros:
\ From 36e101db9da8af7685811ce69384eee7b9f3615b Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Mon, 3 Apr 2017 13:09:57 -0300 Subject: [PATCH 043/140] Fix #987 --- sapl/norma/forms.py | 2 +- sapl/templates/base.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sapl/norma/forms.py b/sapl/norma/forms.py index 932431d0d..af2b8b38b 100644 --- a/sapl/norma/forms.py +++ b/sapl/norma/forms.py @@ -143,7 +143,7 @@ class NormaJuridicaForm(ModelForm): if texto_integral: if texto_integral.size > MAX_DOC_UPLOAD_SIZE: raise ValidationError("Arquivo muito grande. ( > 5mb )") - return texto_integral + return texto_integral def save(self, commit=False): norma = self.instance diff --git a/sapl/templates/base.html b/sapl/templates/base.html index 450a97799..a96815f62 100644 --- a/sapl/templates/base.html +++ b/sapl/templates/base.html @@ -55,7 +55,7 @@ -
  • +
  • {% if not user.is_authenticated %}
  • {% else %} From 550009276bc71eaadf277b18c5079f6d32de0393 Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Mon, 3 Apr 2017 14:42:25 -0300 Subject: [PATCH 044/140] Adiciona botao de pesquisa textual em Pesquisa de Normas --- sapl/templates/norma/normajuridica_filter.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sapl/templates/norma/normajuridica_filter.html b/sapl/templates/norma/normajuridica_filter.html index 8350f19e7..7c5d50e42 100644 --- a/sapl/templates/norma/normajuridica_filter.html +++ b/sapl/templates/norma/normajuridica_filter.html @@ -4,6 +4,11 @@ {% block actions %}
    + + Pesquisa Textual + + + {% if perms.norma.add_normajuridica %} {% blocktrans with verbose_name=view.verbose_name %} Adicionar Norma Jurídica {% endblocktrans %} From b87f13a06b5db6a78dea6ed84f78ae696db0f4cb Mon Sep 17 00:00:00 2001 From: Matheus Veleci Date: Tue, 4 Apr 2017 14:31:30 -0300 Subject: [PATCH 045/140] altera README.rst --- README.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/README.rst b/README.rst index 539934ce2..1b9a45fc1 100644 --- a/README.rst +++ b/README.rst @@ -55,7 +55,6 @@ Logo dos Partidos `Logo dos Partidos `_ - Perguntas Frequentes =================================== `Perguntas Frequentes `_ From 9537a9c02f3bc3fa56e52669ef22abade9457ee3 Mon Sep 17 00:00:00 2001 From: eduardocalil Date: Tue, 4 Apr 2017 18:16:49 -0300 Subject: [PATCH 046/140] Fix #990 assunto materia (#991) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Inicia a adição de assuntos a materias * Finaliza pesquisa por assunto * Bug fix * Adiciona verbose names --- sapl/materia/forms.py | 21 +++++++++-- .../migrations/0003_auto_20170403_1505.py | 25 +++++++++++++ sapl/materia/models.py | 20 ++++++++--- sapl/materia/urls.py | 7 +++- sapl/materia/views.py | 36 +++++++++++++++++-- .../migrations/0002_auto_20170403_1505.py | 21 +++++++++++ sapl/templates/materia/layouts.yaml | 10 ++++++ sapl/templates/materia/subnav.yaml | 2 ++ sapl/templates/sistema.html | 1 + 9 files changed, 133 insertions(+), 10 deletions(-) create mode 100644 sapl/materia/migrations/0003_auto_20170403_1505.py create mode 100644 sapl/norma/migrations/0002_auto_20170403_1505.py diff --git a/sapl/materia/forms.py b/sapl/materia/forms.py index e1fda4119..7c0b6d8c8 100644 --- a/sapl/materia/forms.py +++ b/sapl/materia/forms.py @@ -29,7 +29,8 @@ from sapl.compilacao.models import (STATUS_TA_IMMUTABLE_PUBLIC, STATUS_TA_PRIVATE) from sapl.crispy_layout_mixin import (SaplFormLayout, form_actions, to_column, to_row) -from sapl.materia.models import (MateriaLegislativa, RegimeTramitacao, +from sapl.materia.models import (AssuntoMateria, MateriaAssunto, + MateriaLegislativa, RegimeTramitacao, TipoDocumento, TipoProposicao) from sapl.norma.models import (LegislacaoCitada, NormaJuridica, TipoNormaJuridica) @@ -493,6 +494,10 @@ class MateriaLegislativaFilterSet(django_filters.FilterSet): label=u'Em tramitação', choices=em_tramitacao) + materiaassunto__assunto = django_filters.ModelChoiceFilter( + queryset=AssuntoMateria.objects.all(), + label=_('Assunto da Matéria')) + o = MateriaPesquisaOrderingFilter() class Meta: @@ -509,6 +514,7 @@ class MateriaLegislativaFilterSet(django_filters.FilterSet): 'local_origem_externa', 'tramitacao__unidade_tramitacao_destino', 'tramitacao__status', + 'materiaassunto__assunto', 'em_tramitacao', ] @@ -551,6 +557,8 @@ class MateriaLegislativaFilterSet(django_filters.FilterSet): [('em_tramitacao', 6), ('o', 6)]) row9 = to_row( + [('materiaassunto__assunto', 12)]) + row10 = to_row( [('ementa', 12)]) self.form.helper = FormHelper() @@ -560,7 +568,7 @@ class MateriaLegislativaFilterSet(django_filters.FilterSet): row1, row2, row3, HTML(autor_label), HTML(autor_modal), - row4, row5, row6, row7, row8, row9, + row4, row5, row6, row7, row8, row9, row10, form_actions(save_label='Pesquisar')) ) @@ -1430,3 +1438,12 @@ class ConfirmarProposicaoForm(ProposicaoForm): conteudo_gerado.save() return self.instance + + +class MateriaAssuntoForm(ModelForm): + + class Meta: + model = MateriaAssunto + fields = ['materia', 'assunto'] + + widgets = {'materia': forms.HiddenInput()} diff --git a/sapl/materia/migrations/0003_auto_20170403_1505.py b/sapl/materia/migrations/0003_auto_20170403_1505.py new file mode 100644 index 000000000..fcd7b8eb0 --- /dev/null +++ b/sapl/materia/migrations/0003_auto_20170403_1505.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2017-04-03 15:05 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('materia', '0002_auto_20170330_1513'), + ] + + operations = [ + migrations.AlterField( + model_name='assuntomateria', + name='assunto', + field=models.CharField(max_length=50, verbose_name='Assunto'), + ), + migrations.AlterField( + model_name='assuntomateria', + name='dispositivo', + field=models.CharField(blank=True, max_length=200, null=True, verbose_name='Descrição do Dispositivo Legal'), + ), + ] diff --git a/sapl/materia/models.py b/sapl/materia/models.py index 2f3ee70c3..aed36d3df 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -307,8 +307,14 @@ class Anexada(models.Model): @reversion.register() class AssuntoMateria(models.Model): - assunto = models.CharField(max_length=200) - dispositivo = models.CharField(max_length=50) + assunto = models.CharField( + max_length=50, + verbose_name=_('Assunto')) + dispositivo = models.CharField( + max_length=200, + null=True, + blank=True, + verbose_name=_('Descrição do Dispositivo Legal')) class Meta: verbose_name = _('Assunto de Matéria') @@ -414,8 +420,14 @@ class DocumentoAcessorio(models.Model): @reversion.register() class MateriaAssunto(models.Model): # TODO M2M ?? - assunto = models.ForeignKey(AssuntoMateria, on_delete=models.PROTECT) - materia = models.ForeignKey(MateriaLegislativa, on_delete=models.PROTECT) + assunto = models.ForeignKey( + AssuntoMateria, + on_delete=models.PROTECT, + verbose_name=_('Assunto')) + materia = models.ForeignKey( + MateriaLegislativa, + on_delete=models.PROTECT, + verbose_name=_('Matéria')) class Meta: verbose_name = _('Relação Matéria - Assunto') diff --git a/sapl/materia/urls.py b/sapl/materia/urls.py index 9f774a3d3..1de8cd689 100644 --- a/sapl/materia/urls.py +++ b/sapl/materia/urls.py @@ -4,11 +4,13 @@ from sapl.materia.views import (AcompanhamentoConfirmarView, AcompanhamentoExcluirView, AcompanhamentoMateriaView, AdicionarVariasAutorias, AnexadaCrud, + AssuntoMateriaCrud, AutoriaCrud, ConfirmarProposicao, CriarProtocoloMateriaView, DespachoInicialCrud, DocumentoAcessorioCrud, DocumentoAcessorioEmLoteView, - LegislacaoCitadaCrud, MateriaLegislativaCrud, + LegislacaoCitadaCrud, MateriaAssuntoCrud, + MateriaLegislativaCrud, MateriaLegislativaPesquisaView, MateriaTaView, NumeracaoCrud, OrgaoCrud, OrigemCrud, PrimeiraTramitacaoEmLoteView, ProposicaoCrud, @@ -31,6 +33,7 @@ urlpatterns_materia = [ AnexadaCrud.get_urls() + AutoriaCrud.get_urls() + DespachoInicialCrud.get_urls() + + MateriaAssuntoCrud.get_urls() + NumeracaoCrud.get_urls() + LegislacaoCitadaCrud.get_urls() + TramitacaoCrud.get_urls() + @@ -97,6 +100,8 @@ urlpatterns_proposicao = [ ] urlpatterns_sistema = [ + url(r'^sistema/assunto-materia', + include(AssuntoMateriaCrud.get_urls())), url(r'^sistema/proposicao/tipo/', include(TipoProposicaoCrud.get_urls())), url(r'^sistema/materia/tipo/', include(TipoMateriaCrud.get_urls())), diff --git a/sapl/materia/views.py b/sapl/materia/views.py index e8331e469..305b4b7b0 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -43,19 +43,24 @@ from sapl.utils import (TURNO_TRAMITACAO_CHOICES, YES_NO_CHOICES, autor_label, from .forms import (AcessorioEmLoteFilterSet, AcompanhamentoMateriaForm, AdicionarVariasAutoriasFilterSet, DespachoInicialForm, - DocumentoAcessorioForm, MateriaLegislativaFilterSet, + DocumentoAcessorioForm, + MateriaAssuntoForm, MateriaLegislativaFilterSet, MateriaSimplificadaForm, PrimeiraTramitacaoEmLoteFilterSet, ReceberProposicaoForm, RelatoriaForm, TramitacaoEmLoteFilterSet, filtra_tramitacao_destino, filtra_tramitacao_destino_and_status, filtra_tramitacao_status) -from .models import (AcompanhamentoMateria, Anexada, Autoria, DespachoInicial, - DocumentoAcessorio, MateriaLegislativa, Numeracao, Orgao, +from .models import (AssuntoMateria, AcompanhamentoMateria, + Anexada, Autoria, DespachoInicial, + DocumentoAcessorio, MateriaLegislativa, + MateriaAssunto, Numeracao, Orgao, Origem, Proposicao, RegimeTramitacao, Relatoria, StatusTramitacao, TipoDocumento, TipoFimRelatoria, TipoMateriaLegislativa, TipoProposicao, Tramitacao, UnidadeTramitacao) +AssuntoMateriaCrud = Crud.build(AssuntoMateria, 'assunto_materia') + OrigemCrud = Crud.build(Origem, '') TipoMateriaCrud = CrudAux.build( @@ -1110,6 +1115,31 @@ class AnexadaCrud(MasterDetailCrud): return 'AnexadaDetail' +class MateriaAssuntoCrud(MasterDetailCrud): + model = MateriaAssunto + parent_field = 'materia' + help_path = '' + public = [RP_LIST, RP_DETAIL] + + class BaseMixin(MasterDetailCrud.BaseMixin): + list_field_names = ['assunto', 'materia'] + + class CreateView(MasterDetailCrud.CreateView): + form_class = MateriaAssuntoForm + + def get_initial(self): + self.initial['materia'] = self.kwargs['pk'] + return self.initial + + class UpdateView(MasterDetailCrud.UpdateView): + form_class = MateriaAssuntoForm + + def get_initial(self): + self.initial['materia'] = self.get_object().materia + self.initial['assunto'] = self.get_object().assunto + return self.initial + + class MateriaLegislativaCrud(Crud): model = MateriaLegislativa help_path = 'materia_legislativa' diff --git a/sapl/norma/migrations/0002_auto_20170403_1505.py b/sapl/norma/migrations/0002_auto_20170403_1505.py new file mode 100644 index 000000000..002aa0e11 --- /dev/null +++ b/sapl/norma/migrations/0002_auto_20170403_1505.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2017-04-03 15:05 +from __future__ import unicode_literals + +from django.db import migrations, models +import sapl.utils + + +class Migration(migrations.Migration): + + dependencies = [ + ('norma', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='normajuridica', + name='texto_integral', + field=models.FileField(blank=True, null=True, upload_to=sapl.utils.texto_upload_path, validators=[sapl.utils.restringe_tipos_de_arquivo_txt], verbose_name='Texto Integral'), + ), + ] diff --git a/sapl/templates/materia/layouts.yaml b/sapl/templates/materia/layouts.yaml index 99b91afa3..6045d61d9 100644 --- a/sapl/templates/materia/layouts.yaml +++ b/sapl/templates/materia/layouts.yaml @@ -36,6 +36,16 @@ MateriaLegislativa: - indexacao - observacao +AssuntoMateria: + {% trans 'Assunto de Matéria Legislativa' %}: + - assunto + - dispositivo + +MateriaAssunto: + {% trans 'Assuntos da Matéria' %}: + - assunto + - materia + Anexada: {% trans 'Matéria Anexada' %}: - tipo numero ano diff --git a/sapl/templates/materia/subnav.yaml b/sapl/templates/materia/subnav.yaml index d59930cc4..c2ea4cd71 100644 --- a/sapl/templates/materia/subnav.yaml +++ b/sapl/templates/materia/subnav.yaml @@ -3,6 +3,8 @@ url: materialegislativa_detail - title: {% trans 'Anexada' %} url: anexada_list +- title: {% trans 'Assunto' %} + url: materiaassunto_list - title: {% trans 'Autoria' %} url: autoria_list - title: {% trans 'Despacho Inicial' %} diff --git a/sapl/templates/sistema.html b/sapl/templates/sistema.html index cc6cddfc0..99b9c7062 100644 --- a/sapl/templates/sistema.html +++ b/sapl/templates/sistema.html @@ -64,6 +64,7 @@ +

    From 035e8b05111a8ce8f823044937029a5fa856c63a Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 4 Apr 2017 18:22:45 -0300 Subject: [PATCH 047/140] Tira null de campo string. --- sapl/materia/models.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sapl/materia/models.py b/sapl/materia/models.py index aed36d3df..6b48613ee 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -312,7 +312,6 @@ class AssuntoMateria(models.Model): verbose_name=_('Assunto')) dispositivo = models.CharField( max_length=200, - null=True, blank=True, verbose_name=_('Descrição do Dispositivo Legal')) From ae119261d5ea9acfcc010ee704f4aed258e2db72 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Wed, 5 Apr 2017 16:58:34 -0300 Subject: [PATCH 048/140] Adiciona o CLI utility pipdeptree ao dev-requirements --- requirements/dev-requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/dev-requirements.txt b/requirements/dev-requirements.txt index 89b119a7f..666075b6f 100644 --- a/requirements/dev-requirements.txt +++ b/requirements/dev-requirements.txt @@ -6,3 +6,4 @@ ipdb==0.10.1 pip-review==0.4 pygraphviz==1.3.1 pytest-ipdb==0.1-prerelease2 +pipdeptree From 7f7aeaf9dc099a0a28fb17f3975e917195e39992 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 6 Apr 2017 10:57:47 -0300 Subject: [PATCH 049/140] =?UTF-8?q?Conserta=20quebra=20de=20linha=20em=20r?= =?UTF-8?q?elat=C3=B3rio=20de=20sess=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/relatorios/views.py | 4 +--- sapl/sessao/views.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index cb402bd84..dacd39f49 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -1,6 +1,5 @@ from datetime import datetime -from bs4 import BeautifulSoup from django.core.exceptions import ObjectDoesNotExist from django.http import Http404, HttpResponse from django.utils.translation import ugettext_lazy as _ @@ -525,8 +524,7 @@ def get_sessao_plenaria(sessao, casa): sessao_plenaria=sessao, tipo=tip_expediente): dic_expedientes = {} dic_expedientes["nom_expediente"] = str(tip_expediente) - dic_expedientes["txt_expediente"] = ( - BeautifulSoup(expediente.conteudo).text) + dic_expedientes["txt_expediente"] = (expediente.conteudo) if dic_expedientes: lst_expedientes.append(dic_expedientes) diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 372cbff7e..fedc8829e 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -924,13 +924,13 @@ class ResumoView(DetailView): context.update({'multimidia_audio': _('Audio: ') + str(self.object.url_audio)}) else: - context.update({'multimidia_audio': _('Audio: Indisponivel')}) + context.update({'multimidia_audio': _('Audio: Indisponível')}) if self.object.url_video: context.update({'multimidia_video': _('Video: ') + str(self.object.url_video)}) else: - context.update({'multimidia_video': _('Video: Indisponivel')}) + context.update({'multimidia_video': _('Video: Indisponível')}) # ===================================================================== # Mesa Diretora From 4126cb6df56d483c6afe6d0e1da5daa56b2dfa46 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 6 Apr 2017 11:20:25 -0300 Subject: [PATCH 050/140] =?UTF-8?q?Conserta=20bug=20que=20pegava=20integra?= =?UTF-8?q?ntes=20da=20Casa=20ao=20inv=C3=A9s=20de=20integrantes=20da=20Me?= =?UTF-8?q?sa=20da=20Sess=C3=A3o=20Plen=C3=A1ria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/relatorios/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index dacd39f49..53b9ef54b 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -12,7 +12,8 @@ from sapl.parlamentares.models import (CargoMesa, ComposicaoMesa, Filiacao, Parlamentar) from sapl.protocoloadm.models import (DocumentoAdministrativo, Protocolo, TramitacaoAdministrativo) -from sapl.sessao.models import (ExpedienteMateria, ExpedienteSessao, Orador, +from sapl.sessao.models import (ExpedienteMateria, ExpedienteSessao, + IntegranteMesa, Orador, OradorExpediente, OrdemDia, PresencaOrdemDia, RegistroVotacao, SessaoPlenaria, SessaoPlenariaPresenca, TipoExpediente) @@ -484,8 +485,7 @@ def get_sessao_plenaria(sessao, casa): # Lista da composicao da mesa diretora lst_mesa = [] - for composicao in ComposicaoMesa.objects.filter( - sessao_legislativa=sessao.sessao_legislativa): + for composicao in IntegranteMesa.objects.filter(sessao_plenaria=sessao): for parlamentar in Parlamentar.objects.filter( id=composicao.parlamentar.id): for cargo in CargoMesa.objects.filter(id=composicao.cargo.id): From c8c8040d35bfc9979faeb8d231a573a15b71bf51 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Thu, 6 Apr 2017 17:28:35 -0300 Subject: [PATCH 051/140] =?UTF-8?q?Documenta=20migra=C3=A7=C3=A3o=20de=20d?= =?UTF-8?q?ocumentos=20de=202.5=20p=203.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #971 --- docs/importacao_25_31.rst | 55 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/docs/importacao_25_31.rst b/docs/importacao_25_31.rst index 62850d1bc..ba6f48a34 100644 --- a/docs/importacao_25_31.rst +++ b/docs/importacao_25_31.rst @@ -25,7 +25,58 @@ o conteúdo do arquivo será semelhante a isso:: Posteriormente rodar a seguinte sequencia de comandos estando no ambiente virtual:: ./manage.py shell --settings=sapl.legacy_migration_settings - + %run sapl/legacy/migration.py - + migrate() + + +Migração de documentos do sapl 2.5 +---------------------------------- + +No sapl 2.5 todos os documentos ficavam armazenados no ZODB (o banco do Zope). +No sapl 3.1 eles ficam no sistema de arquivos convencional e portanto precisam: + +1. ser exportados para o sistema de arquivos +2. ser vinculados ao novo banco importado para o sapl 3.1 + + +Exportar os documentos para o sistema de arquivos +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Siga os seguintes passos: + +1. Instale o `Products.FSDump` no sapl 2.5. + + Para isso basta colocar a pasta `Products/FSDump` do projeto https://github.com/zopefoundation/Products.FSDump na pasta `Products` da instalação do sapl 2.5 e reiniciar o Zope. + + A pasta a ser instalada é a seguinte: + https://github.com/zopefoundation/Products.FSDump/tree/master/Products/FSDump + +2. Na ZMI, na pasta `sapl_documentos`, adicione um objeto do tipo `Dumper`: + + - Em `Filesystem path` escolha uma pasta do sistema de arquivos local para onde os arquivos serão copiados + - Desmarque a opção `Use .metadata file` + - Clique no botão `Add` + +3. Use o objeto `Dumper` criado para exportar os arquivos: + + - Clique no objeto `Dumper` criado para ver suas opções + - Confira seus parametros e clique em `Change and Dump` + - Aguarde a exportação dos arquivos e verifique que foram copiados para a pasta indicada + + +Vincular os documentos ao novo banco do sapl 3.1 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +1. Primeiramente migre o banco do sapl 2.5 para o sapl 3.1 + +2. Copie a pasta exportada `sapl_documentos` dentro da pasta `media` da instalação do sapl 3.1 + +3. De forma semelhante ao realizado na migração do banco, dentro no mesmo ambiente virtual, rode os seguintes comandos:: + + ./manage.py shell --settings=sapl.legacy_migration_settings + + %run sapl/legacy/migracao_documentos.py + + migrar_documentos() From fc333ec82727f9ca7cf00fefb3ae4c6d3569197e Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 7 Apr 2017 12:46:40 -0300 Subject: [PATCH 052/140] =?UTF-8?q?Habilita=20pks=20negativas=20na=20migra?= =?UTF-8?q?=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #951 --- sapl/legacy/migration.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 5b326897f..99d14f8a7 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -262,7 +262,8 @@ def get_last_value(model): def alter_sequence(model, id): sequence_name = '%s_id_seq' % model._meta.db_table - exec_sql('ALTER SEQUENCE %s RESTART WITH %s;' % (sequence_name, id)) + exec_sql('ALTER SEQUENCE %s RESTART WITH %s MINVALUE %s;' % ( + sequence_name, id, id)) def save_with_id(new, id): From c3dbe8b1be4e37bac9f244446b3c04144087a7db Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 10 Apr 2017 12:23:40 -0300 Subject: [PATCH 053/140] =?UTF-8?q?Atualiza=20vers=C3=A3o=20do=20trml2pdf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 6d7592cda..3a0e5b446 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -19,7 +19,7 @@ django-sass-processor==0.4.6 djangorestframework drfdocs easy-thumbnails==2.3 -git+git://github.com/interlegis/trml2pdf.git +trml2pdf==0.4.2 libsass==0.11.1 psycopg2==2.6.2 python-decouple==3.0 From c4eea181fbd301956f300238b7900254f8e2290c Mon Sep 17 00:00:00 2001 From: Matheus Veleci dos Santos Date: Mon, 10 Apr 2017 12:48:51 -0300 Subject: [PATCH 054/140] Ajusta Docker do SAPL com NGINX e GUNICORN. (#997) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adiciona Docker baseado em Alpine-Python3 com Ngnix e Gunicorn * Atualiza docker-compose com gunicorn, ngnix e postgres * Ajusta gitignore para ignorar postgres-data * Adiciona script bash para conexao ao banco * Ajusta busy-wait.sh script para sincronizar o banco(postgres) com a aplicação django no docker * Add alias to sapldb --- .gitignore | 3 +- .travis.yml | 4 +++ Dockerfile | 59 ++++++++++-------------------------- busy-wait.sh | 10 ++++++ config/nginx/sapl.conf | 39 ++++++++++++++++++++++++ docker-compose.yml | 21 ++++++++++--- gunicorn_start.sh | 12 ++------ sapl/.env_test | 2 +- scripts_docker/shell_sapl.sh | 3 +- 9 files changed, 93 insertions(+), 60 deletions(-) create mode 100644 busy-wait.sh create mode 100644 config/nginx/sapl.conf diff --git a/.gitignore b/.gitignore index 83de47a86..e8bac47aa 100644 --- a/.gitignore +++ b/.gitignore @@ -92,4 +92,5 @@ collected_static bower bower_components media -whoosh/ \ No newline at end of file +whoosh/ +postgres-data/ diff --git a/.travis.yml b/.travis.yml index bf5ee38fd..0e0a27ad4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,3 +20,7 @@ script: - ./manage.py bower install - py.test --create-db # - ./test_and_check_qa.sh + +addons: + hosts: + - 127.0.0.1 sapldb diff --git a/Dockerfile b/Dockerfile index 9880dc4ef..a7bf01657 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,53 +1,26 @@ -FROM ubuntu:15.04 +FROM alpine:3.5 -RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV BUILD_PACKAGES postgresql-dev graphviz-dev graphviz build-base git pkgconfig \ +python3-dev libxml2-dev jpeg-dev libressl-dev libffi-dev libxslt-dev nodejs py3-lxml \ +py3-magic postgresql-client -RUN mkdir /sapl +RUN apk add --no-cache python3 && \ + python3 -m ensurepip && \ + rm -r /usr/lib/python*/ensurepip && \ + pip3 install --upgrade pip setuptools && \ + rm -r /root/.cache -RUN echo "deb http://archive.ubuntu.com/ubuntu/ vivid universe" | tee -a "/etc/apt/sources.list" - -RUN \ - apt-get update && \ - apt-get install -y -f \ - software-properties-common \ - libpq-dev \ - graphviz-dev \ - graphviz \ - build-essential \ - git \ - pkg-config \ - python3-dev \ - libxml2-dev \ - libjpeg-dev \ - libssl-dev \ - libffi-dev \ - libxslt1-dev \ - python3-setuptools \ - curl - -# use python3 in pip -RUN easy_install3 pip lxml - -# install nodejs -RUN DEBIAN_FRONTEND=noninteractive curl -sL https://deb.nodesource.com/setup_5.x | bash - -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs - -# install bower -RUN npm install -g bower +RUN mkdir /sapl && apk add --update --no-cache $BUILD_PACKAGES && npm install -g bower # Bower aceitar root -RUN touch /root/.bowerrc -RUN chmod 751 /root/.bowerrc -RUN echo "{ \"allow_root\": true }" >> /root/.bowerrc +RUN touch /root/.bowerrc \ +&& chmod 751 /root/.bowerrc \ +&& echo "{ \"allow_root\": true }" >> /root/.bowerrc \ +&& npm cache clean WORKDIR /sapl ADD . /sapl -RUN pip install -r requirements/dev-requirements.txt -RUN pip install --upgrade setuptools - -# RUN python3 manage.py bower install +RUN pip install -r requirements/dev-requirements.txt --upgrade setuptools --no-cache-dir \ +&& python3 manage.py bower install diff --git a/busy-wait.sh b/busy-wait.sh new file mode 100644 index 000000000..128592ffc --- /dev/null +++ b/busy-wait.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +while true; do + COUNT_PG=`psql --dbname=postgresql://sapl:sapl@sapldb/sapl -c '\l \q' | grep sapl | wc -l` + if ! [ "$COUNT_PG" -eq "0" ]; then + break + fi + echo "Esperando Database Setup" + sleep 10 +done diff --git a/config/nginx/sapl.conf b/config/nginx/sapl.conf new file mode 100644 index 000000000..513188ed9 --- /dev/null +++ b/config/nginx/sapl.conf @@ -0,0 +1,39 @@ +upstream sapl_server { + + server unix:/sapl/run/gunicorn.sock fail_timeout=0; + +} + +server { + + listen 80; + server_name sapl.test; + + client_max_body_size 4G; + + location /static/ { + alias /sapl/collected_static/; + } + + location /media/ { + alias /sapl/media/; + } + + location / { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_set_header Host $http_host; + + proxy_redirect off; + + + if (!-f $request_filename) { + proxy_pass http://sapl_server; + break; + } + } + error_page 500 502 503 504 /500.html; + location = /500.html { + root /sapl/sapl/static/; + } +} diff --git a/docker-compose.yml b/docker-compose.yml index 06c9d2cec..ce5c283fb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,28 @@ -localhost: +server: + image: nginx:latest + ports: + - "80:80" + volumes: + - ./config/nginx:/etc/nginx/conf.d + volumes_from: + - web + links: + - web +sapldb: image: postgres environment: POSTGRES_PASSWORD: sapl POSTGRES_USER: sapl POSTGRES_DB: sapl + PGDATA : /var/lib/postgresql/data/ + volumes: + - ./postgres-data/data/:/var/lib/postgresql/data/ ports: - "5532:5432" web: build: . - command: bash -c "python3 manage.py bower install && python3 manage.py migrate && python3 manage.py runserver 0.0.0.0:8000" + command: /bin/sh -c "/bin/sh busy-wait.sh && python3 manage.py bower install && python3 manage.py migrate && /bin/sh gunicorn_start.sh" volumes: - .:/sapl - ports: - - "8000:8000" links: - - localhost + - sapldb diff --git a/gunicorn_start.sh b/gunicorn_start.sh index 904d76a3a..aebd45c83 100755 --- a/gunicorn_start.sh +++ b/gunicorn_start.sh @@ -3,23 +3,17 @@ # As seen in http://tutos.readthedocs.org/en/latest/source/ndg.html NAME="SAPL" # Name of the application (*) -DJANGODIR=/var/interlegis/sapl # Django project directory (*) -SOCKFILE=/var/interlegis/sapl/run/gunicorn.sock # we will communicate using this unix socket (*) +DJANGODIR=/sapl/ # Django project directory (*) +SOCKFILE=/sapl/run/gunicorn.sock # we will communicate using this unix socket (*) USER=`whoami` # the user to run as (*) GROUP=`whoami` # the group to run as (*) -NUM_WORKERS=9 # how many worker processes should Gunicorn spawn (*) +NUM_WORKERS=3 # how many worker processes should Gunicorn spawn (*) # NUM_WORKERS = 2 * CPUS + 1 DJANGO_SETTINGS_MODULE=sapl.settings # which settings file should Django use (*) DJANGO_WSGI_MODULE=sapl.wsgi # WSGI module name (*) echo "Starting $NAME as `whoami`" -# Activate the virtual environment -cd $DJANGODIR -source /var/interlegis/.virtualenvs/sapl/bin/activate -export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE -export PYTHONPATH=$DJANGODIR:$PYTHONPATH - # Create the run directory if it doesn't exist RUNDIR=$(dirname $SOCKFILE) test -d $RUNDIR || mkdir -p $RUNDIR diff --git a/sapl/.env_test b/sapl/.env_test index 5c2c60ec1..9416d402d 100644 --- a/sapl/.env_test +++ b/sapl/.env_test @@ -1,4 +1,4 @@ -DATABASE_URL = postgresql://postgres:@localhost:/sapl +DATABASE_URL = postgresql://postgres:@sapldb:/sapl SECRET_KEY=TravisTest DEBUG=False EMAIL_USE_TLS = True diff --git a/scripts_docker/shell_sapl.sh b/scripts_docker/shell_sapl.sh index cfddefcdc..4c993a61d 100755 --- a/scripts_docker/shell_sapl.sh +++ b/scripts_docker/shell_sapl.sh @@ -1,2 +1,3 @@ #!/bin/bash -docker run -ti sapl_web /bin/bash + +docker run --rm -ti sapl_web /bin/sh From 39d0645c923beab7ffa940007e9bd6753c07921a Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Mon, 10 Apr 2017 11:22:30 -0300 Subject: [PATCH 055/140] Conserta erros de QA --- sapl/base/search_indexes.py | 3 ++- .../templatetags/compilacao_filters.py | 3 ++- sapl/crispy_layout_mixin.py | 2 +- sapl/crud/base.py | 2 +- sapl/legacy/migration.py | 2 +- sapl/materia/models.py | 3 +-- sapl/materia/signals.py | 7 +++--- sapl/materia/urls.py | 7 +++--- sapl/materia/views.py | 24 +++++++++---------- sapl/norma/models.py | 4 ++-- sapl/norma/signals.py | 5 ++-- sapl/norma/views.py | 1 + sapl/parlamentares/views.py | 1 - sapl/protocoloadm/forms.py | 4 ++-- sapl/relatorios/views.py | 11 ++++----- sapl/sessao/views.py | 4 ++-- 16 files changed, 41 insertions(+), 42 deletions(-) diff --git a/sapl/base/search_indexes.py b/sapl/base/search_indexes.py index 1b2944f48..c85be523b 100644 --- a/sapl/base/search_indexes.py +++ b/sapl/base/search_indexes.py @@ -1,8 +1,9 @@ import os.path -import textract +import textract from django.template import Context, loader from haystack import indexes + from sapl.materia.models import DocumentoAcessorio, MateriaLegislativa from sapl.norma.models import NormaJuridica diff --git a/sapl/compilacao/templatetags/compilacao_filters.py b/sapl/compilacao/templatetags/compilacao_filters.py index f3965c43d..941ec5fe1 100644 --- a/sapl/compilacao/templatetags/compilacao_filters.py +++ b/sapl/compilacao/templatetags/compilacao_filters.py @@ -211,7 +211,7 @@ def heranca(request, d, ignore_ultimo=0, ignore_primeiro=0): ta_id = str(d.ta_id) d_pk = str(d.pk) if ta_id not in ta_dpts_parents or d_pk not in ta_dpts_parents[ta_id]: - #print('recarregando estrutura temporaria de heranças') + # print('recarregando estrutura temporaria de heranças') dpts_parents = {} ta_dpts_parents[ta_id] = dpts_parents update_dispositivos_parents(dpts_parents, ta_id) @@ -296,6 +296,7 @@ def urldetail_content_type(obj): def list(obj): return [obj, ] + @register.filter def can_use_dynamic_editing(texto_articulado, user): return texto_articulado.can_use_dynamic_editing(user) diff --git a/sapl/crispy_layout_mixin.py b/sapl/crispy_layout_mixin.py index e9dbc3f01..369b6fe9e 100644 --- a/sapl/crispy_layout_mixin.py +++ b/sapl/crispy_layout_mixin.py @@ -1,12 +1,12 @@ from math import ceil +import rtyaml from crispy_forms.bootstrap import FormActions from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML, Div, Fieldset, Layout, Submit from django import template from django.utils import formats from django.utils.translation import ugettext as _ -import rtyaml def heads_and_tails(list_of_lists): diff --git a/sapl/crud/base.py b/sapl/crud/base.py index b2223c31f..1a1225cfc 100644 --- a/sapl/crud/base.py +++ b/sapl/crud/base.py @@ -842,7 +842,7 @@ class CrudDeleteView(PermissionRequiredContainerCrudMixin, def delete(self, request, *args, **kwargs): try: - return super(CrudDeleteView, self).delete(request, args, kwargs) + return super(CrudDeleteView, self).delete(request, args, kwargs) except models.ProtectedError as err: error_msg = 'Registro não pode ser removido, pois\ é referenciado por outros registros:
    \ diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 99d14f8a7..ef87a3960 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -19,7 +19,7 @@ from model_mommy.mommy import foreign_key_required, make from sapl.base.models import Autor, ProblemaMigracao from sapl.comissoes.models import Comissao, Composicao, Participacao from sapl.legacy.models import Protocolo as ProtocoloLegado -from sapl.materia.models import (Proposicao, StatusTramitacao, TipoDocumento, +from sapl.materia.models import (StatusTramitacao, TipoDocumento, TipoMateriaLegislativa, TipoProposicao, Tramitacao) from sapl.norma.models import (AssuntoNorma, NormaJuridica, diff --git a/sapl/materia/models.py b/sapl/materia/models.py index 6b48613ee..1a9d2afff 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -1,5 +1,6 @@ from datetime import datetime +import reversion from django.contrib.auth.models import Group from django.contrib.contenttypes.fields import GenericRelation from django.contrib.contenttypes.models import ContentType @@ -7,7 +8,6 @@ from django.db import models from django.utils import formats from django.utils.translation import ugettext_lazy as _ from model_utils import Choices -import reversion from sapl.base.models import Autor from sapl.comissoes.models import Comissao @@ -18,7 +18,6 @@ from sapl.utils import (RANGE_ANOS, YES_NO_CHOICES, SaplGenericForeignKey, SaplGenericRelation, restringe_tipos_de_arquivo_txt, texto_upload_path) - EM_TRAMITACAO = [(1, 'Sim'), (0, 'Não')] diff --git a/sapl/materia/signals.py b/sapl/materia/signals.py index 96ff85dea..d913e9cd8 100644 --- a/sapl/materia/signals.py +++ b/sapl/materia/signals.py @@ -1,10 +1,11 @@ -from django.db.models.signals import post_delete, post_save -from sapl.settings import PROJECT_DIR from subprocess import PIPE, call from threading import Thread +from django.db.models.signals import post_delete, post_save + +from sapl.settings import PROJECT_DIR -from .models import MateriaLegislativa, DocumentoAcessorio +from .models import DocumentoAcessorio, MateriaLegislativa class UpdateIndexCommand(Thread): diff --git a/sapl/materia/urls.py b/sapl/materia/urls.py index 1de8cd689..7eac42e5c 100644 --- a/sapl/materia/urls.py +++ b/sapl/materia/urls.py @@ -4,10 +4,9 @@ from sapl.materia.views import (AcompanhamentoConfirmarView, AcompanhamentoExcluirView, AcompanhamentoMateriaView, AdicionarVariasAutorias, AnexadaCrud, - AssuntoMateriaCrud, - AutoriaCrud, ConfirmarProposicao, - CriarProtocoloMateriaView, DespachoInicialCrud, - DocumentoAcessorioCrud, + AssuntoMateriaCrud, AutoriaCrud, + ConfirmarProposicao, CriarProtocoloMateriaView, + DespachoInicialCrud, DocumentoAcessorioCrud, DocumentoAcessorioEmLoteView, LegislacaoCitadaCrud, MateriaAssuntoCrud, MateriaLegislativaCrud, diff --git a/sapl/materia/views.py b/sapl/materia/views.py index 305b4b7b0..b93d81289 100644 --- a/sapl/materia/views.py +++ b/sapl/materia/views.py @@ -43,21 +43,19 @@ from sapl.utils import (TURNO_TRAMITACAO_CHOICES, YES_NO_CHOICES, autor_label, from .forms import (AcessorioEmLoteFilterSet, AcompanhamentoMateriaForm, AdicionarVariasAutoriasFilterSet, DespachoInicialForm, - DocumentoAcessorioForm, - MateriaAssuntoForm, MateriaLegislativaFilterSet, - MateriaSimplificadaForm, PrimeiraTramitacaoEmLoteFilterSet, - ReceberProposicaoForm, RelatoriaForm, - TramitacaoEmLoteFilterSet, filtra_tramitacao_destino, + DocumentoAcessorioForm, MateriaAssuntoForm, + MateriaLegislativaFilterSet, MateriaSimplificadaForm, + PrimeiraTramitacaoEmLoteFilterSet, ReceberProposicaoForm, + RelatoriaForm, TramitacaoEmLoteFilterSet, + filtra_tramitacao_destino, filtra_tramitacao_destino_and_status, filtra_tramitacao_status) -from .models import (AssuntoMateria, AcompanhamentoMateria, - Anexada, Autoria, DespachoInicial, - DocumentoAcessorio, MateriaLegislativa, - MateriaAssunto, Numeracao, Orgao, - Origem, Proposicao, RegimeTramitacao, Relatoria, - StatusTramitacao, TipoDocumento, TipoFimRelatoria, - TipoMateriaLegislativa, TipoProposicao, Tramitacao, - UnidadeTramitacao) +from .models import (AcompanhamentoMateria, Anexada, AssuntoMateria, Autoria, + DespachoInicial, DocumentoAcessorio, MateriaAssunto, + MateriaLegislativa, Numeracao, Orgao, Origem, Proposicao, + RegimeTramitacao, Relatoria, StatusTramitacao, + TipoDocumento, TipoFimRelatoria, TipoMateriaLegislativa, + TipoProposicao, Tramitacao, UnidadeTramitacao) AssuntoMateriaCrud = Crud.build(AssuntoMateria, 'assunto_materia') diff --git a/sapl/norma/models.py b/sapl/norma/models.py index 20b59956f..d91ee2da2 100644 --- a/sapl/norma/models.py +++ b/sapl/norma/models.py @@ -7,8 +7,8 @@ from model_utils import Choices from sapl.compilacao.models import TextoArticulado from sapl.materia.models import MateriaLegislativa -from sapl.utils import (RANGE_ANOS, YES_NO_CHOICES, texto_upload_path, - restringe_tipos_de_arquivo_txt) +from sapl.utils import (RANGE_ANOS, YES_NO_CHOICES, + restringe_tipos_de_arquivo_txt, texto_upload_path) @reversion.register() diff --git a/sapl/norma/signals.py b/sapl/norma/signals.py index fc16f89b4..20d405e49 100644 --- a/sapl/norma/signals.py +++ b/sapl/norma/signals.py @@ -1,8 +1,9 @@ -from django.db.models.signals import post_delete, post_save -from sapl.settings import PROJECT_DIR from subprocess import PIPE, call from threading import Thread +from django.db.models.signals import post_delete, post_save + +from sapl.settings import PROJECT_DIR from .models import NormaJuridica diff --git a/sapl/norma/views.py b/sapl/norma/views.py index 461c1b9ef..9120da4e9 100644 --- a/sapl/norma/views.py +++ b/sapl/norma/views.py @@ -4,6 +4,7 @@ from django.http import JsonResponse from django.utils.translation import ugettext_lazy as _ from django.views.generic.base import RedirectView from django_filters.views import FilterView + from sapl.base.models import AppConfig from sapl.compilacao.views import IntegracaoTaView from sapl.crud.base import (RP_DETAIL, RP_LIST, Crud, CrudAux, diff --git a/sapl/parlamentares/views.py b/sapl/parlamentares/views.py index a4f698b5a..d703e1c2c 100644 --- a/sapl/parlamentares/views.py +++ b/sapl/parlamentares/views.py @@ -22,7 +22,6 @@ from .models import (CargoMesa, Coligacao, ComposicaoColigacao, ComposicaoMesa, NivelInstrucao, Parlamentar, Partido, SessaoLegislativa, SituacaoMilitar, TipoAfastamento, TipoDependente, Votante) - CargoMesaCrud = CrudAux.build(CargoMesa, 'cargo_mesa') PartidoCrud = CrudAux.build(Partido, 'partidos') SessaoLegislativaCrud = CrudAux.build(SessaoLegislativa, 'sessao_legislativa') diff --git a/sapl/protocoloadm/forms.py b/sapl/protocoloadm/forms.py index bca51df31..d8f996fe3 100644 --- a/sapl/protocoloadm/forms.py +++ b/sapl/protocoloadm/forms.py @@ -544,10 +544,10 @@ class DocumentoAdministrativoForm(ModelForm): ano_protocolo = forms.ChoiceField(required=False, label=Protocolo._meta. - get_field('ano').verbose_name, + get_field('ano').verbose_name, choices=RANGE_ANOS, widget=forms.Select( - attrs={'class': 'selector'})) + attrs={'class': 'selector'})) class Meta: model = DocumentoAdministrativo diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index 53b9ef54b..9e482abda 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -8,15 +8,14 @@ from sapl.base.models import Autor, CasaLegislativa from sapl.comissoes.models import Comissao from sapl.materia.models import (Autoria, MateriaLegislativa, Numeracao, Tramitacao, UnidadeTramitacao) -from sapl.parlamentares.models import (CargoMesa, ComposicaoMesa, Filiacao, - Parlamentar) +from sapl.parlamentares.models import CargoMesa, Filiacao, Parlamentar from sapl.protocoloadm.models import (DocumentoAdministrativo, Protocolo, TramitacaoAdministrativo) from sapl.sessao.models import (ExpedienteMateria, ExpedienteSessao, - IntegranteMesa, Orador, - OradorExpediente, OrdemDia, PresencaOrdemDia, - RegistroVotacao, SessaoPlenaria, - SessaoPlenariaPresenca, TipoExpediente) + IntegranteMesa, Orador, OradorExpediente, + OrdemDia, PresencaOrdemDia, RegistroVotacao, + SessaoPlenaria, SessaoPlenariaPresenca, + TipoExpediente) from sapl.settings import STATIC_ROOT from sapl.utils import UF diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index fedc8829e..e56cb749e 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -604,7 +604,7 @@ class PainelView(PermissionRequiredForAppCrudMixin, TemplateView): cronometro_ordem = AppsAppConfig.attr('cronometro_ordem') if (not cronometro_discurso or not cronometro_aparte - or not cronometro_ordem): + or not cronometro_ordem): msg = _( 'Você precisa primeiro configurar os cronômetros \ nas Configurações da Aplicação') @@ -2436,7 +2436,7 @@ def mudar_ordem_materia_sessao(request): sessao_plenaria=pk_sessao, numero_ordem=posicao_inicial) except ObjectDoesNotExist: - raise # TODO tratar essa exceção + raise # TODO tratar essa exceção # Se a posição inicial for menor que a final, todos que # estiverem acima da nova posição devem ter sua ordem decrementada From 9e185ed56597f2581f7df13635277bb4029bf537 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Mon, 10 Apr 2017 13:25:15 -0300 Subject: [PATCH 056/140] Desliga teste lento demais (TODO: consertar) --- sapl/test_urls.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sapl/test_urls.py b/sapl/test_urls.py index bcddfcc9e..40339cef7 100644 --- a/sapl/test_urls.py +++ b/sapl/test_urls.py @@ -361,6 +361,7 @@ for item in _lista_urls: __lista_urls.append((oper, item))""" +@pytest.mark.skip(reason="TODO: Lento demais. Precisa ser refatorado") @pytest.mark.django_db(transaction=False) @pytest.mark.parametrize('url_item', _lista_urls) def test_permissions_urls_for_users_by_apps(url_item, client): @@ -402,7 +403,7 @@ def test_permissions_urls_for_users_by_apps(url_item, client): container, como é o caso de proposições que possui restrição por usuário e não só por, ou não tem, o campo permission_required """ - if PermissionRequiredForAppCrudMixin in type.mro(key.view_class): + if issubclass(key.view_class, PermissionRequiredForAppCrudMixin): # essa classe deve informar app_label assert hasattr(key.view_class, 'app_label') # app_label deve ter conteudo From 96911c997f6c7d57b1d9ac45a97e33394900cd83 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Wed, 15 Mar 2017 12:21:13 -0300 Subject: [PATCH 057/140] Adiciona models para recriar constraints Signed-off-by: Luciano Almeida --- sapl/base/models.py | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/sapl/base/models.py b/sapl/base/models.py index 8825ea2a4..9dd0f5ec3 100644 --- a/sapl/base/models.py +++ b/sapl/base/models.py @@ -61,16 +61,45 @@ class ProblemaMigracao(models.Model): content_object = GenericForeignKey('content_type', 'object_id') nome_campo = models.CharField(max_length=100, blank=True, - verbose_name='Nome do(s) Campo(s)') + verbose_name=_('Nome do(s) Campo(s)')) problema = models.CharField(max_length=300, verbose_name=_('Problema')) descricao = models.CharField(max_length=300, verbose_name=_('Descrição')) - eh_stub = models.BooleanField(verbose_name='É stub?') + eh_stub = models.BooleanField(verbose_name=_('É stub?')) + eh_importante = models.BooleanField( + default=False, verbose_name=_('É importante?')) class Meta: verbose_name = _('Problema na Migração') verbose_name_plural = _('Problemas na Migração') +@reversion.register() +class Constraint(models.Model): + nome_tabela = models.CharField( + max_length=50, verbose_name=_('Nome da tabela')) + nome_constraint = models.CharField( + max_length=100, verbose_name=_('Nome da constraint')) + nome_model = models.CharField( + max_length=50, verbose_name=_('Nome da model')) + tipo_constraint = models.CharField( + max_length=50, verbose_name=_('Tipo da constraint')) + + class Meta: + verbose_name = _('Constraint removida') + verbose_name_plural = _('Constraints removidas') + + +@reversion.register() +class Argumento(models.Model): + constraint = models.ForeignKey(Constraint) + argumento = models.CharField( + max_length=50, verbose_name=_('Argumento')) + + class Meta: + verbose_name = _('Argumento da constraint') + verbose_name_plural = _('Argumentos da constraint') + + @reversion.register() class AppConfig(models.Model): From f4224f3326a330074da66535a159daf6ef81a368 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Wed, 15 Mar 2017 12:22:11 -0300 Subject: [PATCH 058/140] =?UTF-8?q?Muda=20m=C3=A9todo=20de=20recriar=20con?= =?UTF-8?q?straints?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luciano Almeida --- sapl/legacy/migration.py | 64 +++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index ef87a3960..c4c7d0f77 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -16,7 +16,7 @@ from django.db.models.base import ModelBase from model_mommy import mommy from model_mommy.mommy import foreign_key_required, make -from sapl.base.models import Autor, ProblemaMigracao +from sapl.base.models import Autor, ProblemaMigracao, Constraint, Argumento from sapl.comissoes.models import Comissao, Composicao, Participacao from sapl.legacy.models import Protocolo as ProtocoloLegado from sapl.materia.models import (StatusTramitacao, TipoDocumento, @@ -109,6 +109,10 @@ def warn(msg): print('CUIDADO! ' + msg) +def erro(msg): + print('ERRO: ' + msg) + + def get_fk_related(field, value, label=None): if value is None and field.null is False: value = 0 @@ -210,40 +214,66 @@ def delete_constraints(model): for r in result: if r[0].endswith('key'): words_list = r[0].split('_') - one_to_one_constraints.append([table, r[0], words_list, model]) + constraint = Constraint.objects.create( + nome_tabela=table, nome_constraint=r[0], + nome_model=model.__name__, tipo_constraint='one_to_one') + for w in words_list: + Argumento.objects.create(constraint=constraint, argumento=w) else: args = None - args_list = [] if model._meta.unique_together: args = model._meta.unique_together[0] args_list = list(args) - unique_constraints.append([table, r[0], args_list, model]) + constraint = Constraint.objects.create( + nome_tabela=table, nome_constraint=r[0], + nome_model=model.__name__, + tipo_constraint='unique_together') + for a in args_list: + Argumento.objects.create(constraint=constraint, + argumento=a) warn('Excluindo unique constraint de nome %s' % r[0]) exec_sql("ALTER TABLE %s DROP CONSTRAINT %s;" % (table, r[0])) def recreate_constraints(): - if one_to_one_constraints: - for constraint in one_to_one_constraints: - table, name, args, model = constraint + constraints = Constraint.objects.all() + for con in constraints: + if con.tipo_constraint == 'one_to_one': + nome_tabela = con.nome_tabela + nome_constraint = con.nome_constraint + args = [a.argumento for a in con.argumento_set.all()] args_string = '' args_string = "(" + "_".join(map(str, args[2:-1])) + ")" - exec_sql("ALTER TABLE %s ADD CONSTRAINT %s UNIQUE %s;" % - (table, name, args_string)) - if unique_constraints: - for constraint in unique_constraints: - table, name, args, model = constraint + try: + exec_sql("ALTER TABLE %s ADD CONSTRAINT %s UNIQUE %s;" % + (nome_tabela, nome_constraint, args_string)) + except ProgrammingError: + info('A constraint %s já foi recriada!' % nome_constraint) + if con.tipo_constraint == 'unique_together': + nome_tabela = con.nome_tabela + nome_constraint = con.nome_constraint + model = ContentType.objects.get( + model=con.nome_model.lower()).model_class() + args = [a.argumento for a in con.argumento_set.all()] for i in range(len(args)): if isinstance(model._meta.get_field(args[i]), models.ForeignKey): args[i] = args[i] + '_id' args_string = '' args_string += "(" + ', '.join(map(str, args)) + ")" - exec_sql("ALTER TABLE %s ADD CONSTRAINT %s UNIQUE %s;" % - (table, name, args_string)) - one_to_one_constraints.clear() - unique_constraints.clear() + try: + exec_sql("ALTER TABLE %s ADD CONSTRAINT %s UNIQUE %s;" % + (nome_tabela, nome_constraint, args_string)) + except ProgrammingError: + info('A constraint %s já foi recriada!' % nome_constraint) + except Exception as err: + problema = re.findall('\(.*?\)', err.args[0]) + erro('A constraint [%s] da tabela [%s] não pode ser recriada' % + (nome_constraint, nome_tabela)) + erro('Os dados %s = %s estão duplicados. ' + 'Arrume antes de recriar as constraints!' % + (problema[0], problema[1])) def obj_desnecessario(obj): @@ -435,8 +465,6 @@ class DataMigrator: info('Deletando stubs desnecessários...') while self.delete_stubs(): pass - info('Recriando unique constraints...') - # recreate_constraints() def _do_migrate(self, obj): if isinstance(obj, AppConfig): From e276d87d19c95350a96805e27a48687af413338b Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Mon, 3 Apr 2017 13:53:45 -0300 Subject: [PATCH 059/140] =?UTF-8?q?Arruma=20problema=20da=20recria=C3=A7?= =?UTF-8?q?=C3=A3o=20das=20constraints?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luciano Almeida --- .../migrations/0002_auto_20170331_1900.py | 51 +++++++++++++++++++ sapl/legacy/migration.py | 6 ++- 2 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 sapl/base/migrations/0002_auto_20170331_1900.py diff --git a/sapl/base/migrations/0002_auto_20170331_1900.py b/sapl/base/migrations/0002_auto_20170331_1900.py new file mode 100644 index 000000000..5ee726647 --- /dev/null +++ b/sapl/base/migrations/0002_auto_20170331_1900.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-03-31 19:00 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('base', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Argumento', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('argumento', models.CharField(max_length=50, verbose_name='Argumento')), + ], + options={ + 'verbose_name': 'Argumento da constraint', + 'verbose_name_plural': 'Argumentos da constraint', + }, + ), + migrations.CreateModel( + name='Constraint', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('nome_tabela', models.CharField(max_length=50, verbose_name='Nome da tabela')), + ('nome_constraint', models.CharField(max_length=100, verbose_name='Nome da constraint')), + ('nome_model', models.CharField(max_length=50, verbose_name='Nome da model')), + ('tipo_constraint', models.CharField(max_length=50, verbose_name='Tipo da constraint')), + ], + options={ + 'verbose_name': 'Constraint removida', + 'verbose_name_plural': 'Constraints removidas', + }, + ), + migrations.AddField( + model_name='problemamigracao', + name='eh_importante', + field=models.BooleanField(default=False, verbose_name='É importante?'), + ), + migrations.AddField( + model_name='argumento', + name='constraint', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='base.Constraint'), + ), + ] diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index c4c7d0f77..60ab48e23 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -253,8 +253,10 @@ def recreate_constraints(): if con.tipo_constraint == 'unique_together': nome_tabela = con.nome_tabela nome_constraint = con.nome_constraint - model = ContentType.objects.get( - model=con.nome_model.lower()).model_class() + # Pegando explicitamente o primeiro valor do filter, + # pois pode ser que haja mais de uma ocorrência + model = ContentType.objects.filter( + model=con.nome_model.lower())[0].model_class() args = [a.argumento for a in con.argumento_set.all()] for i in range(len(args)): if isinstance(model._meta.get_field(args[i]), From 7f24bea073ed3242533f3e86c217ec11816f5f46 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Mon, 3 Apr 2017 14:24:47 -0300 Subject: [PATCH 060/140] Comando do manage.py para recriar constraints Signed-off-by: Luciano Almeida --- .../legacy/management/commands/recria_constraints.py | 12 ++++++++++++ sapl/legacy/migration.py | 4 ++-- sapl/legacy/scripts/migra_um_db.sh | 6 ++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 sapl/legacy/management/commands/recria_constraints.py diff --git a/sapl/legacy/management/commands/recria_constraints.py b/sapl/legacy/management/commands/recria_constraints.py new file mode 100644 index 000000000..9e999e5f6 --- /dev/null +++ b/sapl/legacy/management/commands/recria_constraints.py @@ -0,0 +1,12 @@ +from django.core.management.base import BaseCommand + +from sapl.legacy.migration import recria_constraints + + +class Command(BaseCommand): + + help = (u'Recria constraints do PostgreSQL excluidas durante ' + 'migração de dados') + + def handle(self, *args, **options): + recria_constraints() diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 60ab48e23..cb24664b0 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -236,7 +236,7 @@ def delete_constraints(model): (table, r[0])) -def recreate_constraints(): +def recria_constraints(): constraints = Constraint.objects.all() for con in constraints: if con.tipo_constraint == 'one_to_one': @@ -459,7 +459,7 @@ class DataMigrator: for obj in self.to_delete: msg = 'A entrada de PK %s da model %s não pode ser ' \ 'excluida' % (obj.pk, obj._meta.model_name) - descricao = 'Um ou mais objetos protegidos ' + descricao = 'Um ou mais objetos protegidos' warn(msg + ' => ' + descricao) save_relation(obj=obj, problema=msg, descricao=descricao, eh_stub=False) diff --git a/sapl/legacy/scripts/migra_um_db.sh b/sapl/legacy/scripts/migra_um_db.sh index 26240d8d4..f55dfb53a 100755 --- a/sapl/legacy/scripts/migra_um_db.sh +++ b/sapl/legacy/scripts/migra_um_db.sh @@ -23,3 +23,9 @@ echo "--- MIGRACAO DE DADOS ---" | tee -a $LOG echo >> $LOG DATABASE_NAME=$1 ./manage.py migracao_25_31 -f --settings sapl.legacy_migration_settings |& tee -a $LOG echo >> $LOG + + +echo "--- RECRIANDO CONSTRAINTS ---" | tee -a $LOG +echo >> $LOG +DATABASE_NAME=$1 ./manage.py recria_constraints --settings sapl.legacy_migration_settings |& tee -a $LOG +echo >> $LOG From 9a0e16b6098f14b86aaa3eeada3c74ce82c3296a Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Mon, 10 Apr 2017 14:00:56 -0300 Subject: [PATCH 061/140] =?UTF-8?q?Desconecta=20sinais=20de=20indexa=C3=A7?= =?UTF-8?q?=C3=A3o=20durante=20migra=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luciano Almeida --- sapl/legacy/migration.py | 38 +++++++++++++++++++++++++++++++------- sapl/materia/signals.py | 22 +--------------------- sapl/norma/signals.py | 22 +--------------------- sapl/utils.py | 20 +++++++++++++++++++- 4 files changed, 52 insertions(+), 50 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index cb24664b0..9fee4683e 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -13,22 +13,23 @@ from django.core.exceptions import ObjectDoesNotExist from django.db import OperationalError, ProgrammingError, connections, models from django.db.models import CharField, Max, ProtectedError, TextField from django.db.models.base import ModelBase +from django.db.models.signals import post_delete, post_save from model_mommy import mommy from model_mommy.mommy import foreign_key_required, make from sapl.base.models import Autor, ProblemaMigracao, Constraint, Argumento from sapl.comissoes.models import Comissao, Composicao, Participacao from sapl.legacy.models import Protocolo as ProtocoloLegado -from sapl.materia.models import (StatusTramitacao, TipoDocumento, +from sapl.materia.models import (StatusTramitacao, TipoDocumento, Tramitacao, TipoMateriaLegislativa, TipoProposicao, - Tramitacao) + DocumentoAcessorio, MateriaLegislativa) from sapl.norma.models import (AssuntoNorma, NormaJuridica, TipoVinculoNormaJuridica) from sapl.parlamentares.models import Parlamentar from sapl.protocoloadm.models import Protocolo, StatusTramitacaoAdministrativo from sapl.sessao.models import ExpedienteMateria, OrdemDia from sapl.settings import PROJECT_DIR -from sapl.utils import normalize +from sapl.utils import normalize, save_texto, delete_texto # BASE ###################################################################### # apps to be migrated, in app dependency order (very important) @@ -294,8 +295,8 @@ def get_last_value(model): def alter_sequence(model, id): sequence_name = '%s_id_seq' % model._meta.db_table - exec_sql('ALTER SEQUENCE %s RESTART WITH %s MINVALUE %s;' % ( - sequence_name, id, id)) + exec_sql('ALTER SEQUENCE %s RESTART WITH %s MINVALUE -1;' % ( + sequence_name, id)) def save_with_id(new, id): @@ -310,8 +311,7 @@ def save_relation(obj, nome_campo='', problema='', descricao='', eh_stub=False): link = ProblemaMigracao( content_object=obj, nome_campo=nome_campo, problema=problema, - descricao=descricao, eh_stub=eh_stub, - ) + descricao=descricao, eh_stub=eh_stub,) link.save() @@ -448,6 +448,8 @@ class DataMigrator: call([PROJECT_DIR.child('manage.py'), 'flush', '--database=default', '--no-input'], stdout=PIPE) + disconecta_sinais_indexacao() + info('Começando migração: %s...' % obj) self._do_migrate(obj) @@ -468,6 +470,8 @@ class DataMigrator: while self.delete_stubs(): pass + conecta_sinais_indexacao() + def _do_migrate(self, obj): if isinstance(obj, AppConfig): models_to_migrate = (model for model in obj.models.values() @@ -761,3 +765,23 @@ def make_with_log(model, _quantity=None, make_m2m=False, **attrs): return stub make_with_log.required = foreign_key_required + +# DISCONNECT SIGNAL ######################################################## + + +def disconecta_sinais_indexacao(): + post_save.disconnect(save_texto, NormaJuridica) + post_save.disconnect(save_texto, DocumentoAcessorio) + post_save.disconnect(save_texto, MateriaLegislativa) + post_delete.disconnect(delete_texto, NormaJuridica) + post_delete.disconnect(delete_texto, DocumentoAcessorio) + post_delete.disconnect(delete_texto, MateriaLegislativa) + + +def conecta_sinais_indexacao(): + post_save.connect(save_texto, NormaJuridica) + post_save.connect(save_texto, DocumentoAcessorio) + post_save.connect(save_texto, MateriaLegislativa) + post_delete.connect(delete_texto, NormaJuridica) + post_delete.connect(delete_texto, DocumentoAcessorio) + post_delete.connect(delete_texto, MateriaLegislativa) diff --git a/sapl/materia/signals.py b/sapl/materia/signals.py index d913e9cd8..9f08b104c 100644 --- a/sapl/materia/signals.py +++ b/sapl/materia/signals.py @@ -1,29 +1,9 @@ -from subprocess import PIPE, call -from threading import Thread - from django.db.models.signals import post_delete, post_save - -from sapl.settings import PROJECT_DIR +from sapl.utils import save_texto, delete_texto from .models import DocumentoAcessorio, MateriaLegislativa -class UpdateIndexCommand(Thread): - def run(self): - call([PROJECT_DIR.child('manage.py'), 'update_index'], - stdout=PIPE) - - -def save_texto(sender, instance, **kwargs): - update_index = UpdateIndexCommand() - update_index.start() - - -def delete_texto(sender, instance, **kwargs): - update_index = UpdateIndexCommand() - update_index.start() - - post_save.connect(save_texto, sender=MateriaLegislativa) post_save.connect(save_texto, sender=DocumentoAcessorio) post_delete.connect(delete_texto, sender=MateriaLegislativa) diff --git a/sapl/norma/signals.py b/sapl/norma/signals.py index 20d405e49..3089e563e 100644 --- a/sapl/norma/signals.py +++ b/sapl/norma/signals.py @@ -1,28 +1,8 @@ -from subprocess import PIPE, call -from threading import Thread - from django.db.models.signals import post_delete, post_save - -from sapl.settings import PROJECT_DIR +from sapl.utils import save_texto, delete_texto from .models import NormaJuridica -class UpdateIndexCommand(Thread): - def run(self): - call([PROJECT_DIR.child('manage.py'), 'update_index'], - stdout=PIPE) - - -def save_texto(sender, instance, **kwargs): - update_index = UpdateIndexCommand() - update_index.start() - - -def delete_texto(sender, instance, **kwargs): - update_index = UpdateIndexCommand() - update_index.start() - - post_save.connect(save_texto, sender=NormaJuridica) post_delete.connect(delete_texto, sender=NormaJuridica) diff --git a/sapl/utils.py b/sapl/utils.py index 3a857f337..81ebea6cc 100644 --- a/sapl/utils.py +++ b/sapl/utils.py @@ -5,6 +5,8 @@ import re from datetime import date from functools import wraps from unicodedata import normalize as unicodedata_normalize +from subprocess import PIPE, call +from threading import Thread import django_filters import magic @@ -22,7 +24,7 @@ from floppyforms import ClearableFileInput from reversion.admin import VersionAdmin from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row -from sapl.settings import BASE_DIR +from sapl.settings import BASE_DIR, PROJECT_DIR sapl_logger = logging.getLogger(BASE_DIR.name) @@ -632,3 +634,19 @@ def texto_upload_path(instance, filename, subpath=''): } return path + + +class UpdateIndexCommand(Thread): + def run(self): + call([PROJECT_DIR.child('manage.py'), 'update_index'], + stdout=PIPE) + + +def save_texto(sender, instance, **kwargs): + update_index = UpdateIndexCommand() + update_index.start() + + +def delete_texto(sender, instance, **kwargs): + update_index = UpdateIndexCommand() + update_index.start() From 12a3d6995e25201e5035ec9e95659883f66422b0 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 10 Apr 2017 14:18:22 -0300 Subject: [PATCH 062/140] =?UTF-8?q?Modifica=20scripts=20para=20voltar=20di?= =?UTF-8?q?ret=C3=B3rio=20padr=C3=A3o=20do=20gunicorn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 2 +- gunicorn_start.sh | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ce5c283fb..74d345791 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,7 +21,7 @@ sapldb: - "5532:5432" web: build: . - command: /bin/sh -c "/bin/sh busy-wait.sh && python3 manage.py bower install && python3 manage.py migrate && /bin/sh gunicorn_start.sh" + command: /bin/sh -c "/bin/sh busy-wait.sh && python3 manage.py bower install && python3 manage.py migrate && /bin/sh gunicorn_start.sh /sapl" volumes: - .:/sapl links: diff --git a/gunicorn_start.sh b/gunicorn_start.sh index aebd45c83..ebbae1725 100755 --- a/gunicorn_start.sh +++ b/gunicorn_start.sh @@ -2,9 +2,18 @@ # As seen in http://tutos.readthedocs.org/en/latest/source/ndg.html +SAPL_DIR=/var/interlegis/sapl + +# Seta um novo diretório foi passado como raiz para o SAPL +# caso esse tenha sido passado como parâmetro +if [ "$1" ] +then + SAPL_DIR="$1" +fi + NAME="SAPL" # Name of the application (*) -DJANGODIR=/sapl/ # Django project directory (*) -SOCKFILE=/sapl/run/gunicorn.sock # we will communicate using this unix socket (*) +DJANGODIR=$SAPL_DIR # Django project directory (*) +SOCKFILE=$SAPL_DIR/gunicorn.sock # we will communicate using this unix socket (*) USER=`whoami` # the user to run as (*) GROUP=`whoami` # the group to run as (*) NUM_WORKERS=3 # how many worker processes should Gunicorn spawn (*) From d6384f631714fd9ab4930e8b7c66e1dcf360a788 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 10 Apr 2017 14:23:29 -0300 Subject: [PATCH 063/140] HOT-FIX: changes to fix gunicorn --- gunicorn_start.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gunicorn_start.sh b/gunicorn_start.sh index ebbae1725..437a15168 100755 --- a/gunicorn_start.sh +++ b/gunicorn_start.sh @@ -2,7 +2,7 @@ # As seen in http://tutos.readthedocs.org/en/latest/source/ndg.html -SAPL_DIR=/var/interlegis/sapl +SAPL_DIR="/var/interlegis/sapl" # Seta um novo diretório foi passado como raiz para o SAPL # caso esse tenha sido passado como parâmetro @@ -12,8 +12,8 @@ then fi NAME="SAPL" # Name of the application (*) -DJANGODIR=$SAPL_DIR # Django project directory (*) -SOCKFILE=$SAPL_DIR/gunicorn.sock # we will communicate using this unix socket (*) +DJANGODIR=$SAPL_DIR # Django project directory (*) +SOCKFILE="$SAPL_DIR/gunicorn.sock" # we will communicate using this unix socket (*) USER=`whoami` # the user to run as (*) GROUP=`whoami` # the group to run as (*) NUM_WORKERS=3 # how many worker processes should Gunicorn spawn (*) @@ -21,7 +21,7 @@ NUM_WORKERS=3 # how many worker processes shou DJANGO_SETTINGS_MODULE=sapl.settings # which settings file should Django use (*) DJANGO_WSGI_MODULE=sapl.wsgi # WSGI module name (*) -echo "Starting $NAME as `whoami`" +echo "Starting $NAME as `whoami` on base dir $SAPL_DIR" # Create the run directory if it doesn't exist RUNDIR=$(dirname $SOCKFILE) From 3a88bbba8dbc90b819cb6ae19c424964e6d1530a Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 10 Apr 2017 14:43:12 -0300 Subject: [PATCH 064/140] =?UTF-8?q?Revertendo=20a=20altera=C3=A7=C3=A3o=20?= =?UTF-8?q?do=20Dockerfile.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- .travis.yml | 4 --- Dockerfile | 59 ++++++++++++++++++++++++++---------- busy-wait.sh | 10 ------ config/nginx/sapl.conf | 39 ------------------------ docker-compose.yml | 19 +++--------- gunicorn_start.sh | 12 ++++++-- sapl/.env_test | 2 +- scripts_docker/shell_sapl.sh | 3 +- 9 files changed, 59 insertions(+), 92 deletions(-) delete mode 100644 busy-wait.sh delete mode 100644 config/nginx/sapl.conf diff --git a/.gitignore b/.gitignore index e8bac47aa..83de47a86 100644 --- a/.gitignore +++ b/.gitignore @@ -92,5 +92,4 @@ collected_static bower bower_components media -whoosh/ -postgres-data/ +whoosh/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 0e0a27ad4..bf5ee38fd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,3 @@ script: - ./manage.py bower install - py.test --create-db # - ./test_and_check_qa.sh - -addons: - hosts: - - 127.0.0.1 sapldb diff --git a/Dockerfile b/Dockerfile index a7bf01657..9880dc4ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,53 @@ -FROM alpine:3.5 +FROM ubuntu:15.04 -ENV BUILD_PACKAGES postgresql-dev graphviz-dev graphviz build-base git pkgconfig \ -python3-dev libxml2-dev jpeg-dev libressl-dev libffi-dev libxslt-dev nodejs py3-lxml \ -py3-magic postgresql-client +RUN locale-gen en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 -RUN apk add --no-cache python3 && \ - python3 -m ensurepip && \ - rm -r /usr/lib/python*/ensurepip && \ - pip3 install --upgrade pip setuptools && \ - rm -r /root/.cache +RUN mkdir /sapl -RUN mkdir /sapl && apk add --update --no-cache $BUILD_PACKAGES && npm install -g bower +RUN echo "deb http://archive.ubuntu.com/ubuntu/ vivid universe" | tee -a "/etc/apt/sources.list" + +RUN \ + apt-get update && \ + apt-get install -y -f \ + software-properties-common \ + libpq-dev \ + graphviz-dev \ + graphviz \ + build-essential \ + git \ + pkg-config \ + python3-dev \ + libxml2-dev \ + libjpeg-dev \ + libssl-dev \ + libffi-dev \ + libxslt1-dev \ + python3-setuptools \ + curl + +# use python3 in pip +RUN easy_install3 pip lxml + +# install nodejs +RUN DEBIAN_FRONTEND=noninteractive curl -sL https://deb.nodesource.com/setup_5.x | bash - +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs + +# install bower +RUN npm install -g bower # Bower aceitar root -RUN touch /root/.bowerrc \ -&& chmod 751 /root/.bowerrc \ -&& echo "{ \"allow_root\": true }" >> /root/.bowerrc \ -&& npm cache clean +RUN touch /root/.bowerrc +RUN chmod 751 /root/.bowerrc +RUN echo "{ \"allow_root\": true }" >> /root/.bowerrc WORKDIR /sapl ADD . /sapl -RUN pip install -r requirements/dev-requirements.txt --upgrade setuptools --no-cache-dir \ -&& python3 manage.py bower install +RUN pip install -r requirements/dev-requirements.txt +RUN pip install --upgrade setuptools + +# RUN python3 manage.py bower install diff --git a/busy-wait.sh b/busy-wait.sh deleted file mode 100644 index 128592ffc..000000000 --- a/busy-wait.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -while true; do - COUNT_PG=`psql --dbname=postgresql://sapl:sapl@sapldb/sapl -c '\l \q' | grep sapl | wc -l` - if ! [ "$COUNT_PG" -eq "0" ]; then - break - fi - echo "Esperando Database Setup" - sleep 10 -done diff --git a/config/nginx/sapl.conf b/config/nginx/sapl.conf deleted file mode 100644 index 513188ed9..000000000 --- a/config/nginx/sapl.conf +++ /dev/null @@ -1,39 +0,0 @@ -upstream sapl_server { - - server unix:/sapl/run/gunicorn.sock fail_timeout=0; - -} - -server { - - listen 80; - server_name sapl.test; - - client_max_body_size 4G; - - location /static/ { - alias /sapl/collected_static/; - } - - location /media/ { - alias /sapl/media/; - } - - location / { - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - - proxy_set_header Host $http_host; - - proxy_redirect off; - - - if (!-f $request_filename) { - proxy_pass http://sapl_server; - break; - } - } - error_page 500 502 503 504 /500.html; - location = /500.html { - root /sapl/sapl/static/; - } -} diff --git a/docker-compose.yml b/docker-compose.yml index 74d345791..8de57e3aa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,22 +1,9 @@ -server: - image: nginx:latest - ports: - - "80:80" - volumes: - - ./config/nginx:/etc/nginx/conf.d - volumes_from: - - web - links: - - web -sapldb: +localhost: image: postgres environment: POSTGRES_PASSWORD: sapl POSTGRES_USER: sapl POSTGRES_DB: sapl - PGDATA : /var/lib/postgresql/data/ - volumes: - - ./postgres-data/data/:/var/lib/postgresql/data/ ports: - "5532:5432" web: @@ -24,5 +11,7 @@ web: command: /bin/sh -c "/bin/sh busy-wait.sh && python3 manage.py bower install && python3 manage.py migrate && /bin/sh gunicorn_start.sh /sapl" volumes: - .:/sapl + ports: + - "8000:8000" links: - - sapldb + - localhost diff --git a/gunicorn_start.sh b/gunicorn_start.sh index 437a15168..34147cb97 100755 --- a/gunicorn_start.sh +++ b/gunicorn_start.sh @@ -12,17 +12,23 @@ then fi NAME="SAPL" # Name of the application (*) -DJANGODIR=$SAPL_DIR # Django project directory (*) -SOCKFILE="$SAPL_DIR/gunicorn.sock" # we will communicate using this unix socket (*) +DJANGODIR=/var/interlegis/sapl # Django project directory (*) +SOCKFILE=/var/interlegis/sapl/run/gunicorn.sock # we will communicate using this unix socket (*) USER=`whoami` # the user to run as (*) GROUP=`whoami` # the group to run as (*) -NUM_WORKERS=3 # how many worker processes should Gunicorn spawn (*) +NUM_WORKERS=9 # how many worker processes should Gunicorn spawn (*) # NUM_WORKERS = 2 * CPUS + 1 DJANGO_SETTINGS_MODULE=sapl.settings # which settings file should Django use (*) DJANGO_WSGI_MODULE=sapl.wsgi # WSGI module name (*) echo "Starting $NAME as `whoami` on base dir $SAPL_DIR" +# Activate the virtual environment +cd $DJANGODIR +source /var/interlegis/.virtualenvs/sapl/bin/activate +export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE +export PYTHONPATH=$DJANGODIR:$PYTHONPATH + # Create the run directory if it doesn't exist RUNDIR=$(dirname $SOCKFILE) test -d $RUNDIR || mkdir -p $RUNDIR diff --git a/sapl/.env_test b/sapl/.env_test index 9416d402d..5c2c60ec1 100644 --- a/sapl/.env_test +++ b/sapl/.env_test @@ -1,4 +1,4 @@ -DATABASE_URL = postgresql://postgres:@sapldb:/sapl +DATABASE_URL = postgresql://postgres:@localhost:/sapl SECRET_KEY=TravisTest DEBUG=False EMAIL_USE_TLS = True diff --git a/scripts_docker/shell_sapl.sh b/scripts_docker/shell_sapl.sh index 4c993a61d..cfddefcdc 100755 --- a/scripts_docker/shell_sapl.sh +++ b/scripts_docker/shell_sapl.sh @@ -1,3 +1,2 @@ #!/bin/bash - -docker run --rm -ti sapl_web /bin/sh +docker run -ti sapl_web /bin/bash From 8675c4203e88e465cb6dd7f578530a25f0a5b7a2 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Mon, 10 Apr 2017 15:13:45 -0300 Subject: [PATCH 065/140] Concerta testes do app rules para novos models em base Signed-off-by: Luciano Almeida --- sapl/rules/map_rules.py | 2 ++ sapl/rules/tests/test_rules.py | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sapl/rules/map_rules.py b/sapl/rules/map_rules.py index 906592fd0..05d869fd8 100644 --- a/sapl/rules/map_rules.py +++ b/sapl/rules/map_rules.py @@ -197,6 +197,8 @@ rules_group_geral = { (base.CasaLegislativa, __listdetailchange__), (base.ProblemaMigracao, []), + (base.Argumento, []), + (base.Constraint, []), (base.TipoAutor, __base__), (base.Autor, __base__), diff --git a/sapl/rules/tests/test_rules.py b/sapl/rules/tests/test_rules.py index 3662477b9..6fc7eb3fe 100644 --- a/sapl/rules/tests/test_rules.py +++ b/sapl/rules/tests/test_rules.py @@ -6,7 +6,8 @@ from django.contrib.contenttypes.models import ContentType from django.utils import six from django.utils.translation import ugettext_lazy as _ -from sapl.base.models import CasaLegislativa, ProblemaMigracao +from sapl.base.models import (CasaLegislativa, ProblemaMigracao, Argumento, + Constraint) from sapl.compilacao.models import (PerfilEstruturalTextoArticulado, TipoDispositivo, TipoDispositivoRelationship) @@ -56,11 +57,15 @@ def test_models_in_rules_patterns(model_item): __fp__in__test_permission_of_models_in_rules_patterns = { map_rules.RP_ADD: [CasaLegislativa, ProblemaMigracao, + Argumento, + Constraint, TipoDispositivo, TipoDispositivoRelationship, PerfilEstruturalTextoArticulado], map_rules.RP_CHANGE: [ProblemaMigracao, + Argumento, + Constraint, AcompanhamentoMateria, TipoDispositivo, TipoDispositivoRelationship, @@ -68,17 +73,23 @@ __fp__in__test_permission_of_models_in_rules_patterns = { map_rules.RP_DELETE: [CasaLegislativa, ProblemaMigracao, + Argumento, + Constraint, TipoDispositivo, TipoDispositivoRelationship, PerfilEstruturalTextoArticulado], map_rules.RP_LIST: [ProblemaMigracao, + Argumento, + Constraint, AcompanhamentoMateria, TipoDispositivo, TipoDispositivoRelationship, PerfilEstruturalTextoArticulado], map_rules.RP_DETAIL: [ProblemaMigracao, + Argumento, + Constraint, AcompanhamentoMateria, TipoDispositivo, TipoDispositivoRelationship, From 1f74371cd3189720efe04269698edefc4d709999 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 11 Apr 2017 15:19:42 -0300 Subject: [PATCH 066/140] Closes #1008 --- sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py b/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py index 24796bb13..a4648b71d 100644 --- a/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py +++ b/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py @@ -182,7 +182,7 @@ def expediente_materia(lst_expediente_materia): tmp += '' + txt_ementa + '\n' tmp += '' + \ str(expediente_materia['nom_resultado']) + '\n' + '' + \ - str(expediente_materia['votacao_observacao']) + '\n' + '\n' tmp += '\t\t\n' return tmp @@ -237,7 +237,7 @@ def votacao(lst_votacao): tmp += '' + txt_ementa + '\n' tmp += '' + \ str(votacao['nom_resultado']) + '\n' + '' + \ - str(votacao['votacao_observacao']) + '\n' + '\n' tmp += '\t\t\n' return tmp From 1b37465be4de0478b2c5d4ba7ae9c25ac5bbc61f Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 11 Apr 2017 15:45:58 -0300 Subject: [PATCH 067/140] downgrade trml2pdf --- requirements/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 3a0e5b446..6d7592cda 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -19,7 +19,7 @@ django-sass-processor==0.4.6 djangorestframework drfdocs easy-thumbnails==2.3 -trml2pdf==0.4.2 +git+git://github.com/interlegis/trml2pdf.git libsass==0.11.1 psycopg2==2.6.2 python-decouple==3.0 From 575a47af4cbaf77044a8fb9ac439cd5cc96cd863 Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Wed, 12 Apr 2017 11:24:46 -0300 Subject: [PATCH 068/140] =?UTF-8?q?Dinamiza=20pesquisa=20por=20Sess=C3=A3o?= =?UTF-8?q?=20Plen=C3=A1ria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/settings.py | 1 + sapl/templates/base.html | 2 + .../sessao/sessaoplenaria_filter.html | 49 ++++++++++++++++--- .../templates/sessao/sessaoplenaria_form.html | 1 - 4 files changed, 46 insertions(+), 7 deletions(-) diff --git a/sapl/settings.py b/sapl/settings.py index d9875994b..11b94b3de 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -237,6 +237,7 @@ BOWER_INSTALLED_APPS = ( 'jQuery-Mask-Plugin#1.14.0', 'jsdiff#2.2.2', 'https://github.com/interlegis/drunken-parrot-flat-ui.git', + 'jquery-query-object#2.2.3', ) # Additional search paths for SASS files when using the @import statement diff --git a/sapl/templates/base.html b/sapl/templates/base.html index a96815f62..51351e7a0 100644 --- a/sapl/templates/base.html +++ b/sapl/templates/base.html @@ -224,6 +224,8 @@ + + {% block extra_js %}{% endblock %} {% endblock foot_js %} diff --git a/sapl/templates/sessao/sessaoplenaria_filter.html b/sapl/templates/sessao/sessaoplenaria_filter.html index b4aa4ca98..ac39d87fa 100644 --- a/sapl/templates/sessao/sessaoplenaria_filter.html +++ b/sapl/templates/sessao/sessaoplenaria_filter.html @@ -9,16 +9,11 @@ {% blocktrans with verbose_name=view.verbose_name %} Adicionar Sessão Plenária {% endblocktrans %} {% endif %} - {% if filter_url %} - {% trans 'Fazer nova pesquisa' %} - {% endif %}
    {% endblock %} {% block detail_content %} - {% if not filter_url %} - {% crispy filter.form %} - {% endif %} + {% crispy filter.form %} {% if filter_url %}

    @@ -51,3 +46,45 @@ {% endblock detail_content %} {% block table_content %} {% endblock table_content %} + + +{% block extra_js %} + + + +{% endblock %} \ No newline at end of file diff --git a/sapl/templates/sessao/sessaoplenaria_form.html b/sapl/templates/sessao/sessaoplenaria_form.html index cf8cbd64f..81057ba57 100644 --- a/sapl/templates/sessao/sessaoplenaria_form.html +++ b/sapl/templates/sessao/sessaoplenaria_form.html @@ -31,7 +31,6 @@ $(function() { function altera_legislatura(){ - console.debug('hey'); var id_legislatura = $("#id_legislatura").val(); var id_sessao_leg = $("#id_sessao_legislativa").val(); $("#id_sessao_legislativa option").remove(); From 323604bf1bf360be7feeba91624e38ebe96baf17 Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Wed, 12 Apr 2017 11:24:46 -0300 Subject: [PATCH 069/140] =?UTF-8?q?Dinamiza=20pesquisa=20por=20Sess=C3=A3o?= =?UTF-8?q?=20Plen=C3=A1ria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/settings.py | 1 + sapl/templates/base.html | 2 + .../sessao/sessaoplenaria_filter.html | 45 ++++++++++++++++--- .../templates/sessao/sessaoplenaria_form.html | 1 - 4 files changed, 42 insertions(+), 7 deletions(-) diff --git a/sapl/settings.py b/sapl/settings.py index d9875994b..11b94b3de 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -237,6 +237,7 @@ BOWER_INSTALLED_APPS = ( 'jQuery-Mask-Plugin#1.14.0', 'jsdiff#2.2.2', 'https://github.com/interlegis/drunken-parrot-flat-ui.git', + 'jquery-query-object#2.2.3', ) # Additional search paths for SASS files when using the @import statement diff --git a/sapl/templates/base.html b/sapl/templates/base.html index a96815f62..51351e7a0 100644 --- a/sapl/templates/base.html +++ b/sapl/templates/base.html @@ -224,6 +224,8 @@ + + {% block extra_js %}{% endblock %} {% endblock foot_js %} diff --git a/sapl/templates/sessao/sessaoplenaria_filter.html b/sapl/templates/sessao/sessaoplenaria_filter.html index b4aa4ca98..8c77a3ee2 100644 --- a/sapl/templates/sessao/sessaoplenaria_filter.html +++ b/sapl/templates/sessao/sessaoplenaria_filter.html @@ -9,16 +9,11 @@ {% blocktrans with verbose_name=view.verbose_name %} Adicionar Sessão Plenária {% endblocktrans %} {% endif %} - {% if filter_url %} - {% trans 'Fazer nova pesquisa' %} - {% endif %} {% endblock %} {% block detail_content %} - {% if not filter_url %} - {% crispy filter.form %} - {% endif %} + {% crispy filter.form %} {% if filter_url %}

    @@ -51,3 +46,41 @@ {% endblock detail_content %} {% block table_content %} {% endblock table_content %} + + +{% block extra_js %} + + + +{% endblock %} \ No newline at end of file diff --git a/sapl/templates/sessao/sessaoplenaria_form.html b/sapl/templates/sessao/sessaoplenaria_form.html index cf8cbd64f..81057ba57 100644 --- a/sapl/templates/sessao/sessaoplenaria_form.html +++ b/sapl/templates/sessao/sessaoplenaria_form.html @@ -31,7 +31,6 @@ $(function() { function altera_legislatura(){ - console.debug('hey'); var id_legislatura = $("#id_legislatura").val(); var id_sessao_leg = $("#id_sessao_legislativa").val(); $("#id_sessao_legislativa option").remove(); From 451e2949a544524dbaaa30baae3e4b5abcc4f7f9 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Wed, 12 Apr 2017 13:14:40 -0300 Subject: [PATCH 070/140] Verifica qtd de constraints unique together --- sapl/legacy/migration.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 9fee4683e..4a748d49f 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -17,19 +17,20 @@ from django.db.models.signals import post_delete, post_save from model_mommy import mommy from model_mommy.mommy import foreign_key_required, make -from sapl.base.models import Autor, ProblemaMigracao, Constraint, Argumento +from sapl.base.models import Argumento, Autor, Constraint, ProblemaMigracao from sapl.comissoes.models import Comissao, Composicao, Participacao from sapl.legacy.models import Protocolo as ProtocoloLegado -from sapl.materia.models import (StatusTramitacao, TipoDocumento, Tramitacao, +from sapl.materia.models import (DocumentoAcessorio, MateriaLegislativa, + StatusTramitacao, TipoDocumento, TipoMateriaLegislativa, TipoProposicao, - DocumentoAcessorio, MateriaLegislativa) + Tramitacao) from sapl.norma.models import (AssuntoNorma, NormaJuridica, TipoVinculoNormaJuridica) from sapl.parlamentares.models import Parlamentar from sapl.protocoloadm.models import Protocolo, StatusTramitacaoAdministrativo from sapl.sessao.models import ExpedienteMateria, OrdemDia from sapl.settings import PROJECT_DIR -from sapl.utils import normalize, save_texto, delete_texto +from sapl.utils import delete_texto, normalize, save_texto # BASE ###################################################################### # apps to be migrated, in app dependency order (very important) @@ -202,6 +203,12 @@ def iter_sql_records(sql, db): record.__dict__.update(zip(fieldnames, row)) yield record +# Todos os models têm no máximo uma constraint unique together +# Isso é necessário para que o método delete_constraints funcione corretamente +assert all(len(model._meta.unique_together) <= 1 + for app in appconfs + for model in app.models.values()) + def delete_constraints(model): # pega nome da unique constraint dado o nome da tabela @@ -221,10 +228,8 @@ def delete_constraints(model): for w in words_list: Argumento.objects.create(constraint=constraint, argumento=w) else: - args = None if model._meta.unique_together: - args = model._meta.unique_together[0] - args_list = list(args) + args_list = model._meta.unique_together[0] constraint = Constraint.objects.create( nome_tabela=table, nome_constraint=r[0], nome_model=model.__name__, From e98032d2271f0509a95bb4be207c324b80a65147 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Wed, 12 Apr 2017 18:11:13 -0300 Subject: [PATCH 071/140] =?UTF-8?q?Conserta=20bug=20que=20pegava=20o=20res?= =?UTF-8?q?ultado=20das=20vota=C3=A7=C3=B5es=20do=20lugar=20errado.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/relatorios/views.py | 15 ++++++--------- sapl/sessao/views.py | 40 ++++++++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index 9e482abda..a5b129118 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -594,11 +594,9 @@ def get_sessao_plenaria(sessao, casa): dic_expediente_materia["nom_autor"] = 'Desconhecido' dic_expediente_materia["votacao_observacao"] = ' ' - if not expediente_materia.resultado: - resultado = RegistroVotacao.objects.filter( - tipo_resultado_votacao=expediente_materia.tipo_votacao) - - for i in resultado: + resultados = expediente_materia.registrovotacao_set.all() + if resultados: + for i in resultados: dic_expediente_materia["nom_resultado"] = ( i.tipo_resultado_votacao.nome) dic_expediente_materia["votacao_observacao"] = ( @@ -710,10 +708,9 @@ def get_sessao_plenaria(sessao, casa): dic_votacao["nom_autor"] = 'Desconhecido' dic_votacao["votacao_observacao"] = ' ' - if not votacao.resultado: - resultado = RegistroVotacao.objects.filter( - tipo_resultado_votacao=votacao.tipo_votacao) - for i in resultado: + resultados = votacao.registrovotacao_set.all() + if resultados: + for i in resultados: dic_votacao["nom_resultado"] = i.tipo_resultado_votacao.nome if votacao.observacao: dic_votacao["votacao_observacao"] = votacao.observacao diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index e56cb749e..25f72499f 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -164,7 +164,8 @@ class MateriaOrdemDiaCrud(MasterDetailCrud): def get_rows(self, object_list): for obj in object_list: - if not obj.resultado: + resultados = obj.registrovotacao_set.all() + if not resultados: if obj.votacao_aberta: url = '' if obj.tipo_votacao == 1: @@ -208,6 +209,7 @@ class MateriaOrdemDiaCrud(MasterDetailCrud): else: obj.resultado = '''Não há resultado''' else: + resultado = resultados[0].tipo_resultado_votacao.nome if self.request.user.has_module_perms(AppConfig.label): url = '' if obj.tipo_votacao == 1: @@ -229,9 +231,9 @@ class MateriaOrdemDiaCrud(MasterDetailCrud): 'oid': obj.materia_id, 'mid': obj.pk}) obj.resultado = '%s' % (url, - obj.resultado) + resultado) else: - obj.resultado = '%s' % (obj.resultado) + obj.resultado = '%s' % (resultado) return [self._as_row(obj) for obj in object_list] @@ -268,7 +270,8 @@ class ExpedienteMateriaCrud(MasterDetailCrud): def get_rows(self, object_list): for obj in object_list: - if not obj.resultado: + resultados = obj.registrovotacao_set.all() + if not resultados: if obj.votacao_aberta: url = '' if obj.tipo_votacao == 1: @@ -310,7 +313,7 @@ class ExpedienteMateriaCrud(MasterDetailCrud): obj.resultado = btn_abrir else: url = '' - + resultado = resultados[0].tipo_resultado_votacao.nome if self.request.user.has_module_perms(AppConfig.label): if obj.tipo_votacao == 1: url = reverse( @@ -332,7 +335,9 @@ class ExpedienteMateriaCrud(MasterDetailCrud): 'oid': obj.materia_id, 'mid': obj.pk}) obj.resultado = '%s' % (url, - obj.resultado) + resultado) + else: + obj.resultado = '%s' % (resultado) return [self._as_row(obj) for obj in object_list] class CreateView(MasterDetailCrud.CreateView): @@ -982,12 +987,14 @@ class ResumoView(DetailView): materias_expediente = [] for m in materias: + ementa = m.observacao titulo = m.materia numero = m.numero_ordem - if m.resultado: - resultado = m.resultado + resultado = m.registrovotacao_set.all() + if resultado: + resultado = resultado[0].tipo_resultado_votacao.nome else: resultado = _('Matéria não votada') @@ -1039,7 +1046,6 @@ class ResumoView(DetailView): # Matérias Ordem do Dia ordem = OrdemDia.objects.filter( sessao_plenaria_id=self.object.id) - materias_ordem = [] for o in ordem: ementa = o.observacao @@ -1047,8 +1053,9 @@ class ResumoView(DetailView): numero = o.numero_ordem # Verificar resultado - if o.resultado: - resultado = o.resultado + resultado = o.registrovotacao_set.all() + if resultado: + resultado = resultado[0].tipo_resultado_votacao.nome else: resultado = _('Matéria não votada') @@ -2065,9 +2072,9 @@ class PautaSessaoDetailView(DetailView): situacao = m.materia.tramitacao_set.last().status if situacao is None: situacao = _("Não informada") - - if m.resultado: - resultado = m.resultado + resultado = m.registrovotacao_set.all() + if resultado: + resultado = resultado[0].tipo_resultado_votacao.nome else: resultado = _('Matéria não votada') @@ -2118,8 +2125,9 @@ class PautaSessaoDetailView(DetailView): numero = o.numero_ordem # Verificar resultado - if o.resultado: - resultado = o.resultado + resultado = o.registrovotacao_set.all() + if resultado: + resultado = resultado[0].tipo_resultado_votacao.nome else: resultado = _('Matéria não votada') From 25be37eb0dc69b9962d49ebc2b42c0847956f824 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Wed, 12 Apr 2017 19:40:22 -0300 Subject: [PATCH 072/140] =?UTF-8?q?Ajusta=20a=20ordem=20das=20partes=20do?= =?UTF-8?q?=20expediente=20no=20relat=C3=B3rio=20para=20ficar=20em=20confo?= =?UTF-8?q?rmidade=20com=20o=20resumo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/relatorios/views.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index a5b129118..0ae5bb39f 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -518,14 +518,14 @@ def get_sessao_plenaria(sessao, casa): # Exibe os Expedientes lst_expedientes = [] - for tip_expediente in TipoExpediente.objects.all(): - for expediente in ExpedienteSessao.objects.filter( - sessao_plenaria=sessao, tipo=tip_expediente): - dic_expedientes = {} - dic_expedientes["nom_expediente"] = str(tip_expediente) - dic_expedientes["txt_expediente"] = (expediente.conteudo) - if dic_expedientes: - lst_expedientes.append(dic_expedientes) + expedientes = ExpedienteSessao.objects.filter( + sessao_plenaria=sessao).order_by('tipo__nome') + for e in expedientes: + dic_expedientes = {} + dic_expedientes["nom_expediente"] = str(e.tipo) + dic_expedientes["txt_expediente"] = (e.conteudo) + if dic_expedientes: + lst_expedientes.append(dic_expedientes) # Lista das matérias do Expediente, incluindo o resultado das votacoes lst_expediente_materia = [] From b11596167371f4716fd779756e002dc7e11835a6 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Wed, 12 Apr 2017 19:49:47 -0300 Subject: [PATCH 073/140] =?UTF-8?q?Adiciona=20quebra=20de=20linha=20em=20r?= =?UTF-8?q?elat=C3=B3rio=20de=20sess=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py | 2 +- sapl/relatorios/views.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py b/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py index a4648b71d..ec465b485 100644 --- a/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py +++ b/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py @@ -155,7 +155,7 @@ def expedientes(lst_expedientes): tmp += '\t\t\t \n' tmp += '\t\t\n' for expediente in lst_expedientes: - tmp += '\t\t' + \ + tmp += '\t\t' + '
    ' + \ expediente['nom_expediente'] + ':
    \n' + \ '' + \ expediente['txt_expediente'] + '\n' diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index 0ae5bb39f..4a76eee3a 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -522,8 +522,8 @@ def get_sessao_plenaria(sessao, casa): sessao_plenaria=sessao).order_by('tipo__nome') for e in expedientes: dic_expedientes = {} - dic_expedientes["nom_expediente"] = str(e.tipo) - dic_expedientes["txt_expediente"] = (e.conteudo) + dic_expedientes["nom_expediente"] = e.tipo.nome + dic_expedientes["txt_expediente"] = e.conteudo if dic_expedientes: lst_expedientes.append(dic_expedientes) From 940fa8166cc30e6282b8d7ffeabe5a3df22cf743 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 17 Apr 2017 13:21:18 -0300 Subject: [PATCH 074/140] =?UTF-8?q?Fixes=20#1011=20e=20ainda=20mant=C3=A9m?= =?UTF-8?q?=20#1008?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/pdf_sessao_plenaria_gerar.py | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py b/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py index ec465b485..b2287d989 100644 --- a/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py +++ b/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py @@ -154,10 +154,10 @@ def expedientes(lst_expedientes): tmp += '\t\t\n' tmp += '\t\t\t \n' tmp += '\t\t\n' - for expediente in lst_expedientes: + for idx, expediente in enumerate(lst_expedientes): tmp += '\t\t' + '
    ' + \ expediente['nom_expediente'] + ':
    \n' + \ - '' + \ + '' + \ expediente['txt_expediente'] + '\n' tmp += '\t\t\n' tmp += '\t\t\t \n' @@ -181,8 +181,12 @@ def expediente_materia(lst_expediente_materia): txt_ementa = expediente_materia['txt_ementa'].replace('&', '&') tmp += '' + txt_ementa + '\n' tmp += '' + \ - str(expediente_materia['nom_resultado']) + '\n' + '' + \ - '\n' + str(expediente_materia['nom_resultado']) + '
    \n' + '' + if expediente_materia['votacao_observacao'] != txt_ementa: + tmp += str(expediente_materia['votacao_observacao']) + else: + tmp += 'Vazio' + tmp += '\n' tmp += '\t\t\n' return tmp @@ -236,8 +240,12 @@ def votacao(lst_votacao): txt_ementa = votacao['txt_ementa'].replace('&', '&') tmp += '' + txt_ementa + '\n' tmp += '' + \ - str(votacao['nom_resultado']) + '\n' + '' + \ - '\n' + str(votacao['nom_resultado']) + '\n' + '' + if votacao['votacao_observacao'] != txt_ementa: + tmp += str(votacao['votacao_observacao']) + else: + tmp += 'Vazio' + tmp += '\n' tmp += '\t\t\n' return tmp @@ -290,6 +298,7 @@ def principal(cabecalho_dic, rodape_dic, imagem, sessao, inf_basicas_dic, lst_me tmp += oradores(lst_oradores) tmp += '\t\n' tmp += '\n' + tmp_pdf = parseString(tmp) return tmp_pdf # if hasattr(context.temp_folder,arquivoPdf): From b4a8591294a47567835299b9df87520764dadddc Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 17 Apr 2017 14:21:00 -0300 Subject: [PATCH 075/140] =?UTF-8?q?Conserta=20bug=20onde=20observa=C3=A7?= =?UTF-8?q?=C3=A3o=20de=20vota=C3=A7=C3=A3o=20pega=20de=20lugar=20errado.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bug.txt | 0 sapl/relatorios/views.py | 6 ++++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 bug.txt diff --git a/bug.txt b/bug.txt new file mode 100644 index 000000000..e69de29bb diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index 4a76eee3a..bdd3fc1d9 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -600,7 +600,7 @@ def get_sessao_plenaria(sessao, casa): dic_expediente_materia["nom_resultado"] = ( i.tipo_resultado_votacao.nome) dic_expediente_materia["votacao_observacao"] = ( - expediente_materia.observacao) + i.observacao) else: dic_expediente_materia["nom_resultado"] = _("Matéria não votada") dic_expediente_materia["votacao_observacao"] = _("Vazio") @@ -713,7 +713,7 @@ def get_sessao_plenaria(sessao, casa): for i in resultados: dic_votacao["nom_resultado"] = i.tipo_resultado_votacao.nome if votacao.observacao: - dic_votacao["votacao_observacao"] = votacao.observacao + dic_votacao["votacao_observacao"] = i.observacao else: dic_votacao["nom_resultado"] = _("Matéria não votada") dic_votacao["votacao_observacao"] = _("Vazio") @@ -779,6 +779,8 @@ def relatorio_sessao_plenaria(request, pk): lst_votacao, lst_oradores) = get_sessao_plenaria(sessao, casa) +# import ipdb; ipdb.set_trace() + pdf = pdf_sessao_plenaria_gerar.principal( cabecalho, rodape, From 924f02de04de63cdf5c970e2e68bc559dfd5cbf5 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 17 Apr 2017 15:26:15 -0300 Subject: [PATCH 076/140] =?UTF-8?q?Adiciona=20observa=C3=A7=C3=A3o=20do=20?= =?UTF-8?q?resultado=20da=20vota=C3=A7=C3=A3o=20em=20tela=20de=20ordem=20d?= =?UTF-8?q?o=20dia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/relatorios/views.py | 2 -- sapl/sessao/views.py | 10 +++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index bdd3fc1d9..9ffdd443e 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -779,8 +779,6 @@ def relatorio_sessao_plenaria(request, pk): lst_votacao, lst_oradores) = get_sessao_plenaria(sessao, casa) -# import ipdb; ipdb.set_trace() - pdf = pdf_sessao_plenaria_gerar.principal( cabecalho, rodape, diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 25f72499f..419ea4fa0 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -210,6 +210,7 @@ class MateriaOrdemDiaCrud(MasterDetailCrud): obj.resultado = '''Não há resultado''' else: resultado = resultados[0].tipo_resultado_votacao.nome + resultado_observacao = resultados[0].observacao if self.request.user.has_module_perms(AppConfig.label): url = '' if obj.tipo_votacao == 1: @@ -230,10 +231,13 @@ class MateriaOrdemDiaCrud(MasterDetailCrud): 'pk': obj.sessao_plenaria_id, 'oid': obj.materia_id, 'mid': obj.pk}) - obj.resultado = '%s' % (url, - resultado) + obj.resultado = ('%s
    %s' % + (url, + resultado, + resultado_observacao)) else: - obj.resultado = '%s' % (resultado) + obj.resultado = ('%s
    %s' % + (resultado, resultado_observacao)) return [self._as_row(obj) for obj in object_list] From 0f8e37ea876220ed457957d92e8134dcafc2d7fc Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 17 Apr 2017 15:36:32 -0300 Subject: [PATCH 077/140] Fixes #1002 --- .../templates/pdf_sessao_plenaria_gerar.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py b/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py index b2287d989..d474bc8c4 100644 --- a/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py +++ b/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py @@ -101,7 +101,7 @@ def inf_basicas(inf_basicas_dic): tmp += '\t\tInformações Básicas\n' tmp += '\t\t\n' - tmp += '\t\t\t \n' + tmp += '\t\t\t
    \n' tmp += '\t\t
    \n' tmp += '\t\tTipo da Sessão: ' + \ nom_sessao + '\n' @@ -120,7 +120,7 @@ def mesa(lst_mesa): tmp = '' tmp += '\t\tMesa Diretora\n' tmp += '\t\t\n' - tmp += '\t\t\t \n' + tmp += '\t\t\t
    \n' tmp += '\t\t
    \n' for mesa in lst_mesa: tmp += '\t\t' + \ @@ -136,7 +136,7 @@ def presenca(lst_presenca_sessao): tmp = '' tmp += '\t\tLista de Presença da Sessão\n' tmp += '\t\t\n' - tmp += '\t\t\t \n' + tmp += '\t\t\t
    \n' tmp += '\t\t
    \n' for presenca in lst_presenca_sessao: tmp += '\t\t' + \ @@ -171,7 +171,7 @@ def expediente_materia(lst_expediente_materia): tmp = '' tmp += '\t\tMatérias do Expediente\n\n' tmp += '\t\t\n' - tmp += '\t\t\t \n' + tmp += '\t\t\t
    \n' tmp += '\t\t
    \n' tmp += '\n' tmp += 'MatériaEmentaResultado da Votação\n' @@ -199,7 +199,7 @@ def oradores_expediente(lst_oradores_expediente): tmp = '' tmp += '\t\tOradores do Expediente\n' tmp += '\t\t\n' - tmp += '\t\t\t \n' + tmp += '\t\t\t
    \n' tmp += '\t\t
    \n' for orador_expediente in lst_oradores_expediente: tmp += '\t\t' + str(orador_expediente['num_ordem']) + ' - ' + orador_expediente[ @@ -214,7 +214,7 @@ def presenca_ordem_dia(lst_presenca_ordem_dia): tmp = '' tmp += '\t\tLista de Presença da Ordem do Dia\n' tmp += '\t\t\n' - tmp += '\t\t\t \n' + tmp += '\t\t\t
    \n' tmp += '\t\t
    \n' for presenca_ordem_dia in lst_presenca_ordem_dia: tmp += '\t\t' + \ @@ -230,7 +230,7 @@ def votacao(lst_votacao): tmp = '' tmp += 'Matérias da Ordem do Dia\n\n' tmp += '\t\t\n' - tmp += '\t\t\t \n' + tmp += '\t\t\t
    \n' tmp += '\t\t
    \n' tmp += '\n' tmp += 'MatériaEmentaResultado da Votação\n' @@ -258,7 +258,7 @@ def oradores(lst_oradores): tmp = '' tmp += '\t\tOradores das Explicações Pessoais\n' tmp += '\t\t\n' - tmp += '\t\t\t \n' + tmp += '\t\t\t
    \n' tmp += '\t\t
    \n' for orador in lst_oradores: tmp += '\t\t' + \ From 69a8472ff3d361a356d779fae789b2d9f27713e6 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Mon, 17 Apr 2017 15:54:49 -0300 Subject: [PATCH 078/140] =?UTF-8?q?Remove=20a=20palavra=20'Vazio'=20quando?= =?UTF-8?q?=20n=C3=A3o=20existe=20observa=C3=A7=C3=A3o=20em=20resultado=20?= =?UTF-8?q?de=20vota=C3=A7=C3=A3o.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py | 4 ++-- sapl/relatorios/views.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py b/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py index d474bc8c4..5917d0f8b 100644 --- a/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py +++ b/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py @@ -185,7 +185,7 @@ def expediente_materia(lst_expediente_materia): if expediente_materia['votacao_observacao'] != txt_ementa: tmp += str(expediente_materia['votacao_observacao']) else: - tmp += 'Vazio' + tmp += ' ' tmp += '\n' tmp += '\t\t
    \n' @@ -244,7 +244,7 @@ def votacao(lst_votacao): if votacao['votacao_observacao'] != txt_ementa: tmp += str(votacao['votacao_observacao']) else: - tmp += 'Vazio' + tmp += ' ' tmp += '
    \n' tmp += '\t\t
    \n' diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index 9ffdd443e..3a2ccd047 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -603,7 +603,7 @@ def get_sessao_plenaria(sessao, casa): i.observacao) else: dic_expediente_materia["nom_resultado"] = _("Matéria não votada") - dic_expediente_materia["votacao_observacao"] = _("Vazio") + dic_expediente_materia["votacao_observacao"] = _(" ") lst_expediente_materia.append(dic_expediente_materia) # Lista dos oradores do Expediente @@ -716,7 +716,7 @@ def get_sessao_plenaria(sessao, casa): dic_votacao["votacao_observacao"] = i.observacao else: dic_votacao["nom_resultado"] = _("Matéria não votada") - dic_votacao["votacao_observacao"] = _("Vazio") + dic_votacao["votacao_observacao"] = _(" ") lst_votacao.append(dic_votacao) # Lista dos oradores nas Explicações Pessoais From e007c5e33baed76cc815f9954c54bdff18ec75ca Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Mon, 17 Apr 2017 16:36:39 -0300 Subject: [PATCH 079/140] =?UTF-8?q?Desliga=20indexa=C3=A7=C3=A3o=20ao=20mi?= =?UTF-8?q?grar=20documentos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luciano Almeida --- sapl/legacy/migracao_documentos.py | 28 ++++++++++++++++++++++++++++ sapl/legacy/migration.py | 4 ++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/sapl/legacy/migracao_documentos.py b/sapl/legacy/migracao_documentos.py index 4d9877fa7..21697dc4f 100644 --- a/sapl/legacy/migracao_documentos.py +++ b/sapl/legacy/migracao_documentos.py @@ -4,6 +4,7 @@ import re import magic +from django.db.models.signals import post_delete, post_save from sapl.base.models import CasaLegislativa from sapl.materia.models import (DocumentoAcessorio, MateriaLegislativa, Proposicao) @@ -12,6 +13,8 @@ from sapl.parlamentares.models import Parlamentar from sapl.protocoloadm.models import DocumentoAdministrativo from sapl.sessao.models import SessaoPlenaria from sapl.settings import MEDIA_ROOT +from sapl.utils import delete_texto, save_texto + # MIGRAÇÃO DE DOCUMENTOS ################################################### EXTENSOES = { @@ -160,7 +163,29 @@ def migrar_docs_por_ids(tipo): tipo.__name__, id, destino)) +def desconecta_sinais_indexacao(): + post_save.disconnect(save_texto, NormaJuridica) + post_save.disconnect(save_texto, DocumentoAcessorio) + post_save.disconnect(save_texto, MateriaLegislativa) + post_delete.disconnect(delete_texto, NormaJuridica) + post_delete.disconnect(delete_texto, DocumentoAcessorio) + post_delete.disconnect(delete_texto, MateriaLegislativa) + + +def conecta_sinais_indexacao(): + post_save.connect(save_texto, NormaJuridica) + post_save.connect(save_texto, DocumentoAcessorio) + post_save.connect(save_texto, MateriaLegislativa) + post_delete.connect(delete_texto, NormaJuridica) + post_delete.connect(delete_texto, DocumentoAcessorio) + post_delete.connect(delete_texto, MateriaLegislativa) + + def migrar_documentos(): + # precisamos excluir os sinais de post_save e post_delete para não que o + # computador não trave com a criação de threads desnecessárias + desconecta_sinais_indexacao() + # aqui supomos que uma pasta chamada sapl_documentos está em MEDIA_ROOT # com o conteúdo da pasta de mesmo nome do zope # Os arquivos da pasta serão movidos para a nova estrutura e a pasta será @@ -186,3 +211,6 @@ def migrar_documentos(): len(sobrando))) for doc in sobrando: print(' {}'. format(doc)) + # + # reconexão dos sinais desligados no inicio da migração de documentos + conecta_sinais_indexacao() diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 4a748d49f..8cfa25a4e 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -453,7 +453,7 @@ class DataMigrator: call([PROJECT_DIR.child('manage.py'), 'flush', '--database=default', '--no-input'], stdout=PIPE) - disconecta_sinais_indexacao() + desconecta_sinais_indexacao() info('Começando migração: %s...' % obj) self._do_migrate(obj) @@ -774,7 +774,7 @@ make_with_log.required = foreign_key_required # DISCONNECT SIGNAL ######################################################## -def disconecta_sinais_indexacao(): +def desconecta_sinais_indexacao(): post_save.disconnect(save_texto, NormaJuridica) post_save.disconnect(save_texto, DocumentoAcessorio) post_save.disconnect(save_texto, MateriaLegislativa) From 96ce98f29d7bbdf9131e8e14678d6d4c382df020 Mon Sep 17 00:00:00 2001 From: Edward Date: Thu, 20 Apr 2017 10:11:43 -0300 Subject: [PATCH 080/140] Docker sapl 2 (#1023) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adiciona dDocker baseado em Alpine-Python3 com Ngnix e Gunicorn * Atualiza docker-compose com gunicorn, ngnix e postgres * Ajusta gitignore para ignorar postgres-data * Adiciona script bash para conexao ao banco * Ajusta busy-wait.sh script para sincronizar o banco(postgres) com a aplicação django no docker * Add alias to sapldb * Refazer Dockerfile * Ajusta Dockerfile e docker-compose com entrypoint start.sh * Ajusta start.sh * Adiciona mais pontos de montagem. * Coloca start.sh como executável: chmod +x start.sh * Remove arquivo lixo * Substitui gen-env.py por shell script puro * Ajusta diretorio /var/interlegis/sapl e collect_static como volume no nginix * Simplifica criação de diretórios. * Adiciona ponto de montagem em postgres para importar dados * Adiciona mais parâmetros de ambiente UNIX para entrypoint docker --- .gitignore | 4 +- .travis.yml | 4 ++ Dockerfile | 75 ++++++++++++------------------- busy-wait.sh | 10 +++++ config/env-sample | 8 ++++ config/nginx/sapl.conf | 39 ++++++++++++++++ docker-compose.yml | 26 ++++++++--- docker-env.sh | 6 +++ envfile | 1 + genkey.py | 7 +++ gunicorn_start.sh | 10 +---- sapl/.env_test | 2 +- sapl/static/styles/app.css | 1 + sapl/static/styles/compilacao.css | 1 + scripts_docker/shell_sapl.sh | 3 +- start.sh | 53 ++++++++++++++++++++++ 16 files changed, 186 insertions(+), 64 deletions(-) create mode 100644 busy-wait.sh create mode 100644 config/env-sample create mode 100644 config/nginx/sapl.conf create mode 100644 docker-env.sh create mode 100644 envfile create mode 100644 genkey.py create mode 100644 sapl/static/styles/app.css create mode 100644 sapl/static/styles/compilacao.css create mode 100755 start.sh diff --git a/.gitignore b/.gitignore index 83de47a86..52baa1622 100644 --- a/.gitignore +++ b/.gitignore @@ -92,4 +92,6 @@ collected_static bower bower_components media -whoosh/ \ No newline at end of file +whoosh/ +postgres-data/ +data/ diff --git a/.travis.yml b/.travis.yml index bf5ee38fd..0e0a27ad4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,3 +20,7 @@ script: - ./manage.py bower install - py.test --create-db # - ./test_and_check_qa.sh + +addons: + hosts: + - 127.0.0.1 sapldb diff --git a/Dockerfile b/Dockerfile index 9880dc4ef..6551f656b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,53 +1,34 @@ -FROM ubuntu:15.04 - -RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 - -RUN mkdir /sapl - -RUN echo "deb http://archive.ubuntu.com/ubuntu/ vivid universe" | tee -a "/etc/apt/sources.list" - -RUN \ - apt-get update && \ - apt-get install -y -f \ - software-properties-common \ - libpq-dev \ - graphviz-dev \ - graphviz \ - build-essential \ - git \ - pkg-config \ - python3-dev \ - libxml2-dev \ - libjpeg-dev \ - libssl-dev \ - libffi-dev \ - libxslt1-dev \ - python3-setuptools \ - curl - -# use python3 in pip -RUN easy_install3 pip lxml - -# install nodejs -RUN DEBIAN_FRONTEND=noninteractive curl -sL https://deb.nodesource.com/setup_5.x | bash - -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs - -# install bower -RUN npm install -g bower +FROM alpine:3.5 + +ENV BUILD_PACKAGES postgresql-dev graphviz-dev graphviz build-base git pkgconfig \ +python3-dev libxml2-dev jpeg-dev libressl-dev libffi-dev libxslt-dev nodejs py3-lxml \ +py3-magic postgresql-client vim + +RUN apk add --no-cache python3 && \ + python3 -m ensurepip && \ + rm -r /usr/lib/python*/ensurepip && \ + pip3 install --upgrade pip setuptools && \ + rm -r /root/.cache + +RUN mkdir -p /var/interlegis/sapl &&\ + apk add --update --no-cache $BUILD_PACKAGES && \ + npm install -g bower # Bower aceitar root -RUN touch /root/.bowerrc -RUN chmod 751 /root/.bowerrc -RUN echo "{ \"allow_root\": true }" >> /root/.bowerrc +RUN touch /root/.bowerrc \ +&& chmod 751 /root/.bowerrc \ +&& echo "{ \"allow_root\": true }" >> /root/.bowerrc \ +&& npm cache clean + +WORKDIR /var/interlegis/sapl/ + +ADD . /var/interlegis/sapl/ -WORKDIR /sapl +COPY start.sh /var/interlegis/sapl/ -ADD . /sapl +RUN chmod +x /var/interlegis/sapl/start.sh -RUN pip install -r requirements/dev-requirements.txt -RUN pip install --upgrade setuptools +RUN pip install -r /var/interlegis/sapl/requirements/requirements.txt --upgrade setuptools -# RUN python3 manage.py bower install +VOLUME ["/var/interlegis/sapl/data", "/var/interlegis/sapl/media", "/var/interlegis/sapl/collected_static"] +ENTRYPOINT ["/var/interlegis/sapl/start.sh"] diff --git a/busy-wait.sh b/busy-wait.sh new file mode 100644 index 000000000..128592ffc --- /dev/null +++ b/busy-wait.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +while true; do + COUNT_PG=`psql --dbname=postgresql://sapl:sapl@sapldb/sapl -c '\l \q' | grep sapl | wc -l` + if ! [ "$COUNT_PG" -eq "0" ]; then + break + fi + echo "Esperando Database Setup" + sleep 10 +done diff --git a/config/env-sample b/config/env-sample new file mode 100644 index 000000000..c358f9017 --- /dev/null +++ b/config/env-sample @@ -0,0 +1,8 @@ +DATABASE_URL = postgresql://postgres:@sapldb:/sapl +KEY +DEBUG = False +EMAIL_USE_TLS = True +EMAIL_PORT = 587 +EMAIL_HOST = '' +EMAIL_HOST_USER = '' +EMAIL_HOST_PASSWORD = '' diff --git a/config/nginx/sapl.conf b/config/nginx/sapl.conf new file mode 100644 index 000000000..ef3dac421 --- /dev/null +++ b/config/nginx/sapl.conf @@ -0,0 +1,39 @@ +upstream sapl_server { + + server unix:/var/interlegis/sapl/run/gunicorn.sock fail_timeout=0; + +} + +server { + + listen 80; + server_name sapl.test; + + client_max_body_size 4G; + + location /static/ { + alias /var/interlegis/sapl/collected_static/; + } + + location /media/ { + alias /var/interlegis/sapl/media/; + } + + location / { + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_set_header Host $http_host; + + proxy_redirect off; + + + if (!-f $request_filename) { + proxy_pass http://sapl_server; + break; + } + } + error_page 500 502 503 504 /500.html; + location = /500.html { + root /var/interlegis/sapl/sapl/static/; + } +} diff --git a/docker-compose.yml b/docker-compose.yml index 8de57e3aa..a073bb4ee 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,31 @@ -localhost: +server: + image: nginx:latest + ports: + - "80:80" + volumes: + - ./config/nginx:/etc/nginx/conf.d + - ./collected_static:/var/interlegis/sapl/collected_static + - ./media:/var/interlegis/sapl/media + volumes_from: + - web +sapldb: image: postgres environment: POSTGRES_PASSWORD: sapl POSTGRES_USER: sapl POSTGRES_DB: sapl + PGDATA : /var/lib/postgresql/data/ + volumes: + - ./postgres-data/data/:/var/lib/postgresql/data/ + - ./data:/data-import ports: - "5532:5432" web: build: . - command: /bin/sh -c "/bin/sh busy-wait.sh && python3 manage.py bower install && python3 manage.py migrate && /bin/sh gunicorn_start.sh /sapl" volumes: - - .:/sapl - ports: - - "8000:8000" + - .:/var/interlegis/sapl/ + - ./data:/var/interlegis/sapl/data + - ./media:/var/interlegis/sapl/media + - ./collected_static:/var/interlegis/sapl/collected_static links: - - localhost + - sapldb diff --git a/docker-env.sh b/docker-env.sh new file mode 100644 index 000000000..07528b0f1 --- /dev/null +++ b/docker-env.sh @@ -0,0 +1,6 @@ +#/bin/bash + +KEY=`python gen-key.py` +echo $KEY + +sed -e "s/SECRET_KEY = None/SECRET_KEY = $KEY/g" config/env-sample diff --git a/envfile b/envfile new file mode 100644 index 000000000..a7aef4b0f --- /dev/null +++ b/envfile @@ -0,0 +1 @@ +EMAIL_HOST_USER=foo diff --git a/genkey.py b/genkey.py new file mode 100644 index 000000000..85f399c54 --- /dev/null +++ b/genkey.py @@ -0,0 +1,7 @@ +import random + +def generate_secret(): + return ''.join([random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)]) + +if __name__ == '__main__': + print(generate_secret()) diff --git a/gunicorn_start.sh b/gunicorn_start.sh index 34147cb97..9669644fa 100755 --- a/gunicorn_start.sh +++ b/gunicorn_start.sh @@ -12,23 +12,17 @@ then fi NAME="SAPL" # Name of the application (*) -DJANGODIR=/var/interlegis/sapl # Django project directory (*) +DJANGODIR=/var/interlegis/sapl/ # Django project directory (*) SOCKFILE=/var/interlegis/sapl/run/gunicorn.sock # we will communicate using this unix socket (*) USER=`whoami` # the user to run as (*) GROUP=`whoami` # the group to run as (*) -NUM_WORKERS=9 # how many worker processes should Gunicorn spawn (*) +NUM_WORKERS=3 # how many worker processes should Gunicorn spawn (*) # NUM_WORKERS = 2 * CPUS + 1 DJANGO_SETTINGS_MODULE=sapl.settings # which settings file should Django use (*) DJANGO_WSGI_MODULE=sapl.wsgi # WSGI module name (*) echo "Starting $NAME as `whoami` on base dir $SAPL_DIR" -# Activate the virtual environment -cd $DJANGODIR -source /var/interlegis/.virtualenvs/sapl/bin/activate -export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE -export PYTHONPATH=$DJANGODIR:$PYTHONPATH - # Create the run directory if it doesn't exist RUNDIR=$(dirname $SOCKFILE) test -d $RUNDIR || mkdir -p $RUNDIR diff --git a/sapl/.env_test b/sapl/.env_test index 5c2c60ec1..9416d402d 100644 --- a/sapl/.env_test +++ b/sapl/.env_test @@ -1,4 +1,4 @@ -DATABASE_URL = postgresql://postgres:@localhost:/sapl +DATABASE_URL = postgresql://postgres:@sapldb:/sapl SECRET_KEY=TravisTest DEBUG=False EMAIL_USE_TLS = True diff --git a/sapl/static/styles/app.css b/sapl/static/styles/app.css new file mode 100644 index 000000000..e7146b1f4 --- /dev/null +++ b/sapl/static/styles/app.css @@ -0,0 +1 @@ +.logo img{width:40px;height:40px;margin:5px 15px}.vcenter{display:inline-block;vertical-align:middle;float:none;padding:10px}nav.navbar{border-radius:0;font-size:15px}nav .navbar-nav>li>a{padding-top:0px;padding-bottom:0px;line-height:75px}nav .navbar-nav>li>a:hover{background-color:#23527c}nav .navbar-nav>li:nth-child(2)>.dropdown-menu{right:auto}nav .navbar-nav:last-child>li:last-child a{padding-right:0px}.masthead{padding:10px}.masthead .nav{clear:both}.masthead .navbar-brand{color:inherit;font-size:24px}.masthead .navbar-brand img.img-responsive{height:95px;margin-right:15px}.masthead .navbar-brand small{color:#93A4AA;font-size:75%;line-height:25px}.navbar{margin-bottom:0}.navbar-brand{padding:0px}h1,.h1{font-size:30px}h2,.h2{font-size:24px}h3,.h3{font-size:20px}h4,.h4{font-size:16px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}.page-header{margin:20px 0px 10px}.btn:hover,.btn:focus{color:inherit}.caret.top{transform:rotate(180deg)}.btn-default.btn-excluir{color:#d9534f}.btn-default.btn-excluir:hover{color:#fff;border-color:#de6764;background-color:#de6764}.controls-file{padding:10px;border:1px solid #d6e1e5;border-radius:4px}.controls-file label.checkbox-inline{margin:0px;display:block}.controls-radio-checkbox{padding:0px;border:1px solid #d6e1e5;border-radius:4px;min-height:20px}.controls-radio-checkbox .help-block{margin:15px;padding:15px;border:2px dashed #d6e1e5}.controls-radio-checkbox label{padding:5px}.controls-radio-checkbox label .icons{top:5px;left:8px}.controls-radio-checkbox label.checkbox-inline,.controls-radio-checkbox label.radio-inline{padding:8px;padding-left:36px}.controls-radio-checkbox label.checkbox-inline .icons,.controls-radio-checkbox label.radio-inline .icons{top:8px;left:8px}.controls-radio-checkbox .checkbox,.controls-radio-checkbox .radio,.controls-radio-checkbox .checkbox-inline,.controls-radio-checkbox .radio-inline{margin:0}.controls-radio-checkbox .checkbox:hover,.controls-radio-checkbox .radio:hover,.controls-radio-checkbox .checkbox-inline:hover,.controls-radio-checkbox .radio-inline:hover{background-color:#d6e1e5}p.control-label{font-weight:bold}.legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5;clear:both}.grid-gutter-width-right{margin-right:15px}html{position:relative;min-height:100%}body{margin-bottom:160px}.footer{position:absolute;bottom:0;width:100%;height:140px;background:#364347 none repeat scroll 0% 0%;color:white;text-align:center}.footer p{color:white;margin-top:10px}.footer .container{padding-top:25px}.pagination{padding-top:25px}.modal .alert{margin-bottom:0}fieldset fieldset{font-size:95%}fieldset fieldset legend{font-size:18px}.avatar-parlamentar{height:84px;width:84px}#conteudo{position:relative;padding:2em 1.5em 1.5em 1.5em;overflow:hidden;font-size:100%;text-align:left;min-height:350px;max-width:1000px;margin:0 auto}#conteudo a:hover{color:#444;-webkit-transition:0.3s ease-in;-moz-transition:0.3s ease-in;-o-transition:0.3s ease-in}#homeIndex{text-align:center}.homeBanner span{color:white;font-size:32px;font-weight:600;display:inline-block;vertical-align:middle;padding:2px 45px 4px;border:2px solid}.homeBanner::after{display:inline-block;vertical-align:middle;height:100%}.homeBlock{display:inline-block;position:relative;background-color:#F3F3F3;width:190px;height:260px;margin:3px;text-align:center;font-size:0;overflow:hidden}.homeBlock>a{display:block;position:absolute;width:100%;height:100%;top:0;left:0}.homeBlock::after{content:'';display:inline-block;vertical-align:middle;height:100%;overflow:visible;clear:none;visibility:initial}.homeContent{position:relative;padding:10px;text-align:justify;font-size:14px;color:#FFF;opacity:0;transition:opacity 0.5s ease;display:inline-block;vertical-align:middle}.homeContent p{display:block;line-height:13px;font-size:80%;color:white}.homeIcon{position:relative;display:inline-block;width:105px;height:105px;border-radius:50%;background:#364347;z-index:1}.homeIcon::before{content:'';position:absolute;width:100%;height:100%;border-radius:50%;background:#364347;top:0;left:0;transform:scale(0.95);transition:transform 0.6s ease}.homeIcon img{position:absolute;margin:auto;top:0;bottom:0;right:0;left:0;transition:opacity 0.4s 0.4s ease}.homeFront{position:absolute;top:46%;width:100%;font-size:0;transform:translateY(-60%)}.homeFront h2{position:absolute;margin-top:18px;font-size:22px;font-weight:700;color:#595959 !important;width:100%;padding:0 6%;z-index:0}.homeTitle{display:block;height:32px;text-align:center;width:100%;opacity:0;transition:opacity 0.4s ease}.homeTitle::before{content:'';display:inline-block;vertical-align:middle;height:100%}.homeTitle h2{display:inline-block;vertical-align:middle;max-width:110px;font-size:14px;color:white !important;line-height:1em}.homeTitle img{display:inline-block;vertical-align:middle;height:30px;margin-right:5px}.homeBlock:hover .homeIcon::before{transform:scale(3.6) translateY(7px)}.homeBlock:hover .homeContent{opacity:1;transition-delay:0.2s}.homeBlock:hover .homeIcon img{opacity:0;transition-duration:0.2s;transition-delay:0s}.homeBlock:hover .homeTitle{opacity:1}h1,h2,h3,h4,h5,h6,form,dl,dt,dd,p,div,img,a{margin:0;padding:0}p{margin:0.5em 0}.manual li{display:list-item;line-height:1.5em;padding-right:0}.manual li a{background-color:transparent;border:none;border-radius:none;padding:0}.manual,.manual ul{padding-left:1.5em;list-style-type:none;margin-top:0;font-size:100%}@media (max-width: 1199px){.masthead .navbar-brand{font-size:22px}.masthead .navbar-brand img.img-responsive{height:60px;width:60px;margin-right:7.5px}.navbar-nav>li>a{padding-left:10.71429px;padding-right:10.71429px}}@media (max-width: 1091px){.navbar-nav>li>a{padding-left:7.5px;padding-right:7.5px}}@media (min-width: 1092px) and (max-width: 1199px){.container{width:1070px}} diff --git a/sapl/static/styles/compilacao.css b/sapl/static/styles/compilacao.css new file mode 100644 index 000000000..ed50d8998 --- /dev/null +++ b/sapl/static/styles/compilacao.css @@ -0,0 +1 @@ +a:link:after,a:visited:after{content:""}.test_import:nth-child(even){background-color:#ccc}#wait_message{display:block;position:fixed;top:0;bottom:0;left:0;right:0;background-color:rgba(220,220,220,0.75);z-index:99}#wait_message #msg{position:relative;margin:20% auto;padding:1.2em 2em;max-width:600px;text-align:center;font-size:1.5em;color:#677;border:1px solid #eee;background-color:#fff !important;box-shadow:0 1px 2px #999}.text-center{text-align:center}.cp-notify{z-index:9999;position:fixed;top:2em;left:50%;min-width:600px;transform:translate(-50%, 0);transition:all 0.4s ease;opacity:0.97}.cp-notify.hide{opacity:0;top:-1000px;display:block !important;transition:all 0.4s ease}.cp-notify .message{padding:1em;border:2px solid rgba(0,0,0,0.1);border-radius:4px;color:rgba(0,0,0,0.6);line-height:1em;font-size:1.3em;text-align:center;box-shadow:0 0 100px rgba(0,0,0,0.2)}.cp .desativado .dtxt,.cp .dpt .dptt>a.desativado .dtxt,.cp .desativado .dtxt *,.cp .dpt .dptt>a.desativado .dtxt *,.cp .desativado .dpt-link,.cp .dpt .dptt>a.desativado .dpt-link,.cp .desativado .dpt-link *,.cp .dpt .dptt>a.desativado .dpt-link *{text-decoration:line-through;color:#999 !important}.cp .desativado .dtxt table,.cp .dpt .dptt>a.desativado .dtxt table,.cp .desativado .dtxt table td,.cp .dpt .dptt>a.desativado .dtxt table td,.cp .desativado .dtxt * table,.cp .dpt .dptt>a.desativado .dtxt * table,.cp .desativado .dtxt * table td,.cp .dpt .dptt>a.desativado .dtxt * table td,.cp .desativado .dpt-link table,.cp .dpt .dptt>a.desativado .dpt-link table,.cp .desativado .dpt-link table td,.cp .dpt .dptt>a.desativado .dpt-link table td,.cp .desativado .dpt-link * table,.cp .dpt .dptt>a.desativado .dpt-link * table,.cp .desativado .dpt-link * table td,.cp .dpt .dptt>a.desativado .dpt-link * table td{border:1px dotted #ccc}.cp a{text-decoration:none;cursor:pointer}.cp .diff .desativado,.cp .diff .dpt .dptt>a.desativado,.cp .dpt .diff .dptt>a.desativado,.cp .diff .desativado *,.cp .diff .dpt .dptt>a.desativado *,.cp .dpt .diff .dptt>a.desativado *{text-decoration:line-through;color:#ddd !important;font-size:90%}.cp .diff .added{color:#04DE2C}.cp .dpt{font-size:1em;position:relative}.cp .dpt.indent{padding-left:1em}.cp .dpt .ementa{padding:2em 0em 2em 35%;font-weight:bold}.cp .dpt .titulo_generico,.cp .dpt .anexo,.cp .dpt .disp_preliminares,.cp .dpt .disp_gerais,.cp .dpt .disp_transitorias,.cp .dpt .disp_finais,.cp .dpt .parte,.cp .dpt .livro,.cp .dpt .titulo,.cp .dpt .capitulo,.cp .dpt .secao,.cp .dpt .subsecao,.cp .dpt .itemsecao{text-align:center;font-weight:bold;margin-bottom:1em;font-size:1.5em;margin-top:3em}.cp .dpt .titulo{margin-top:2em}.cp .dpt .capitulo{margin-top:1.5em;font-size:1.3em}.cp .dpt .secao{margin-top:1.2em;margin-bottom:0.7em;font-size:1.2em}.cp .dpt .subsecao,.cp .dpt .itemsecao{margin-top:1em;margin-bottom:0.6em;font-size:1.2em;font-style:italic}.cp .dpt .artigo{font-size:1.15em;float:left}.cp .dpt .artigo .dptt{position:relative}.cp .dpt .caput{margin-top:0.3333em;font-size:1.15em}.cp .dpt .paragrafo{font-size:1.1em;margin-top:0.2222em}.cp .dpt .inciso{font-size:1.1em;margin-top:0.1667em}.cp .dpt .alinea{font-size:1.0em;margin-top:2px}.cp .dpt .item{font-size:1.0em;margin-top:2px}.cp .dpt .bloco_alteracao{padding-left:10%;font-style:italic;color:#018}.cp .dpt .bloco_alteracao a{text-decoration:underline}.cp .dpt .bloco_alteracao a,.cp .dpt .bloco_alteracao table,.cp .dpt .bloco_alteracao table td{color:#018 !important}.cp .dpt .dn{font-weight:normal;position:relative;font-size:70%}.cp .dpt .dn p,.cp .dpt .dn ul{font-weight:normal;margin:0 0 0 0;list-style:none;padding:0}.cp .dpt .dn .dnl{display:block;text-align:left !important}.cp .dpt .dn .dnl *{display:inline}.cp .dpt .dn .dnl .bullet{padding:0 0.333em;display:inline-block}.cp .dpt .dn .dnl .dnli{min-height:2.5em}.cp .dpt .dn .dnl .dnli:hover ul{transition:opacity 0.5s linear, clip 0s 0.3s;clip:auto;opacity:1;background:rgba(230,230,230,0.9)}.cp .dpt .dn .dnl .dnli ul{transition:opacity 0.5s linear, clip 0s 0.3s;clip:rect(0, 0, 0, 0);opacity:0;position:absolute;background:transparent;right:0;padding:0.2em 0.5em 0em 0.5em;border:1px solid #c7e3d3;border-top:0px;font-size:1.5rem}.cp .dpt .dn .dnl .dnli ul li{display:table-cell;color:#aaa}.cp .dpt .dn .dnl .dnli ul li:hover{color:#787}.cp .dpt .dn .dnl .dnli ul li:hover a{color:#27AE60 !important}.cp .dpt .dn .dnl .dnli ul li .nowner{color:#27AE60 !important}.cp .dpt .dn .dnl .dnli .ntitulo{font-weight:bold;color:#03A203;text-decoration:none}.cp .dpt .dn .dnl .dnli .ntitulo a{color:#294 !important}.cp .dpt .dn .dnl .dnli .ntexto{color:#06D806}.cp .dpt .dn .dnl .dnli .ntexto a{color:#03A203 !important}.cp .dpt .dn .dnl:hover{display:block}.cp .dpt .dn .dnl:hover *{display:block}.cp .dpt .dn .dnl:hover>.bullet{display:none}.cp .dpt .dn .dnl:hover .dnli{margin-top:0.5em;border-top:1px solid #c7e3d3}.cp .dpt .dptt>a{color:#444444}.cp .dpt .dptt>a.nota-alteracao{color:#02baf2;font-size:0.75em}.cp .dpt .dptt>a.nota-alteracao:hover{text-decoration:underline}.cp .dpt .dptt .dne{position:absolute;display:block;right:0;left:0;top:0;height:0;transform:scaleX(0);transform-origin:right;transition:all 0.3s ease;border-top:1px solid #2980B9}.cp .dpt .dptt .dne ul.btns-action{list-style:none;padding:0;position:absolute;right:0;background-color:#2980B9}.cp .dpt .dptt .dne ul.btns-action li{float:left}.cp .dpt .dptt .dne ul.btns-action li:hover{background-color:rgba(0,0,0,0.1)}.cp .dpt .dptt .dne ul.btns-action li a{color:white;padding:0.15em 1em 0;display:inline-block}.cp .dpt .dptt .dne-nota{position:relative;transform:scaleX(1);height:auto;border-top:0px}.cp .dpt .dptt .dne-nota ul.btns-action{display:none}.cp .dpt .dptt .dne-nota .dne-form{margin:1em -2em 0em;text-align:left;font-size:1.6rem}.cp .dpt .dptt:hover .dne{height:0.1667rem;transform:scaleX(1);transition-delay:1s}.cp .dpt .dptt:hover .dne-nota{height:auto;transition-delay:0s}.cp .tipo-vigencias{list-style:none;position:fixed;bottom:0px;left:50%;transform:translate(-50%, 0);margin:0;padding:0;background-color:#2980B9;z-index:1000;opacity:0.9;transition:all 0.3s ease-in-out}.cp .tipo-vigencias li{display:inline-block;border-left:1px solid #fff;float:left}.cp .tipo-vigencias li a{color:white;padding:0.3em 1em 0;display:inline-block;font-size:110%;cursor:pointer}.cp .tipo-vigencias li a.selected{background-color:rgba(0,0,0,0.5)}.cp .tipo-vigencias li:hover{background-color:rgba(0,0,0,0.2)}.cp .tipo-vigencias:hover{opacity:1}.cp.cpe .desativado,.cp.cpe .dpt .dptt>a.desativado{text-decoration:line-through;color:#999 !important}.cp.cpe .desativado table,.cp.cpe .dpt .dptt>a.desativado table,.cp.cpe .desativado table td,.cp.cpe .dpt .dptt>a.desativado table td{border:1px dotted #ccc}.cp.cpe .desativado a.nota-alteracao *{color:#02baf2 !important}.cp.cpe .dpt{display:block}.cp.cpe .dpt>.dpt-actions-fixed{position:absolute;right:-0.8em;top:-0.8em;z-index:3;opacity:0}.cp.cpe .dpt>.dpt-actions-fixed .activate{display:none}.cp.cpe .dpt>.dpt-actions-fixed .deactivate{display:inline}.cp.cpe .dpt>.dpt-actions-fixed .btn-dpt-edit.btn-default{color:#333}.cp.cpe .dpt>.dpt-actions-fixed .btn-dpt-edit.btn-default:hover{color:#fff;background-color:#02baf2}.cp.cpe .dpt>.dpt-actions,.cp.cpe .dpt>.dpt-actions-bottom{display:none}.cp.cpe .dpt>.dpt-text{cursor:text;min-height:30px;border:1px solid transparent}.cp.cpe .dpt>.dpt-text:hover,.cp.cpe .dpt>.dpt-text.hover-fixed{background-color:rgba(0,0,0,0.01);color:#2980B9;border:1px solid #eee;transition:color 0.3s ease}.cp.cpe .dpt>.dpt-text.artigo{float:none}.cp.cpe .dpt>.dpt-text a.link-rotulo{color:#000}.cp.cpe .dpt:hover>.dpt-actions-fixed{opacity:1}.cp.cpe .dpt:hover>.dpt-actions-fixed:hover ~ .dpt-text{background-color:rgba(0,0,0,0.01);color:#2980B9;border:1px solid #eee;transition:color 0.3s ease}.cp.cpe .dpt .semtexto{font-weight:bold;color:#9aaed6}.cp.cpe .dpt .semtexto:hover{color:#5f76a4}.cp.cpe .dpt-alts{margin:0;margin-bottom:1em;padding:0;background-color:transparent;min-height:100px;border:2px dashed #fff}.cp.cpe .dpt-alts:hover{border-color:#d9ddde}.cp.cpe .dpt-alts:empty{border-color:#ddd}.cp.cpe .dpt-alts.drag{width:100% !important;border-color:#d9ddde}.cp.cpe .dpt-alts.drag .dpt{transition-duration:0s !important}.cp.cpe .dpt-alts .dpt{width:100% !important;box-shadow:0 -1px 0 #e5e5e5,0 0 2px rgba(0,0,0,0.12),0 2px 4px rgba(0,0,0,0.24);padding:0;margin:0;background-color:#edf0f1;height:auto !important;min-height:2em;z-index:1}.cp.cpe .dpt-alts .dpt:not(:first-child){border-top:1px solid white}.cp.cpe .dpt-alts .dpt>.dpt-text{padding:0.3em 1em;margin-top:0;margin-bottom:0}.cp.cpe .dpt-alts .dpt>.dpt-text a.link-rotulo{text-decoration:underline}.cp.cpe .dpt-alts .dpt-selected.dpt{margin:0em -0.5em}.cp.cpe .dpt-selected.dpt{width:auto !important;margin:1em -0.5em;border:1px solid #fad46b !important;padding:0;background-color:#fafafa;border-radius:3px;z-index:4}.cp.cpe .dpt-selected.dpt>.dpt-text{border:1px solid transparent}.cp.cpe .dpt-selected.dpt>.dpt-text:hover{border:1px solid transparent;background-color:transparent}.cp.cpe .dpt-selected.dpt>.dpt-form{margin-bottom:0em}.cp.cpe .dpt-selected.dpt>.dpt-actions,.cp.cpe .dpt-selected.dpt>.dpt-actions-bottom{display:table;background-color:#e5e5e5;padding:1em;margin-bottom:0em;width:100%}.cp.cpe .dpt-selected.dpt>.dpt-actions>.btn-action,.cp.cpe .dpt-selected.dpt>.dpt-actions-bottom>.btn-action{display:table-cell;float:none}.cp.cpe .dpt-selected.dpt>.dpt-actions .btn-excluir,.cp.cpe .cp.cpe1_old_apagar .dpt-selected.dpt>.dpt-actions .csform .actions_inserts>li>a.btn-salvar,.cp.cpe1_old_apagar .cp.cpe .dpt-selected.dpt>.dpt-actions .csform .actions_inserts>li>a.btn-salvar,.cp.cpe .dpt-selected.dpt>.dpt-actions-bottom .btn-excluir,.cp.cpe .cp.cpe1_old_apagar .dpt-selected.dpt>.dpt-actions-bottom .csform .actions_inserts>li>a.btn-salvar,.cp.cpe1_old_apagar .cp.cpe .dpt-selected.dpt>.dpt-actions-bottom .csform .actions_inserts>li>a.btn-salvar{display:inline-block;opacity:0.3}.cp.cpe .dpt-selected.dpt>.dpt-actions .btn-excluir:hover,.cp.cpe .cp.cpe1_old_apagar .dpt-selected.dpt>.dpt-actions .csform .actions_inserts>li>a.btn-salvar:hover,.cp.cpe1_old_apagar .cp.cpe .dpt-selected.dpt>.dpt-actions .csform .actions_inserts>li>a.btn-salvar:hover,.cp.cpe .dpt-selected.dpt>.dpt-actions-bottom .btn-excluir:hover,.cp.cpe .cp.cpe1_old_apagar .dpt-selected.dpt>.dpt-actions-bottom .csform .actions_inserts>li>a.btn-salvar:hover,.cp.cpe1_old_apagar .cp.cpe .dpt-selected.dpt>.dpt-actions-bottom .csform .actions_inserts>li>a.btn-salvar:hover{opacity:1}.cp.cpe .dpt-selected.dpt>.dpt-actions-bottom{margin:0}.cp.cpe .dpt-selected .dpt-block{border-top:1px solid #e5e5e5 !important;opacity:0.6;transition:opacity 0.4s ease}.cp.cpe .dpt-selected .dpt-block:hover{opacity:1}.cp.cpe .dpt-selected .dpt-text{opacity:0.7;margin:0;padding:0.7em}.cp.cpe .dpt-selected .dpt-text:hover{opacity:1;background-color:#f5f5f5}.cp.cpe .dpt-selected .dpt-alts{margin:1em}.cp.cpe .dpt-selected .dpt-alts .dpt{box-shadow:0 0 0}.cp.cpe .dpt-selected>.dpt-actions-fixed{opacity:1;top:-12px;right:0.5em}.cp.cpe .dpt-selected>.dpt-actions-fixed .activate{display:inline}.cp.cpe .dpt-selected>.dpt-actions-fixed .deactivate{display:none}.cp.cpe .dpt-selected>.dpt-actions-fixed .btn-dpt-edit{padding-top:2px;padding-bottom:1px}.cp.cpe .dpt-selected>.dpt-actions-fixed .btn-dpt-edit.btn-default{background-color:#fad46b;border:1px solid #fad46b}.cp.cpe .dpt-selected .dropdown-menu.dropdown-menu-left{right:auto !important;left:0;padding:2px 0}.cp.cpe .dpt-selected .dropdown-menu.dropdown-menu-left>.top.arrow{right:88%;left:auto}.cp.cpe .dpt-selected .dropdown-menu li a{padding-top:2px;padding-bottom:2px}.cp.cpe .dpt-selected .btn-group .radius-right{border-bottom-right-radius:4px !important;border-top-right-radius:4px !important}.cp.cpe .dpt-selected:hover>.dpt-actions-fixed{opacity:1}.cp.cpe1_old_apagar{margin-bottom:15em}.cp.cpe1_old_apagar .desativado,.cp.cpe1_old_apagar .dpt .dptt>a.desativado,.cp.cpe1_old_apagar .desativado *,.cp.cpe1_old_apagar .dpt .dptt>a.desativado *{text-decoration:line-through;color:#999 !important}.cp.cpe1_old_apagar .desativado table,.cp.cpe1_old_apagar .dpt .dptt>a.desativado table,.cp.cpe1_old_apagar .desativado table td,.cp.cpe1_old_apagar .dpt .dptt>a.desativado table td,.cp.cpe1_old_apagar .desativado * table,.cp.cpe1_old_apagar .dpt .dptt>a.desativado * table,.cp.cpe1_old_apagar .desativado * table td,.cp.cpe1_old_apagar .dpt .dptt>a.desativado * table td{border:1px dotted #ccc}.cp.cpe1_old_apagar a{text-decoration:none;cursor:pointer}.cp.cpe1_old_apagar .dpt{position:relative;display:block}.cp.cpe1_old_apagar .dpt .semtexto{font-weight:bold;color:#BFD1F6}.cp.cpe1_old_apagar .dpt .artigo{float:none}.cp.cpe1_old_apagar .dpt .caput{margin-top:0}.cp.cpe1_old_apagar .dpt>.actions_right,.cp.cpe1_old_apagar .dpt-selected .csform .dpt>.actions_left{color:#fff;right:0em;position:absolute;opacity:0;transition:all 0.4s ease-in-out;z-index:1000}.cp.cpe1_old_apagar .dpt>.actions_right a.btn-bloco,.cp.cpe1_old_apagar .dpt-selected .csform .dpt>.actions_left a.btn-bloco{background-color:#3498db;color:#ffffff !important;padding:8px 18px 6px;display:inline-block;line-height:1;float:right}.cp.cpe1_old_apagar .dpt>.actions_right a.btn-bloco:hover,.cp.cpe1_old_apagar .dpt-selected .csform .dpt>.actions_left a.btn-bloco:hover{opacity:1;background-image:-webkit-linear-gradient(top, #1c81c4, #0b6dad);background-image:-moz-linear-gradient(top, #1c81c4, #0b6dad);background-image:-ms-linear-gradient(top, #1c81c4, #0b6dad);background-image:-o-linear-gradient(top, #1c81c4, #0b6dad);background-image:linear-gradient(to bottom, #1c81c4, #0b6dad)}.cp.cpe1_old_apagar .dpt:hover>.actions_right,.cp.cpe1_old_apagar .dpt-selected .csform .dpt:hover>.actions_left{opacity:1}.cp.cpe1_old_apagar .dpt .bloco{display:block;clear:both}.cp.cpe1_old_apagar .dpt .bloco *:hover{color:#27AE60}.cp.cpe1_old_apagar .dpt .bloco .de{cursor:pointer}.cp.cpe1_old_apagar .dpt .articulacao{border-top:2px solid #e5e5e5;margin:2em 0}.cp.cpe1_old_apagar .dpt .bloco_alteracao{margin:1em 0;padding:0em;background-color:transparent;min-height:100px;border:2px dashed #fff}.cp.cpe1_old_apagar .dpt .bloco_alteracao:hover{border-color:#d9ddde}.cp.cpe1_old_apagar .dpt .bloco_alteracao.drag{width:100% !important;border-color:#d9ddde}.cp.cpe1_old_apagar .dpt .bloco_alteracao.drag .dpt{transition-duration:0s !important}.cp.cpe1_old_apagar .dpt .bloco_alteracao .dpt{width:100% !important;box-shadow:0 -1px 0 #e5e5e5,0 0 2px rgba(0,0,0,0.12),0 2px 4px rgba(0,0,0,0.24);padding:0.3em 1em;margin:0;background-color:#edf0f1;z-index:1}.cp.cpe1_old_apagar .dpt .bloco_alteracao .dpt:not(:first-child){border-top:1px solid white}.cp.cpe1_old_apagar .dpt .bloco_alteracao .dpt.ui-draggable div{cursor:pointer}.cp.cpe1_old_apagar .dpt .bloco_alteracao .dpt.dpt-comp-selected{transition:all 0.3s ease;width:auto !important;margin:2em -3.7em;box-shadow:0 0 6px rgba(0,0,0,0.16),0 6px 12px rgba(0,0,0,0.32)}.cp.cpe1_old_apagar .dpt-selected{font-size:1em;border:0px solid #CCC;margin:1em -1.8em 1em -1.8em;padding:2.2em 2.2em 1.6em 2.2em;box-shadow:-4px 15px 15px rgba(0,0,0,0.1),0px 6px 6px rgba(0,0,0,0.23);background-image:-webkit-linear-gradient(top, #eaeaee, #ddd);background-image:-moz-linear-gradient(top, #eaeaee, #ddd);background-image:-ms-linear-gradient(top, #eaeaee, #ddd);background-image:-o-linear-gradient(top, #eaeaee, #ddd);background-image:linear-gradient(to bottom, #eaeaee, #ddd)}.cp.cpe1_old_apagar .dpt-selected ul{list-style:none;margin:0;padding:0}.cp.cpe1_old_apagar .dpt-selected .semtexto{color:#999}.cp.cpe1_old_apagar .dpt-selected .bloco{opacity:0.5}.cp.cpe1_old_apagar .dpt-selected .bloco:hover{opacity:1}.cp.cpe1_old_apagar .dpt-selected .bloco a:hover{background:transparent}.cp.cpe1_old_apagar .dpt-selected>.bloco{opacity:1;margin:1em}.cp.cpe1_old_apagar .dpt-selected .bloco_alteracao{margin:0;padding:1em;border:0 transparent;background-image:-webkit-linear-gradient(top, #eaeaee, #ddd);background-image:-moz-linear-gradient(top, #eaeaee, #ddd);background-image:-ms-linear-gradient(top, #eaeaee, #ddd);background-image:-o-linear-gradient(top, #eaeaee, #ddd);background-image:linear-gradient(to bottom, #eaeaee, #ddd)}.cp.cpe1_old_apagar .dpt-selected .bloco_alteracao:hover{border-color:transparent}.cp.cpe1_old_apagar .dpt-selected .bloco_alteracao.drag{width:100% !important}.cp.cpe1_old_apagar .dpt-selected .bloco_alteracao.drag .dpt{transition-duration:0s !important}.cp.cpe1_old_apagar .dpt-selected .bloco_alteracao .dpt{width:auto !important;transition:all 0.3s ease;background-color:white}.cp.cpe1_old_apagar .dpt-selected .bloco_alteracao .dpt:not(:first-child){border-top:0px solid white}.cp.cpe1_old_apagar .dpt-selected>.dpt{padding:0}.cp.cpe1_old_apagar .dpt-selected>.dpt:last-child{padding-bottom:1em}.cp.cpe1_old_apagar .dpt-selected>.actions_right a.btn-bloco,.cp.cpe1_old_apagar .dpt-selected .csform .dpt-selected>.actions_left a.btn-bloco{display:none}.cp.cpe1_old_apagar .dpt-selected .csform{display:block;clear:both;z-index:9;position:static}.cp.cpe1_old_apagar .dpt-selected .csform .btns-action{-webkit-animation:fadeIn 1s ease-in-out;-moz-animation:fadeIn 1s ease-in-out;-o-animation:fadeIn 1s ease-in-out;opacity:1;position:absolute;display:table;transition:all 0.4s ease-in-out}.cp.cpe1_old_apagar .dpt-selected .csform .btns-action a{color:#16407c;display:block;background:transparent;vertical-align:middle;text-align:center;font-weight:normal;text-shadow:0 0 10px rgba(0,0,0,0.3);padding:0.33em 0.4em}.cp.cpe1_old_apagar .dpt-selected .csform .btns-action>li{position:relative;display:table-cell;vertical-align:top}.cp.cpe1_old_apagar .dpt-selected .csform .btns-action>li:hover{background-color:rgba(255,255,255,0.5)}.cp.cpe1_old_apagar .dpt-selected .csform .btns-action>li:hover>a{text-shadow:0 0 5px #777;color:#0a5}.cp.cpe1_old_apagar .dpt-selected .csform .label_status{position:absolute;bottom:0;right:0;color:#889;padding:0.3em;font-size:80%;text-align:right;z-index:15;display:table}.cp.cpe1_old_apagar .dpt-selected .csform .label_status li{display:table-cell;padding:0 0.5em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_parents{z-index:11;top:0em;left:0em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_parents a{padding:0.62em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_parents div,.cp.cpe1_old_apagar .dpt-selected .csform .actions_parents li{font-size:80%;display:table-cell;vertical-align:middle;border-right:1px solid #CCC}.cp.cpe1_old_apagar .dpt-selected .csform .actions_parents div{padding:0 0.4em;font-stretch:condensed;font-variant:small-caps;font-weight:bold;text-shadow:0 0 10px #fff}.cp.cpe1_old_apagar .dpt-selected .csform .actions_parents>li:hover a{color:#16407c;font-weight:normal}.cp.cpe1_old_apagar .dpt-selected .csform .actions_top,.cp.cpe1_old_apagar .dpt-selected .csform .actions_bottom{top:0em;right:0em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_top a,.cp.cpe1_old_apagar .dpt-selected .csform .actions_bottom a{padding-right:1em;padding-left:1em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_top li,.cp.cpe1_old_apagar .dpt-selected .csform .actions_bottom li{display:table-cell;vertical-align:middle;border-left:1px solid #CCC}.cp.cpe1_old_apagar .dpt-selected .csform .actions_bottom{top:auto;left:0;bottom:0;display:inline-block;border-top:1px solid #CCC}.cp.cpe1_old_apagar .dpt-selected .csform .actions_bottom a{padding:0 0.4em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_bottom li{border:0px;border-right:1px solid #CCC}.cp.cpe1_old_apagar .dpt-selected .csform .actions_right,.cp.cpe1_old_apagar .dpt-selected .csform .actions_left{top:2.2em;right:0em;bottom:0;display:block}.cp.cpe1_old_apagar .dpt-selected .csform .actions_right li,.cp.cpe1_old_apagar .dpt-selected .csform .actions_left li{width:2.2em;display:block;border-bottom:1px solid #CCC}.cp.cpe1_old_apagar .dpt-selected .csform .actions_right li:first-child,.cp.cpe1_old_apagar .dpt-selected .csform .actions_left li:first-child{border-top:1px solid #CCC}.cp.cpe1_old_apagar .dpt-selected .csform .actions_left{right:auto;left:0em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts{background:transparent;position:relative;z-index:19;display:table;width:100%}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li{display:table-cell}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li:hover>a{background-image:-webkit-linear-gradient(top, #1c81c4, #0b6dad);background-image:-moz-linear-gradient(top, #1c81c4, #0b6dad);background-image:-ms-linear-gradient(top, #1c81c4, #0b6dad);background-image:-o-linear-gradient(top, #1c81c4, #0b6dad);background-image:linear-gradient(to bottom, #1c81c4, #0b6dad)}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a{background-image:-webkit-linear-gradient(top, #3498DB, #2980C9);background-image:-moz-linear-gradient(top, #3498DB, #2980C9);background-image:-ms-linear-gradient(top, #3498DB, #2980C9);background-image:-o-linear-gradient(top, #3498DB, #2980C9);background-image:linear-gradient(to bottom, #3498DB, #2980C9);border-right:1px solid #fff;padding:0.2em;display:block;color:white;text-align:center;white-space:nowrap}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-excluir,.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar{text-align:left;background:#A70808;color:#c99;padding-left:1.7em;position:relative}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-excluir:hover,.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar:hover{background-color:#c70808;color:#ecc}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-excluir::before,.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar::before{z-index:20;position:absolute;background:url(/static/img/icon_delete_white.png) no-repeat 50% 50%;content:"";top:0;left:0;display:block;color:black;margin-left:0.4em;height:100%;width:2em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar{background:#1f8b4d;color:white}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar:hover{background:#2d9c5c;color:white}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar::before{background:url(/static/img/icon_save_white.png) no-repeat 50% 50%}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a span{padding:0 0.7em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li:last-child>a{border-right:0px solid #fff}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>ul li:nth-child(even) a{background:#3385CA}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>ul li a{border-right:1px solid #fff;display:block;color:white;background:#2980C9;font-size:80%;padding:0.23em 1em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>ul li a:hover{background:#0a5ea4}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.add_prior{table-layout:fixed}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.add_prior>ul{transform:translateY(30px);transition:transform 0.1s linear, opacity 0.1s linear, clip 0s 0.3s;clip:rect(0, 0, 0, 0);opacity:0;position:absolute;margin-left:0.5em;box-shadow:0px 6px 18px rgba(0,0,0,0.19),0px 2px 6px rgba(0,0,0,0.23);-webkit-transition-delay:0.4s;transition-delay:0.4s}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.add_prior>ul li a{border-right:0px !important}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.add_prior>ul li:first-child::before{border-width:0.375rem;border-style:inset inset solid;content:"";display:block;height:0px;width:0px;border-color:transparent transparent #3385CA;position:absolute;top:-0.71rem;left:0.9375rem}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.add_prior>ul li:first-child:hover::before{border-color:transparent transparent #0A5EA4}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.add_prior>ul::after{content:"";position:absolute;z-index:-1;left:0;top:rem-calc(-25px);height:rem-calc(25px);width:100%;transition:all 0.3s cubic-bezier(0.55, 0, 0.1, 1)}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.add_prior:hover>ul{transform:translateY(7px);transition:transform 0.4s linear, opacity 0.4s linear, clip 0s 0.2s;opacity:1;clip:rect(-100px, 2000px, 2000px, -100px)}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir{display:block;position:static}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul{transform:translateY(30px);transition:transform 0.1s linear, opacity 0.1s linear, clip 0s 0.3s;clip:rect(0, 0, 0, 0);opacity:0;position:absolute;margin-left:0.5em;box-shadow:0px 6px 18px rgba(0,0,0,0.19),0px 2px 6px rgba(0,0,0,0.23);-webkit-transition-delay:0.4s;transition-delay:0.4s}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li a{border-right:0px !important}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li:first-child::before{border-width:0.375rem;border-style:inset inset solid;content:"";display:block;height:0px;width:0px;border-color:transparent transparent #3385CA;position:absolute;top:-0.71rem;left:0.9375rem}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li:first-child:hover::before{border-color:transparent transparent #0A5EA4}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul::after{content:"";position:absolute;z-index:-1;left:0;top:rem-calc(-25px);height:rem-calc(25px);width:100%;transition:all 0.3s cubic-bezier(0.55, 0, 0.1, 1)}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir:hover>ul{transform:translateY(7px);transition:transform 0.4s linear, opacity 0.4s linear, clip 0s 0.2s;opacity:1;clip:rect(-100px, 2000px, 2000px, -100px)}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul{right:0.5em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li a{background-color:#A70808}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li a:hover{background:#c70808}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li:first-child::before{border-color:transparent transparent #A70808;right:10%;left:auto}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li:first-child:hover::before{border-color:transparent transparent #c70808}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo{z-index:2000}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante>li>ul,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo>li>ul{transform:translateY(30px);transition:transform 0.1s linear, opacity 0.1s linear, clip 0s 0.3s;clip:rect(0, 0, 0, 0);opacity:0;position:absolute;margin-left:0.5em;box-shadow:0px 6px 18px rgba(0,0,0,0.19),0px 2px 6px rgba(0,0,0,0.23);-webkit-transition-delay:0.4s;transition-delay:0.4s}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante>li>ul li a,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo>li>ul li a{border-right:0px !important}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante>li>ul li:first-child::before,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo>li>ul li:first-child::before{border-width:0.375rem;border-style:inset inset solid;content:"";display:block;height:0px;width:0px;border-color:transparent transparent #3385CA;position:absolute;top:-0.71rem;left:0.9375rem}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante>li>ul li:first-child:hover::before,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo>li>ul li:first-child:hover::before{border-color:transparent transparent #0A5EA4}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante>li>ul::after,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo>li>ul::after{content:"";position:absolute;z-index:-1;left:0;top:rem-calc(-25px);height:rem-calc(25px);width:100%;transition:all 0.3s cubic-bezier(0.55, 0, 0.1, 1)}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante>li:hover>ul,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo>li:hover>ul{transform:translateY(7px);transition:transform 0.4s linear, opacity 0.4s linear, clip 0s 0.2s;opacity:1;clip:rect(-100px, 2000px, 2000px, -100px)}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante>li.menu_excluir>ul li:first-child::before,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo>li.menu_excluir>ul li:first-child::before{right:auto;left:0.9375rem}.cp.cpe1_old_apagar .dpt-selected .csform textarea{margin:0;resize:vertical;min-height:12.6em;border:0px;font-size:120%;width:100%}.cp.cpe1_old_apagar .dpt-selected .csform textarea:focus{background:#fff}.cp.cpe1_old_apagar .dpt-selected .csform textarea::-webkit-input-placeholder{color:#c70808;opacity:0.6;font-size:80%}.cp.cpe1_old_apagar .dpt-selected .csform textarea:-moz-placeholder{color:#c70808}.cp.cpe1_old_apagar .dpt-selected .csform textarea::-moz-placeholder{color:#c70808}.cp.cpe1_old_apagar .dpt-selected .csform textarea:-ms-input-placeholder{color:#c70808;opacity:0.6}.cp.cpe1_old_apagar .selected{background-color:rgba(255,255,255,0.5)}.cp.cpe1_old_apagar .selected a:hover{color:#16407c !important;font-weight:normal !important}.result-busca-dispositivo,.lista-dispositivo{padding:0 0 1em;min-height:3em}.result-busca-dispositivo ul,.lista-dispositivo ul{list-style:none;margin:0;padding:1em 0 0;transition:all 2s linear;clear:both}.result-busca-dispositivo ul li,.lista-dispositivo ul li{display:table;border-collapse:separate;border-bottom:1px solid white;width:100%}.result-busca-dispositivo ul li.ta_title,.lista-dispositivo ul li.ta_title{background-color:rgba(0,0,0,0.15);border-radius:4px 4px 0 0;width:100%}.result-busca-dispositivo ul li.ta_title span,.lista-dispositivo ul li.ta_title span{padding:0.5em}.result-busca-dispositivo ul li:last-child .itemlabel,.lista-dispositivo ul li:last-child .itemlabel{border-radius:0 0 4px 0px;margin:0px}.result-busca-dispositivo ul li:last-child .iteminput,.lista-dispositivo ul li:last-child .iteminput{border-radius:0 0 0px 4px}.result-busca-dispositivo ul li .iteminput,.lista-dispositivo ul li .iteminput{background-color:rgba(0,0,0,0.1);border-right:1px solid white;display:table-cell;padding:0.5em;vertical-align:middle;text-align:center}.result-busca-dispositivo ul li .iteminput input,.lista-dispositivo ul li .iteminput input{margin:0}.result-busca-dispositivo ul li .itemlabel,.lista-dispositivo ul li .itemlabel{background-color:rgba(0,0,0,0.1);display:table-cell;padding:0.5em;vertical-align:middle;width:100%}.result-busca-dispositivo ul li .itemlabel label,.lista-dispositivo ul li .itemlabel label{line-height:1;font-family:"SourceSansPro", Helvetica, Arial, sans-serif;display:block;margin:0px}.result-busca-dispositivo ul li .itemlabel .artigo,.lista-dispositivo ul li .itemlabel .artigo{float:none}.result-busca-dispositivo .nomenclatura_heranca,.lista-dispositivo .nomenclatura_heranca{font-size:90%;color:#057dba;display:inline}.cp-nav-parents>.dropdown-menu{left:0;right:auto}.cp-nav-parents>.dropdown-menu::before{content:'';position:absolute;top:-11px;width:100%;height:11px}.cp-nav-parents:hover>.dropdown-menu{display:block}.table-notificacoes tbody tr td{border-top:1px solid white;padding:5px;vertical-align:middle}.table-notificacoes tbody tr td ul{margin:0px}.table-notificacoes tbody tr td ul li:hover{background-color:rgba(0,0,0,0.1)}.btn-modal-open{float:right}.class_color_container{background:#ddd !important}.clear{clear:both}.mce-tinymce.mce-container{border:1px solid #ccc !important;margin-right:2px}.mce-btn button:hover{background-color:rgba(0,0,0,0.1) !important;text-shadow:0 0 5px #fff;box-shadow:0 0 5px #777}.mce-menu{background:#eee !important}.displaynone{display:none !important}@media only screen and (max-width: 800px){.cp .fixed{z-index:98;position:relative}.cp.cpe1 .dpt-selected{margin:1em 0}.cp.cpe1 .dpt-selected .csform .actions_parents,.cp.cpe1 .dpt-selected .csform .label_status{font-size:80%;position:static !important;display:block !important;padding:0em;height:auto !important;left:0;right:auto;text-align:left}.cp.cpe1 .dpt-selected .csform .actions_parents div,.cp.cpe1 .dpt-selected .csform .actions_parents li,.cp.cpe1 .dpt-selected .csform .label_status div,.cp.cpe1 .dpt-selected .csform .label_status li{display:inline-block !important}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>ul{transform:translateY(30px);transition:transform 0.1s linear, opacity 0.1s linear, clip 0s 0.3s;clip:rect(0, 0, 0, 0);opacity:0;position:absolute;margin-left:0.5em;box-shadow:0px 6px 18px rgba(0,0,0,0.19),0px 2px 6px rgba(0,0,0,0.23);-webkit-transition-delay:0.4s;transition-delay:0.4s}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>ul li a{border-right:0px !important}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>ul li:first-child::before{border-width:0.375rem;border-style:inset inset solid;content:"";display:block;height:0px;width:0px;border-color:transparent transparent #3385CA;position:absolute;top:-0.71rem;left:0.9375rem}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>ul li:first-child:hover::before{border-color:transparent transparent #0A5EA4}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>ul::after{content:"";position:absolute;z-index:-1;left:0;top:rem-calc(-25px);height:rem-calc(25px);width:100%;transition:all 0.3s cubic-bezier(0.55, 0, 0.1, 1)}.cp.cpe1 .dpt-selected .csform .actions_inserts>li:hover>ul{transform:translateY(7px);transition:transform 0.4s linear, opacity 0.4s linear, clip 0s 0.2s;opacity:1;clip:rect(-100px, 2000px, 2000px, -100px)}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>a span{display:none}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>a.btn-excluir,.cp.cpe1 .cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar,.cp.cpe1_old_apagar .cp.cpe1 .dpt-selected .csform .actions_inserts>li>a.btn-salvar,.cp.cpe1 .dpt-selected .csform .actions_inserts>li>a.btn-salvar{padding-left:0;min-width:1em}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>a.btn-excluir::before,.cp.cpe1 .cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar::before,.cp.cpe1_old_apagar .cp.cpe1 .dpt-selected .csform .actions_inserts>li>a.btn-salvar::before,.cp.cpe1 .dpt-selected .csform .actions_inserts>li>a.btn-salvar::before{width:100%;margin:0}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_in,.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_next,.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_prior{position:static}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_in>ul{left:1em !important;right:1em !important;margin-left:0}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_in>ul li:first-child::before{left:37%}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_next>ul{left:0 !important;right:1em !important}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_prior>ul{left:1em !important;right:0 !important;margin-left:0;margin-right:0.5em}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_prior>ul li:first-child::before{right:42%;left:auto}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.menu_excluir>ul{left:10% !important;right:0 !important;margin-left:0;margin-right:0.5em}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li:first-child::before{right:0;left:auto}}@media print{.cp .vigencias,.toggle-topbar,.menu-icon,.button,.tipo-vigencias,.dne{display:none}#btn_font_menos,#btn_font_mais{display:none}.container{width:100%}} diff --git a/scripts_docker/shell_sapl.sh b/scripts_docker/shell_sapl.sh index cfddefcdc..4c993a61d 100755 --- a/scripts_docker/shell_sapl.sh +++ b/scripts_docker/shell_sapl.sh @@ -1,2 +1,3 @@ #!/bin/bash -docker run -ti sapl_web /bin/bash + +docker run --rm -ti sapl_web /bin/sh diff --git a/start.sh b/start.sh new file mode 100755 index 000000000..226c70de4 --- /dev/null +++ b/start.sh @@ -0,0 +1,53 @@ +#!/bin/sh + + +create_env() { + # check if file exists + if [ -f "/var/interlegis/sapl/data/secret.key" ]; then + KEY=`cat /var/interlegis/sapl/data/secret.key` + else + KEY=`python3 genkey.py` + echo $KEY > data/secret.key + fi + + # TODO: rename env-test-bash to .env + FILENAME="/var/interlegis/sapl/sapl/.env" + + if [ -z "${DATABASE_URL:-}" ]; then + DATABASE_URL="postgresql://sapl:sapl@sapldb:5432/sapl" + fi + + # ALWAYS replace the content of .env variable + # If want to conditionally create only if absent then use IF below + # if [ ! -f $FILENAME ]; then + + touch $FILENAME + + + # explicitly use '>' to erase any previous content + echo "SECRET_KEY="$KEY > $FILENAME + # now only appends + echo "DATABASE_URL = "$DATABASE_URL >> $FILENAME + echo "DEBUG = ""${DEBUG-False}" >> $FILENAME + echo "EMAIL_USE_TLS = ""${USE_TLS-True}" >> $FILENAME + echo "EMAIL_PORT = ""${EMAIL_PORT-587}" >> $FILENAME + echo "EMAIL_HOST = ""${EMAIL_HOST-''}" >> $FILENAME + echo "EMAIL_HOST_USER = ""${EMAIL_HOST_USER-''}" >> $FILENAME + echo "EMAIL_HOST_PASSWORD = ""${EMAIL_HOST_PASSWORD-''}" >> $FILENAME +} + +echo "creating .env file..." +create_env +echo "done." + +# # python3 gen-env.py + +python3 manage.py bower install + +/bin/sh busy-wait.sh + +python3 manage.py migrate +python3 manage.py collectstatic --no-input +python3 manage.py rebuild_index --noinput + +/bin/sh gunicorn_start.sh From 2538e6da5c2b2e875d2996bb2592940f79ca4acd Mon Sep 17 00:00:00 2001 From: Luciano Henrique Nunes de Almeida Date: Thu, 20 Apr 2017 11:19:50 -0300 Subject: [PATCH 081/140] fix #832 - TipoVinculoNormaJuridica e NormaRelacionada (#1016) * Migra TipoVinculoNormaJuridica e arruma NormaRelacionada Signed-off-by: Luciano Almeida * Concerta alter sequence e assert no tipo vinculo da norma Signed-off-by: Luciano Almeida --- sapl/legacy/migration.py | 56 +++++++++++++++++++++++++++++----------- sapl/norma/legacy.yaml | 8 +++--- 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 8cfa25a4e..6ab3cd184 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -25,7 +25,7 @@ from sapl.materia.models import (DocumentoAcessorio, MateriaLegislativa, TipoMateriaLegislativa, TipoProposicao, Tramitacao) from sapl.norma.models import (AssuntoNorma, NormaJuridica, - TipoVinculoNormaJuridica) + TipoVinculoNormaJuridica, NormaRelacionada) from sapl.parlamentares.models import Parlamentar from sapl.protocoloadm.models import Protocolo, StatusTramitacaoAdministrativo from sapl.sessao.models import ExpedienteMateria, OrdemDia @@ -339,20 +339,34 @@ def get_fields_dict(model): def fill_vinculo_norma_juridica(): - lista = [('A', 'Altera a norma'), - ('R', 'Revoga integralmente a norma'), - ('P', 'Revoga parcialmente a norma'), - ('T', 'Revoga integralmente por consolidação'), - ('C', 'Norma Correlata'), - ('S', 'Ressalva a Norma'), - ('E', 'Reedita a Norma'), - ('I', 'Reedita a Norma com Alteração'), - ('G', 'Regulamenta a Norma'), - ('K', 'Suspende parcialmente a norma'), - ('L', 'Suspende integralmente a norma'), - ('N', 'Julgada integralmente inconstitucional'), - ('O', 'Julgada parcialmente inconstitucional')] - lista_objs = [TipoVinculoNormaJuridica(sigla=item[0], descricao=item[1]) + lista = [('A', 'Altera o(a)', + 'Alterado(a) pelo(a)'), + ('R', 'Revoga integralmente o(a)', + 'Revogado(a) integralmente pelo(a)'), + ('P', 'Revoga parcialmente o(a)', + 'Revogado(a) parcialmente pelo(a)'), + ('T', 'Revoga integralmente por consolidação', + 'Revogado(a) integralmente por consolidação'), + ('C', 'Norma correlata', + 'Norma correlata'), + ('S', 'Ressalva o(a)', + 'Ressalvada pelo(a)'), + ('E', 'Reedita o(a)', + 'Reeditada pelo(a)'), + ('I', 'Reedita com alteração o(a)', + 'Reeditada com alteração pelo(a)'), + ('G', 'Regulamenta o(a)', + 'Regulamentada pelo(a)'), + ('K', 'Suspende parcialmente o(a)', + 'Suspenso(a) parcialmente pelo(a)'), + ('L', 'Suspende integralmente o(a)', + 'Suspenso(a) integralmente pelo(a)'), + ('N', 'Julga integralmente inconstitucional', + 'Julgada integralmente inconstitucional'), + ('O', 'Julga parcialmente inconstitucional', + 'Julgada parcialmente inconstitucional')] + lista_objs = [TipoVinculoNormaJuridica( + sigla=item[0], descricao_ativa=item[1], descricao_passiva=item[2]) for item in lista] TipoVinculoNormaJuridica.objects.bulk_create(lista_objs) @@ -455,6 +469,7 @@ class DataMigrator: desconecta_sinais_indexacao() + fill_vinculo_norma_juridica() info('Começando migração: %s...' % obj) self._do_migrate(obj) @@ -543,6 +558,10 @@ class DataMigrator: if getattr(old, 'ind_excluido', False): self.to_delete.append(new) + # necessário para ajustar sequence da tabela para o ultimo valor de id + ultimo_valor = get_last_value(model) + alter_sequence(model, ultimo_valor+1) + def delete_ind_excluido(self): excluidos = 0 for obj in self.to_delete: @@ -619,6 +638,12 @@ def adjust_participacao(new, old): new.composicao = composicao +def adjust_normarelacionada(new, old): + tipo = TipoVinculoNormaJuridica.objects.filter(sigla=old.tip_vinculo) + assert len(tipo) == 1 + new.tipo_vinculo = tipo[0] + + def adjust_protocolo(new, old): if new.numero is None and not primeira_vez: p = ProtocoloLegado.objects.filter( @@ -724,6 +749,7 @@ AJUSTE_ANTES_SALVAR = { Autor: adjust_autor, Comissao: adjust_comissao, NormaJuridica: adjust_normajuridica_antes_salvar, + NormaRelacionada: adjust_normarelacionada, OrdemDia: adjust_ordemdia, Parlamentar: adjust_parlamentar, Participacao: adjust_participacao, diff --git a/sapl/norma/legacy.yaml b/sapl/norma/legacy.yaml index 17a7f083d..3294561b8 100644 --- a/sapl/norma/legacy.yaml +++ b/sapl/norma/legacy.yaml @@ -42,8 +42,6 @@ LegislacaoCitada: subsecao: des_subsecao titulo: des_titulo -# TODO Descomentar quando a issue #832 for concluida -# TipoVinculoNormaJuridica (VinculoNormaJuridica): -# norma_referente: cod_norma_referente -# norma_referida: cod_norma_referida -# tipo_vinculo: tip_vinculo +NormaRelacionada (VinculoNormaJuridica): + norma_principal: cod_norma_referente + norma_relacionada: cod_norma_referida From 66a529b783281d1a319d1ad0203d06593c0d920a Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 20 Apr 2017 11:26:50 -0300 Subject: [PATCH 082/140] =?UTF-8?q?HOT-FIX:=20permitir=20execu=C3=A7=C3=A3?= =?UTF-8?q?o=20do=20SAPL=20docker=20e=20standalone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gunicorn_start.sh | 9 +++++++++ start.sh | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gunicorn_start.sh b/gunicorn_start.sh index 9669644fa..5d82418df 100755 --- a/gunicorn_start.sh +++ b/gunicorn_start.sh @@ -23,6 +23,15 @@ DJANGO_WSGI_MODULE=sapl.wsgi # WSGI module name (*) echo "Starting $NAME as `whoami` on base dir $SAPL_DIR" +# parameter can be passed to run without virtualenv +if [[ "$@" != "no-venv" ]]; then + # Activate the virtual environment + cd $DJANGODIR + source /var/interlegis/.virtualenvs/sapl/bin/activate + export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE + export PYTHONPATH=$DJANGODIR:$PYTHONPATH +fi + # Create the run directory if it doesn't exist RUNDIR=$(dirname $SOCKFILE) test -d $RUNDIR || mkdir -p $RUNDIR diff --git a/start.sh b/start.sh index 226c70de4..0774b0e02 100755 --- a/start.sh +++ b/start.sh @@ -50,4 +50,4 @@ python3 manage.py migrate python3 manage.py collectstatic --no-input python3 manage.py rebuild_index --noinput -/bin/sh gunicorn_start.sh +/bin/sh gunicorn_start.sh no-venv From 38b6745b6ca906bfa399700dbe048df90c278e70 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 20 Apr 2017 15:18:11 -0300 Subject: [PATCH 083/140] Adiciona script para criar superuser --- create_admin.py | 33 +++++++++++++++++++++++++++++++++ start.sh | 20 +++++++++++++++++--- 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 create_admin.py diff --git a/create_admin.py b/create_admin.py new file mode 100644 index 000000000..d534c6696 --- /dev/null +++ b/create_admin.py @@ -0,0 +1,33 @@ +import sys +import os +import django + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sapl.settings") +django.setup() + +from django.contrib.auth.models import User + +def create_superuser(): + username = "admin" + password = os.environ['ADMIN_PASSWORD'] if 'ADMIN_PASSWORD' in os.environ else None + email = os.environ['ADMIN_EMAIL'] if 'ADMIN_EMAIL' in os.environ else '' + + if User.objects.filter(username=username).exists(): + # print("[SUPERUSER] User %s already exists. Exiting without change." % username) + sys.exit('ADMIN_USER_EXISTS') + else: + if not password: + # print("[SUPERUSER] Environment variable $ADMIN_PASSWORD for user %s was not set. Leaving..." % username) + sys.exit('MISSING_ADMIN_PASSWORD') + + print("[SUPERUSER] Creating superuser...") + + u = User.objects.create_superuser(username=username, password=password, email=email) + u.save() + + print("[SUPERUSER] Done.") + + sys.exit(0) + +if __name__ == '__main__': + create_superuser() diff --git a/start.sh b/start.sh index 0774b0e02..f421efa99 100755 --- a/start.sh +++ b/start.sh @@ -2,6 +2,7 @@ create_env() { + echo "[ENV FILE] creating .env file..." # check if file exists if [ -f "/var/interlegis/sapl/data/secret.key" ]; then KEY=`cat /var/interlegis/sapl/data/secret.key` @@ -10,7 +11,6 @@ create_env() { echo $KEY > data/secret.key fi - # TODO: rename env-test-bash to .env FILENAME="/var/interlegis/sapl/sapl/.env" if [ -z "${DATABASE_URL:-}" ]; then @@ -34,11 +34,11 @@ create_env() { echo "EMAIL_HOST = ""${EMAIL_HOST-''}" >> $FILENAME echo "EMAIL_HOST_USER = ""${EMAIL_HOST_USER-''}" >> $FILENAME echo "EMAIL_HOST_PASSWORD = ""${EMAIL_HOST_PASSWORD-''}" >> $FILENAME + + echo "[ENV FILE] done." } -echo "creating .env file..." create_env -echo "done." # # python3 gen-env.py @@ -50,4 +50,18 @@ python3 manage.py migrate python3 manage.py collectstatic --no-input python3 manage.py rebuild_index --noinput +user_created=$(python3 create_admin.py) + +echo $user_created + +#if [ $user_created -eq "ADMIN_USER_EXISTS" ]; then +# echo "[SUPERUSER CREATION] User admin already exists. Not creating" +#fi + +#if [ $user_created -eq "MISSING_ADMIN_PASSWORD" ]; then +# echo "[SUPERUSER] Environment variable $ADMIN_PASSWORD for superuser admin was not set. Leaving container" + # return -1 # TODO: Uncomment when in finally in prod. +#fi + + /bin/sh gunicorn_start.sh no-venv From ee1b73b9c8a297c40032e50e5921f3d2cbe1ba17 Mon Sep 17 00:00:00 2001 From: Matheus Veleci Date: Thu, 20 Apr 2017 11:30:40 -0300 Subject: [PATCH 084/140] =?UTF-8?q?Ajusta=20busy-wait=20para=20verificar?= =?UTF-8?q?=20a=20DATABASE=5FURL=20gen=C3=A9rica(Vari=C3=A1vel=20de=20Ambi?= =?UTF-8?q?ente)=20e=20altera=20n=C3=BAmero=20de=20cores=20do=20gunicorn?= =?UTF-8?q?=5Fstart.sh=20para=209?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- busy-wait.sh | 2 +- gunicorn_start.sh | 2 +- start.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/busy-wait.sh b/busy-wait.sh index 128592ffc..73fde5c6b 100644 --- a/busy-wait.sh +++ b/busy-wait.sh @@ -1,7 +1,7 @@ #!/bin/sh while true; do - COUNT_PG=`psql --dbname=postgresql://sapl:sapl@sapldb/sapl -c '\l \q' | grep sapl | wc -l` + COUNT_PG=`psql $1 -c '\l \q' | grep sapl | wc -l` if ! [ "$COUNT_PG" -eq "0" ]; then break fi diff --git a/gunicorn_start.sh b/gunicorn_start.sh index 5d82418df..79666cf19 100755 --- a/gunicorn_start.sh +++ b/gunicorn_start.sh @@ -16,7 +16,7 @@ DJANGODIR=/var/interlegis/sapl/ # Django project directory (* SOCKFILE=/var/interlegis/sapl/run/gunicorn.sock # we will communicate using this unix socket (*) USER=`whoami` # the user to run as (*) GROUP=`whoami` # the group to run as (*) -NUM_WORKERS=3 # how many worker processes should Gunicorn spawn (*) +NUM_WORKERS=9 # how many worker processes should Gunicorn spawn (*) # NUM_WORKERS = 2 * CPUS + 1 DJANGO_SETTINGS_MODULE=sapl.settings # which settings file should Django use (*) DJANGO_WSGI_MODULE=sapl.wsgi # WSGI module name (*) diff --git a/start.sh b/start.sh index f421efa99..893296a89 100755 --- a/start.sh +++ b/start.sh @@ -44,7 +44,7 @@ create_env python3 manage.py bower install -/bin/sh busy-wait.sh +/bin/sh busy-wait.sh $DATABASE_URL python3 manage.py migrate python3 manage.py collectstatic --no-input From c0ff18e4d8bd63085d7b6f8f1e5713f030567568 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 25 Apr 2017 11:22:43 -0300 Subject: [PATCH 085/140] Adiciona checagem de password e usuario admin existente --- create_admin.py | 4 ++-- start.sh | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/create_admin.py b/create_admin.py index d534c6696..7fe03a65c 100644 --- a/create_admin.py +++ b/create_admin.py @@ -13,11 +13,11 @@ def create_superuser(): email = os.environ['ADMIN_EMAIL'] if 'ADMIN_EMAIL' in os.environ else '' if User.objects.filter(username=username).exists(): - # print("[SUPERUSER] User %s already exists. Exiting without change." % username) + print("[SUPERUSER] User %s already exists. Exiting without change." % username) sys.exit('ADMIN_USER_EXISTS') else: if not password: - # print("[SUPERUSER] Environment variable $ADMIN_PASSWORD for user %s was not set. Leaving..." % username) + print("[SUPERUSER] Environment variable $ADMIN_PASSWORD for user %s was not set. Leaving..." % username) sys.exit('MISSING_ADMIN_PASSWORD') print("[SUPERUSER] Creating superuser...") diff --git a/start.sh b/start.sh index 893296a89..250be13ea 100755 --- a/start.sh +++ b/start.sh @@ -40,8 +40,6 @@ create_env() { create_env -# # python3 gen-env.py - python3 manage.py bower install /bin/sh busy-wait.sh $DATABASE_URL @@ -50,18 +48,22 @@ python3 manage.py migrate python3 manage.py collectstatic --no-input python3 manage.py rebuild_index --noinput -user_created=$(python3 create_admin.py) +user_created=$(python3 create_admin.py 2>&1) -echo $user_created +cmd=$(echo $user_created | grep 'ADMIN_USER_EXISTS') +user_exists=$? -#if [ $user_created -eq "ADMIN_USER_EXISTS" ]; then -# echo "[SUPERUSER CREATION] User admin already exists. Not creating" -#fi +cmd=$(echo $user_created | grep 'MISSING_ADMIN_PASSWORD') +lack_pwd=$? -#if [ $user_created -eq "MISSING_ADMIN_PASSWORD" ]; then -# echo "[SUPERUSER] Environment variable $ADMIN_PASSWORD for superuser admin was not set. Leaving container" - # return -1 # TODO: Uncomment when in finally in prod. -#fi +if [ $user_exists -eq 0 ]; then + echo "[SUPERUSER CREATION] User admin already exists. Not creating" +fi + +if [ $lack_pwd -eq 0 ]; then + echo "[SUPERUSER] Environment variable $ADMIN_PASSWORD for superuser admin was not set. Leaving container" + # return -1 +fi /bin/sh gunicorn_start.sh no-venv From 5ec8ad8d598504ed66fedf1a44b64475ea2b3590 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 25 Apr 2017 11:44:40 -0300 Subject: [PATCH 086/140] Closes #1031 --- sapl/templates/sessao/votacao/votacao_edit.html | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sapl/templates/sessao/votacao/votacao_edit.html b/sapl/templates/sessao/votacao/votacao_edit.html index 5c614ea00..753c49541 100644 --- a/sapl/templates/sessao/votacao/votacao_edit.html +++ b/sapl/templates/sessao/votacao/votacao_edit.html @@ -26,12 +26,10 @@
    - Resultado da Votação: - {% for tipo in view.get_tipos_votacao %} - {% if votacao.tipo_resultado == tipo.id %} - {{ tipo.nome }} - {% endif %} - {% endfor %} +
    + Resultado da Votação: {{ votacao.resultado }} +
    +
    From 9e2db16563620288df9ead5086a6577155a0ebd1 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 25 Apr 2017 13:50:46 -0300 Subject: [PATCH 087/140] Closes 1037 --- .../templates/pdf_sessao_plenaria_gerar.py | 4 ++-- sapl/relatorios/views.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py b/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py index 5917d0f8b..8890b9dcf 100644 --- a/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py +++ b/sapl/relatorios/templates/pdf_sessao_plenaria_gerar.py @@ -176,8 +176,8 @@ def expediente_materia(lst_expediente_materia): tmp += '\n' tmp += 'MatériaEmentaResultado da Votação\n' for expediente_materia in lst_expediente_materia: - tmp += '' + str(expediente_materia['num_ordem']) + ' - ' + expediente_materia['id_materia'] + '\n' + 'Turno: ' + expediente_materia[ - 'des_turno'] + '\n' + 'Autor: ' + expediente_materia['nom_autor'] + '\n' + tmp += '' + str(expediente_materia['num_ordem']) + ' - ' + expediente_materia['id_materia'] + '\n' + 'Turno: ' + str(expediente_materia[ + 'des_turno']) + '\n' + 'Autor: ' + str(expediente_materia['nom_autor']) + '\n' txt_ementa = expediente_materia['txt_ementa'].replace('&', '&') tmp += '' + txt_ementa + '\n' tmp += '' + \ diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index 3a2ccd047..e09155bec 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -662,9 +662,9 @@ def get_sessao_plenaria(sessao, casa): materia=votacao.materia).first() if numeracao is not None: dic_votacao["des_numeracao"] = ( - str(numeracao.numero) + + str(numeracao.numero_materia) + '/' + - str(numeracao.ano)) + str(numeracao.ano_materia)) dic_votacao["des_turno"] = ' ' tramitacao = Tramitacao.objects.filter( @@ -1083,11 +1083,11 @@ def get_pauta_sessao(sessao, casa): dic_votacao["ordem_observacao"] = votacao.observacao dic_votacao["des_numeracao"] = ' ' - numeracao = Numeracao.objects.filter(materia=materia) - # if numeracao is not None: - # numeracao = numeracao.first() - # dic_votacao["des_numeracao"] = str( - # numeracao.numero) + '/' + str(numeracao.ano) +# numeracao = Numeracao.objects.filter(materia=materia) +# if numeracao is not None: +# numeracao = numeracao.first() +# dic_votacao["des_numeracao"] = str( +# numeracao.numero_materia) + '/' + str(numeracao.ano_materia) dic_votacao["nom_autor"] = ' ' autoria = Autoria.objects.filter( From df45d850074e7786ff79b8551007509cfcf6f4a2 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 25 Apr 2017 17:09:16 -0300 Subject: [PATCH 088/140] Fixes #1031 --- sapl/sessao/views.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 419ea4fa0..4367ec84d 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -164,8 +164,8 @@ class MateriaOrdemDiaCrud(MasterDetailCrud): def get_rows(self, object_list): for obj in object_list: - resultados = obj.registrovotacao_set.all() - if not resultados: + exist_resultado = obj.registrovotacao_set.all().exists() + if not exist_resultado: if obj.votacao_aberta: url = '' if obj.tipo_votacao == 1: @@ -209,8 +209,11 @@ class MateriaOrdemDiaCrud(MasterDetailCrud): else: obj.resultado = '''Não há resultado''' else: - resultado = resultados[0].tipo_resultado_votacao.nome - resultado_observacao = resultados[0].observacao + resultado = obj.registrovotacao_set.get( + materia_id=obj.materia_id) + resultado_descricao = resultado.tipo_resultado_votacao.nome + resultado_observacao = resultado.observacao + if self.request.user.has_module_perms(AppConfig.label): url = '' if obj.tipo_votacao == 1: @@ -233,11 +236,12 @@ class MateriaOrdemDiaCrud(MasterDetailCrud): 'mid': obj.pk}) obj.resultado = ('%s
    %s' % (url, - resultado, + resultado_descricao, resultado_observacao)) else: obj.resultado = ('%s
    %s' % - (resultado, resultado_observacao)) + (resultado_descricao, + resultado_observacao)) return [self._as_row(obj) for obj in object_list] @@ -1057,7 +1061,7 @@ class ResumoView(DetailView): numero = o.numero_ordem # Verificar resultado - resultado = o.registrovotacao_set.all() + resultado = o.registrovotacao_set.filter(materia=o.materia) if resultado: resultado = resultado[0].tipo_resultado_votacao.nome else: @@ -1207,6 +1211,7 @@ class VotacaoEditView(SessaoPermissionMixin): ordem_id=ordem_id).last() votacao_existente = {'observacao': sub( ' ', ' ', strip_tags(votacao.observacao)), + 'resultado': votacao.tipo_resultado_votacao.nome, 'tipo_resultado': votacao.tipo_resultado_votacao_id} context.update({'votacao_titulo': titulo, @@ -1517,6 +1522,7 @@ class VotacaoNominalEditView(SessaoPermissionMixin): votacao_existente = {'observacao': sub( ' ', ' ', strip_tags(votacao.observacao)), + 'resultado': votacao.tipo_resultado_votacao.nome, 'tipo_resultado': votacao.tipo_resultado_votacao_id} context.update({'votacao': votacao_existente, @@ -1749,6 +1755,7 @@ class VotacaoNominalExpedienteEditView(SessaoPermissionMixin): votacao_existente = {'observacao': sub( ' ', ' ', strip_tags(votacao.observacao)), + 'resultado': votacao.tipo_resultado_votacao.nome, 'tipo_resultado': votacao.tipo_resultado_votacao_id} context.update({'votacao': votacao_existente, @@ -1983,6 +1990,7 @@ class VotacaoExpedienteEditView(SessaoPermissionMixin): expediente_id=expediente_id).last() votacao_existente = {'observacao': sub( ' ', ' ', strip_tags(votacao.observacao)), + 'resultado': votacao.tipo_resultado.nome, 'tipo_resultado': votacao.tipo_resultado_votacao_id} context.update({'votacao_titulo': titulo, From 6459c783698b9cc0ec6126527bbd5215817bd378 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 25 Apr 2017 17:26:32 -0300 Subject: [PATCH 089/140] Closes #1033 --- sapl/sessao/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 4367ec84d..02efb83d0 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -164,7 +164,9 @@ class MateriaOrdemDiaCrud(MasterDetailCrud): def get_rows(self, object_list): for obj in object_list: - exist_resultado = obj.registrovotacao_set.all().exists() + exist_resultado = obj.registrovotacao_set.filter( + materia=obj.materia + ).exists() if not exist_resultado: if obj.votacao_aberta: url = '' From 1ac9fd690658216d1bad3a69a79c8fec8bb178de Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Wed, 26 Apr 2017 11:13:19 -0300 Subject: [PATCH 090/140] Closes #1032 --- sapl/sessao/forms.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/sapl/sessao/forms.py b/sapl/sessao/forms.py index ded56d4cd..c4854e21f 100644 --- a/sapl/sessao/forms.py +++ b/sapl/sessao/forms.py @@ -83,11 +83,11 @@ class ExpedienteMateriaForm(ModelForm): def clean_numero_ordem(self): sessao = self.instance.sessao_plenaria - ex = ExpedienteMateria.objects.filter( + numero_ordem_exists = ExpedienteMateria.objects.filter( sessao_plenaria=sessao, - numero_ordem=self.cleaned_data['numero_ordem']).count() + numero_ordem=self.cleaned_data['numero_ordem']).exists() - if ex >= 1: + if numero_ordem_exists: msg = _('Esse número de ordem já existe.') raise ValidationError(msg) @@ -139,6 +139,22 @@ class OrdemDiaForm(ExpedienteMateriaForm): def clean_data_ordem(self): return self.instance.sessao_plenaria.data_inicio + + def clean_numero_ordem(self): + sessao = self.instance.sessao_plenaria + + numero_ordem_exists = OrdemDia.objects.filter( + sessao_plenaria=sessao, + numero_ordem=self.cleaned_data[ + 'numero_ordem']).exists() + + if exists_numero_ordem: + msg = _('Esse número de ordem já existe.') + raise ValidationError(msg) + + return self.cleaned_data['numero_ordem'] + + def clean(self): cleaned_data = self.cleaned_data sessao = self.instance.sessao_plenaria From 62480af20a6ff34e1ff0d720431fc88da189dc79 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Wed, 26 Apr 2017 11:26:35 -0300 Subject: [PATCH 091/140] =?UTF-8?q?HOT-FIX:=20vari=C3=A1vel=20com=20nome?= =?UTF-8?q?=20errado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/sessao/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapl/sessao/forms.py b/sapl/sessao/forms.py index c4854e21f..4303dabcc 100644 --- a/sapl/sessao/forms.py +++ b/sapl/sessao/forms.py @@ -148,7 +148,7 @@ class OrdemDiaForm(ExpedienteMateriaForm): numero_ordem=self.cleaned_data[ 'numero_ordem']).exists() - if exists_numero_ordem: + if numero_ordem_exists: msg = _('Esse número de ordem já existe.') raise ValidationError(msg) From 382d6bd376d88d6b227337625c217a508cfe1a3a Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Wed, 26 Apr 2017 15:53:56 -0300 Subject: [PATCH 092/140] Closes #1009 --- sapl/relatorios/views.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index e09155bec..62edc9791 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -520,10 +520,18 @@ def get_sessao_plenaria(sessao, casa): lst_expedientes = [] expedientes = ExpedienteSessao.objects.filter( sessao_plenaria=sessao).order_by('tipo__nome') + for e in expedientes: + dic_expedientes = {} dic_expedientes["nom_expediente"] = e.tipo.nome - dic_expedientes["txt_expediente"] = e.conteudo + conteudo = e.conteudo + # escape special character '&' + # https://github.com/interlegis/sapl/issues/1009 + conteudo = conteudo.replace('&', '&') + + dic_expedientes["txt_expediente"] = conteudo + if dic_expedientes: lst_expedientes.append(dic_expedientes) From 702086d12fa76b936b7f8ee797820d762e12f6ea Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Wed, 26 Apr 2017 17:13:01 -0300 Subject: [PATCH 093/140] Fixes #1046 --- sapl/relatorios/views.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sapl/relatorios/views.py b/sapl/relatorios/views.py index 62edc9791..4b5416c2c 100644 --- a/sapl/relatorios/views.py +++ b/sapl/relatorios/views.py @@ -1,5 +1,8 @@ from datetime import datetime +import re +import html + from django.core.exceptions import ObjectDoesNotExist from django.http import Http404, HttpResponse from django.utils.translation import ugettext_lazy as _ @@ -526,6 +529,12 @@ def get_sessao_plenaria(sessao, casa): dic_expedientes = {} dic_expedientes["nom_expediente"] = e.tipo.nome conteudo = e.conteudo + + # unescape HTML codes + # https://github.com/interlegis/sapl/issues/1046 + conteudo = re.sub('style=".*?"', '', conteudo) + conteudo = html.unescape(conteudo) + # escape special character '&' # https://github.com/interlegis/sapl/issues/1009 conteudo = conteudo.replace('&', '&') From 7a2a90f51672747eb77ecf4af844ed80d24ca5c7 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 27 Apr 2017 09:36:04 -0300 Subject: [PATCH 094/140] =?UTF-8?q?HOT-FIX:=20solu=C3=A7=C3=A3o=20parcial?= =?UTF-8?q?=20para=20issue=20#1049?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/sessao/views.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 02efb83d0..0aa143590 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -280,8 +280,10 @@ class ExpedienteMateriaCrud(MasterDetailCrud): def get_rows(self, object_list): for obj in object_list: - resultados = obj.registrovotacao_set.all() - if not resultados: + exist_resultado = obj.registrovotacao_set.filter( + materia=obj.materia + ).exists() + if not exist_resultado: if obj.votacao_aberta: url = '' if obj.tipo_votacao == 1: @@ -323,7 +325,10 @@ class ExpedienteMateriaCrud(MasterDetailCrud): obj.resultado = btn_abrir else: url = '' - resultado = resultados[0].tipo_resultado_votacao.nome + resultado = obj.registrovotacao_set.get( + materia_id=obj.materia_id) + resultado_descricao = resultado.tipo_resultado_votacao.nome + resultado_observacao = resultado.observacao if self.request.user.has_module_perms(AppConfig.label): if obj.tipo_votacao == 1: url = reverse( @@ -344,10 +349,14 @@ class ExpedienteMateriaCrud(MasterDetailCrud): 'pk': obj.sessao_plenaria_id, 'oid': obj.materia_id, 'mid': obj.pk}) - obj.resultado = '%s' % (url, - resultado) + obj.resultado = ('%s
    %s' % + (url, + resultado_descricao, + resultado_observacao)) else: - obj.resultado = '%s' % (resultado) + obj.resultado = ('%s
    %s' % + (resultado_descricao, + resultado_observacao)) return [self._as_row(obj) for obj in object_list] class CreateView(MasterDetailCrud.CreateView): From 7c3b2a278fb896722a5104ddb56cc4a1b2a6943c Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 27 Apr 2017 09:46:06 -0300 Subject: [PATCH 095/140] Fixes #1043 --- sapl/templates/sessao/resumo.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sapl/templates/sessao/resumo.html b/sapl/templates/sessao/resumo.html index 2dcb586d9..ad1771305 100644 --- a/sapl/templates/sessao/resumo.html +++ b/sapl/templates/sessao/resumo.html @@ -112,8 +112,9 @@
    {% for o in oradores %} -
    {{o.numero_ordem}} - {{o.parlamentar}}
    -
    {{o.url_discurso}}
    +
    {{o.numero_ordem}} - {{o.parlamentar}}
    +
    {{o.url_discurso}}
    +
    {% endfor %}
    From 62e7e0b370ec74a10eba29e8b90f7f3617cb47eb Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 27 Apr 2017 10:49:58 -0300 Subject: [PATCH 096/140] Closes #1042 --- sapl/env-backup | 8 ++++++++ sapl/sessao/views.py | 20 +++++++++++++++++++- sapl/templates/sessao/resumo.html | 16 ++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 sapl/env-backup diff --git a/sapl/env-backup b/sapl/env-backup new file mode 100644 index 000000000..5824d3eec --- /dev/null +++ b/sapl/env-backup @@ -0,0 +1,8 @@ +SECRET_KEY=qbl0+_+h6^u_k0ggkv&+ff&56s!d(*k+vk^_eu3-to_w&k-kp@ +DATABASE_URL = postgresql://sapl:sapl@localhost:5432/sapl +DEBUG = True +EMAIL_USE_TLS = True +EMAIL_PORT = 587 +EMAIL_HOST = '' +EMAIL_HOST_USER = '' +EMAIL_HOST_PASSWORD = '' diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 0aa143590..85c041115 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -28,7 +28,7 @@ from sapl.materia.models import (Autoria, DocumentoAcessorio, TipoMateriaLegislativa, Tramitacao) from sapl.materia.views import MateriaLegislativaPesquisaView from sapl.norma.models import NormaJuridica -from sapl.parlamentares.models import (Legislatura, Parlamentar, +from sapl.parlamentares.models import (Filiacao, Legislatura, Parlamentar, SessaoLegislativa) from sapl.sessao.apps import AppConfig from sapl.sessao.forms import ExpedienteMateriaForm, OrdemDiaForm @@ -1092,6 +1092,24 @@ class ResumoView(DetailView): context.update({'materias_ordem': materias_ordem}) + # ===================================================================== + # Oradores nas Explicações Pessoais + oradores_explicacoes = [] + for orador in Orador.objects.filter(sessao_plenaria_id=self.object.id): + for parlamentar in Parlamentar.objects.filter( + id=orador.parlamentar.id): + partido_sigla = Filiacao.objects.filter( + parlamentar=parlamentar).first().partido.sigla + if not partido_sigla: + partido_sigla = '' + oradores = { + 'numero_ordem': orador.numero_ordem, + 'parlamentar': parlamentar.nome_parlamentar, + 'sgl_partido': partido_sigla + } + oradores_explicacoes.append(oradores) + context.update({'oradores_explicacoes': oradores_explicacoes}) + return self.render_to_response(context) diff --git a/sapl/templates/sessao/resumo.html b/sapl/templates/sessao/resumo.html index ad1771305..059fe5346 100644 --- a/sapl/templates/sessao/resumo.html +++ b/sapl/templates/sessao/resumo.html @@ -155,4 +155,20 @@ + +
    + Oradores das Explicações Pessoais +
    +
    Parlamentar
    +
    Discurso
    +
    +
    + {% for o in oradores_explicacoes %} +
    {{o.numero_ordem}} - {{o.parlamentar}}
    +
    {{o.url_discurso}}
    +
    + {% endfor %} +
    +
    + {% endblock detail_content %} From 69b5a38e3426be7cd946d7268b80b1970956abc1 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 27 Apr 2017 10:53:33 -0300 Subject: [PATCH 097/140] Closes #1039 --- sapl/templates/sessao/presenca.html | 4 ++-- sapl/templates/sessao/presenca_ordemdia.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sapl/templates/sessao/presenca.html b/sapl/templates/sessao/presenca.html index bbdb934a4..3d24f429e 100644 --- a/sapl/templates/sessao/presenca.html +++ b/sapl/templates/sessao/presenca.html @@ -23,7 +23,7 @@
    {% endfor %} @@ -42,7 +42,7 @@ {% for parlamentar, check in view.get_presencas %} {% if check %}
    -
    +
    {% endif %} {% endfor %} diff --git a/sapl/templates/sessao/presenca_ordemdia.html b/sapl/templates/sessao/presenca_ordemdia.html index 1b66b53b1..63800f196 100644 --- a/sapl/templates/sessao/presenca_ordemdia.html +++ b/sapl/templates/sessao/presenca_ordemdia.html @@ -24,7 +24,7 @@
    {% endfor %} @@ -44,7 +44,7 @@ {% for parlamentar, check in view.get_presencas_ordem %} {% if check %}
    -
    +
    {% endif %} {% endfor %} From d599dbd2a90c8df8ac49e55629348f841e95d262 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 27 Apr 2017 11:12:43 -0300 Subject: [PATCH 098/140] Fixes #1041 --- sapl/sessao/views.py | 4 ++-- sapl/templates/sessao/presenca.html | 4 ++-- sapl/templates/sessao/presenca_ordemdia.html | 4 ++-- sapl/templates/sessao/resumo.html | 9 +++++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 85c041115..3bcba074e 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -1099,12 +1099,12 @@ class ResumoView(DetailView): for parlamentar in Parlamentar.objects.filter( id=orador.parlamentar.id): partido_sigla = Filiacao.objects.filter( - parlamentar=parlamentar).first().partido.sigla + parlamentar=parlamentar).last().partido.sigla if not partido_sigla: partido_sigla = '' oradores = { 'numero_ordem': orador.numero_ordem, - 'parlamentar': parlamentar.nome_parlamentar, + 'parlamentar': parlamentar, 'sgl_partido': partido_sigla } oradores_explicacoes.append(oradores) diff --git a/sapl/templates/sessao/presenca.html b/sapl/templates/sessao/presenca.html index 3d24f429e..7317cde38 100644 --- a/sapl/templates/sessao/presenca.html +++ b/sapl/templates/sessao/presenca.html @@ -23,7 +23,7 @@
    {% endfor %} @@ -42,7 +42,7 @@ {% for parlamentar, check in view.get_presencas %} {% if check %}
    -
    +
    {% endif %} {% endfor %} diff --git a/sapl/templates/sessao/presenca_ordemdia.html b/sapl/templates/sessao/presenca_ordemdia.html index 63800f196..7f9f0487b 100644 --- a/sapl/templates/sessao/presenca_ordemdia.html +++ b/sapl/templates/sessao/presenca_ordemdia.html @@ -24,7 +24,7 @@
    {% endfor %} @@ -44,7 +44,7 @@ {% for parlamentar, check in view.get_presencas_ordem %} {% if check %}
    -
    +
    {% endif %} {% endfor %} diff --git a/sapl/templates/sessao/resumo.html b/sapl/templates/sessao/resumo.html index 059fe5346..e338f322c 100644 --- a/sapl/templates/sessao/resumo.html +++ b/sapl/templates/sessao/resumo.html @@ -42,7 +42,8 @@ Mesa Diretora
    {% for m in mesa %} -
    {{m.cargo}}: {{m.parlamentar.nome_parlamentar}}
    +
    {{m.cargo}}: + {{m.parlamentar.nome_parlamentar}} / {{ m.parlamentar.filiacao_set.last.partido.sigla }}
    {% endfor %}
    @@ -52,7 +53,7 @@ Lista de Presença na Sessão
    {% for p in presenca_sessao %} -
    {{p}}
    +
    {{p.nome_parlamentar}} / {{ p.filiacao_set.last.partido.sigla }}
    {% endfor %}
    @@ -124,7 +125,7 @@ Lista de Presença na Ordem do Dia
    {% for p in presenca_ordem %} -
    {{p}}
    +
    {{p.nome_parlamentar}} / {{ p.filiacao_set.last.partido.sigla }}
    {% endfor %}
    @@ -164,7 +165,7 @@
    {% for o in oradores_explicacoes %} -
    {{o.numero_ordem}} - {{o.parlamentar}}
    +
    {{o.numero_ordem}} - {{o.parlamentar.nome_parlamentar}} / {{ o.parlamentar.filiacao_set.last.partido.sigla }}
    {{o.url_discurso}}

    {% endfor %} From 0ee13a878cf341e113105430aec023fa365d85fc Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 27 Apr 2017 11:27:45 -0300 Subject: [PATCH 099/140] Fixes #1041: troca filiacao_set.last por parlamentar.filiacao_atual --- sapl/templates/sessao/presenca.html | 4 ++-- sapl/templates/sessao/presenca_ordemdia.html | 4 ++-- sapl/templates/sessao/resumo.html | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sapl/templates/sessao/presenca.html b/sapl/templates/sessao/presenca.html index 7317cde38..372bc8c88 100644 --- a/sapl/templates/sessao/presenca.html +++ b/sapl/templates/sessao/presenca.html @@ -23,7 +23,7 @@
    {% endfor %} @@ -42,7 +42,7 @@ {% for parlamentar, check in view.get_presencas %} {% if check %}
    -
    +
    {% endif %} {% endfor %} diff --git a/sapl/templates/sessao/presenca_ordemdia.html b/sapl/templates/sessao/presenca_ordemdia.html index 7f9f0487b..edb4055ca 100644 --- a/sapl/templates/sessao/presenca_ordemdia.html +++ b/sapl/templates/sessao/presenca_ordemdia.html @@ -24,7 +24,7 @@
    {% endfor %} @@ -44,7 +44,7 @@ {% for parlamentar, check in view.get_presencas_ordem %} {% if check %}
    -
    +
    {% endif %} {% endfor %} diff --git a/sapl/templates/sessao/resumo.html b/sapl/templates/sessao/resumo.html index e338f322c..37554992a 100644 --- a/sapl/templates/sessao/resumo.html +++ b/sapl/templates/sessao/resumo.html @@ -43,7 +43,7 @@
    {% for m in mesa %}
    {{m.cargo}}: - {{m.parlamentar.nome_parlamentar}} / {{ m.parlamentar.filiacao_set.last.partido.sigla }}
    +
    {{m.parlamentar.nome_parlamentar}} / {{ m.parlamentar.filiacao_atual }}
    {% endfor %}
    @@ -53,7 +53,7 @@ Lista de Presença na Sessão
    {% for p in presenca_sessao %} -
    {{p.nome_parlamentar}} / {{ p.filiacao_set.last.partido.sigla }}
    +
    {{p.nome_parlamentar}} / {{ p.filiacao_atual }}
    {% endfor %}
    @@ -125,7 +125,7 @@ Lista de Presença na Ordem do Dia
    {% for p in presenca_ordem %} -
    {{p.nome_parlamentar}} / {{ p.filiacao_set.last.partido.sigla }}
    +
    {{p.nome_parlamentar}} / {{ p.filiacao_atual }}
    {% endfor %}
    @@ -165,7 +165,7 @@
    {% for o in oradores_explicacoes %} -
    {{o.numero_ordem}} - {{o.parlamentar.nome_parlamentar}} / {{ o.parlamentar.filiacao_set.last.partido.sigla }}
    +
    {{o.numero_ordem}} - {{o.parlamentar.nome_parlamentar}} / {{ o.parlamentar.filiacao_atual }}
    {{o.url_discurso}}

    {% endfor %} From a6fb0c2873f92dc9aa2d30d6be2abeac0b264e0b Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 27 Apr 2017 11:51:32 -0300 Subject: [PATCH 100/140] Fixes #1050 --- sapl/templates/base/RelatorioPresencaSessao_filter.html | 2 +- sapl/templates/parlamentares/parlamentar_perfil_publico.html | 2 +- sapl/templates/parlamentares/public_composicaomesa_form.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sapl/templates/base/RelatorioPresencaSessao_filter.html b/sapl/templates/base/RelatorioPresencaSessao_filter.html index 8aeae7aa6..c9c92328b 100644 --- a/sapl/templates/base/RelatorioPresencaSessao_filter.html +++ b/sapl/templates/base/RelatorioPresencaSessao_filter.html @@ -37,7 +37,7 @@ {% for p in parlamentares %} - {{p}} / {{p.filiacao_set.first.partido.sigla|default:"Sem Partido"}} + {{p}} / {{p.filiacao_atual|default:"Sem Partido"}} {{p.sessao_count}} {{p.sessao_porc}} {{p.ordemdia_count}} diff --git a/sapl/templates/parlamentares/parlamentar_perfil_publico.html b/sapl/templates/parlamentares/parlamentar_perfil_publico.html index 11bfc6bfc..1c5ead0fc 100644 --- a/sapl/templates/parlamentares/parlamentar_perfil_publico.html +++ b/sapl/templates/parlamentares/parlamentar_perfil_publico.html @@ -31,7 +31,7 @@
    -

    Partido:   {{object.filiacao_set.first.partido|default_if_none:"Não informado"}}

    +

    Partido:   {{object.filiacao_atual|default_if_none:"Não informado"}}

    diff --git a/sapl/templates/parlamentares/public_composicaomesa_form.html b/sapl/templates/parlamentares/public_composicaomesa_form.html index 15c62ab28..fbd780a30 100644 --- a/sapl/templates/parlamentares/public_composicaomesa_form.html +++ b/sapl/templates/parlamentares/public_composicaomesa_form.html @@ -51,7 +51,7 @@ {% endif %} {{p.parlamentar.nome_parlamentar}} - {{p.parlamentar.filiacao_set.last.partido.sigla}} + {{p.parlamentar.filiacao_atual}} {{p.cargo}} {% endfor %} From c5e609102800449a06d7a87ba14a2ee4d555bffa Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 27 Apr 2017 17:10:03 -0300 Subject: [PATCH 101/140] Fixes #1057 --- sapl/templates/protocoloadm/protocolo_mostrar.html | 1 + 1 file changed, 1 insertion(+) diff --git a/sapl/templates/protocoloadm/protocolo_mostrar.html b/sapl/templates/protocoloadm/protocolo_mostrar.html index 94d604461..49dba8a90 100644 --- a/sapl/templates/protocoloadm/protocolo_mostrar.html +++ b/sapl/templates/protocoloadm/protocolo_mostrar.html @@ -6,6 +6,7 @@ Protocolo: {{ protocolo.numero|stringformat:'06d' }}/{{ protocolo.ano }}
    Assunto: {{ protocolo.assunto_ementa|default:" Não informado." }}
    Data Protocolo: {{ protocolo.data|date:"d/m/Y" }} - Horário: {{ protocolo.hora|date:"H:i" }}
    + Autor: {{protocolo.autor.nome}}
    Interessado: {{ protocolo.interessado|default:" Não informado." }}
    Natureza do Processo: {% if protocolo.tipo_processo == 0 %} Administrativo {% elif protocolo.tipo_processo == 1 %} Legislativo {% endif %}
    From 38768a62c48c360e942706b66a7eac23f7dba718 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Fri, 28 Apr 2017 09:22:18 -0300 Subject: [PATCH 102/140] Fixes #1055 --- sapl/materia/models.py | 17 +++++++++++++++++ .../materia/materialegislativa_filter.html | 11 ++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/sapl/materia/models.py b/sapl/materia/models.py index 1a9d2afff..cf8e53d8b 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -4,6 +4,7 @@ import reversion from django.contrib.auth.models import Group from django.contrib.contenttypes.fields import GenericRelation from django.contrib.contenttypes.models import ContentType +from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.utils import formats from django.utils.translation import ugettext_lazy as _ @@ -215,6 +216,22 @@ class MateriaLegislativa(models.Model): return _('%(tipo)s nº %(numero)s de %(ano)s') % { 'tipo': self.tipo, 'numero': self.numero, 'ano': self.ano} + def data_entrada_protocolo(self): + ''' + hack: recuperar a data de entrada do protocolo sem gerar + dependência circular + ''' + from sapl.protocoloadm.models import Protocolo + if self.ano and self.numero_protocolo: + try: + return Protocolo.objects.get( + ano=self.ano, + numero=self.numero_protocolo).data + except ObjectDoesNotExist: + pass + + return '' + def delete(self, using=None, keep_parents=False): if self.texto_original: self.texto_original.delete() diff --git a/sapl/templates/materia/materialegislativa_filter.html b/sapl/templates/materia/materialegislativa_filter.html index cd459c61c..4af743b7b 100644 --- a/sapl/templates/materia/materialegislativa_filter.html +++ b/sapl/templates/materia/materialegislativa_filter.html @@ -47,6 +47,14 @@ Apresentação: {{ m.data_apresentacao }}
    {% endif %} + {% if m.numeracao_set.first %} + Processo: {{ m.numeracao_set.first.numero_materia }} / {{ m.numeracao_set.first.ano_materia }} +
    + {% endif %} + {% if m.numero_protocolo %} + Protocolo: {{m.numero_protocolo}}/{{m.ano}}    Data Entrada: {{m.data_entrada_protocolo}}
    + + {% endif %} {% if m.autoria_set.all %} Autores: {% for a in m.autoria_set.all %} @@ -57,7 +65,7 @@ {% endif %} {% endfor %}
    - {% endif %} + {% endif %} {% if m.tramitacao_set.last.unidade_tramitacao_destino %} Localização Atual:  {{m.tramitacao_set.last.unidade_tramitacao_destino}}
    {% endif %} @@ -79,6 +87,7 @@ {% endif %} {% if m.tramitacao_set.last.data_tramitacao %} Data da última Tramitação:  {{m.tramitacao_set.last.data_tramitacao}}
    + Ultima Ação:   {{m.tramitacao_set.last.texto}}
    {% endif %} {% if m.anexo_de.exists %} {% for a in m.materia_anexada_set.all %} From c7e55e18b38ae72a5c374a881a1f91686377bd8c Mon Sep 17 00:00:00 2001 From: Matheus Veleci Date: Tue, 2 May 2017 14:54:50 -0300 Subject: [PATCH 103/140] Executa rebuild index em backgroud --- start.sh | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/start.sh b/start.sh index 250be13ea..94a0392e3 100755 --- a/start.sh +++ b/start.sh @@ -2,7 +2,6 @@ create_env() { - echo "[ENV FILE] creating .env file..." # check if file exists if [ -f "/var/interlegis/sapl/data/secret.key" ]; then KEY=`cat /var/interlegis/sapl/data/secret.key` @@ -11,6 +10,7 @@ create_env() { echo $KEY > data/secret.key fi + # TODO: rename env-test-bash to .env FILENAME="/var/interlegis/sapl/sapl/.env" if [ -z "${DATABASE_URL:-}" ]; then @@ -34,11 +34,13 @@ create_env() { echo "EMAIL_HOST = ""${EMAIL_HOST-''}" >> $FILENAME echo "EMAIL_HOST_USER = ""${EMAIL_HOST_USER-''}" >> $FILENAME echo "EMAIL_HOST_PASSWORD = ""${EMAIL_HOST_PASSWORD-''}" >> $FILENAME - - echo "[ENV FILE] done." } +echo "creating .env file..." create_env +echo "done." + +# # python3 gen-env.py python3 manage.py bower install @@ -46,24 +48,6 @@ python3 manage.py bower install python3 manage.py migrate python3 manage.py collectstatic --no-input -python3 manage.py rebuild_index --noinput - -user_created=$(python3 create_admin.py 2>&1) - -cmd=$(echo $user_created | grep 'ADMIN_USER_EXISTS') -user_exists=$? - -cmd=$(echo $user_created | grep 'MISSING_ADMIN_PASSWORD') -lack_pwd=$? - -if [ $user_exists -eq 0 ]; then - echo "[SUPERUSER CREATION] User admin already exists. Not creating" -fi - -if [ $lack_pwd -eq 0 ]; then - echo "[SUPERUSER] Environment variable $ADMIN_PASSWORD for superuser admin was not set. Leaving container" - # return -1 -fi - +python3 manage.py rebuild_index --noinput & -/bin/sh gunicorn_start.sh no-venv +/bin/sh gunicorn_start.sh From e3660b0047e9c332e52422c34401d2b6d6189984 Mon Sep 17 00:00:00 2001 From: Matheus Veleci Date: Tue, 2 May 2017 14:58:11 -0300 Subject: [PATCH 104/140] =?UTF-8?q?Executa=20rebuild=20index=20em=20backgr?= =?UTF-8?q?oud=20-=20Ajusta=20start.sh=20do=20=C3=BAltimo=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start.sh | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/start.sh b/start.sh index 94a0392e3..26a7e869b 100755 --- a/start.sh +++ b/start.sh @@ -1,7 +1,5 @@ -#!/bin/sh - - create_env() { + echo "[ENV FILE] creating .env file..." # check if file exists if [ -f "/var/interlegis/sapl/data/secret.key" ]; then KEY=`cat /var/interlegis/sapl/data/secret.key` @@ -10,7 +8,6 @@ create_env() { echo $KEY > data/secret.key fi - # TODO: rename env-test-bash to .env FILENAME="/var/interlegis/sapl/sapl/.env" if [ -z "${DATABASE_URL:-}" ]; then @@ -34,13 +31,11 @@ create_env() { echo "EMAIL_HOST = ""${EMAIL_HOST-''}" >> $FILENAME echo "EMAIL_HOST_USER = ""${EMAIL_HOST_USER-''}" >> $FILENAME echo "EMAIL_HOST_PASSWORD = ""${EMAIL_HOST_PASSWORD-''}" >> $FILENAME + + echo "[ENV FILE] done." } -echo "creating .env file..." create_env -echo "done." - -# # python3 gen-env.py python3 manage.py bower install @@ -50,4 +45,22 @@ python3 manage.py migrate python3 manage.py collectstatic --no-input python3 manage.py rebuild_index --noinput & -/bin/sh gunicorn_start.sh +user_created=$(python3 create_admin.py 2>&1) + +cmd=$(echo $user_created | grep 'ADMIN_USER_EXISTS') +user_exists=$? + +cmd=$(echo $user_created | grep 'MISSING_ADMIN_PASSWORD') +lack_pwd=$? + +if [ $user_exists -eq 0 ]; then + echo "[SUPERUSER CREATION] User admin already exists. Not creating" +fi + +if [ $lack_pwd -eq 0 ]; then + echo "[SUPERUSER] Environment variable $ADMIN_PASSWORD for superuser admin was not set. Leaving container" + # return -1 +fi + + +/bin/sh gunicorn_start.sh no-venv From f259f5e84968b858a9195d1cb395795e3646ff1a Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Tue, 2 May 2017 17:17:10 -0300 Subject: [PATCH 105/140] Fix #1060 --- sapl/materia/models.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sapl/materia/models.py b/sapl/materia/models.py index cf8e53d8b..b5390f3b4 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -685,9 +685,19 @@ class Proposicao(models.Model): ) def __str__(self): - return '%s %s/%s' % (Proposicao._meta.verbose_name, - self.numero_proposicao, - self.ano) + if self.ano and self.numero_proposicao: + return '%s %s/%s' % (Proposicao._meta.verbose_name, + self.numero_proposicao, + self.ano) + else: + if len(self.descricao) < 30: + descricao = self.descricao[:28] + ' ...' + else: + descricao = self.descricao + + return '%s %s/%s' % (Proposicao._meta.verbose_name, + self.id, + descricao) def delete(self, using=None, keep_parents=False): if self.texto_original: From dbaae51466c7c0b572a7048977b27e85deb64b36 Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Tue, 2 May 2017 18:04:45 -0300 Subject: [PATCH 106/140] Fix #1051 --- sapl/parlamentares/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sapl/parlamentares/models.py b/sapl/parlamentares/models.py index d09f8dfac..4d15ab6fd 100644 --- a/sapl/parlamentares/models.py +++ b/sapl/parlamentares/models.py @@ -85,7 +85,8 @@ class Coligacao(models.Model): verbose_name=_('Legislatura')) nome = models.CharField(max_length=50, verbose_name=_('Nome')) numero_votos = models.PositiveIntegerField( - blank=True, null=True, verbose_name=_('Nº Votos Recebidos')) + blank=True, null=True, + verbose_name=_('Nº Votos Recebidos (Coligação)')) class Meta: verbose_name = _('Coligação') @@ -448,7 +449,7 @@ class Mandato(models.Model): tipo_causa_fim_mandato = models.PositiveIntegerField(blank=True, null=True) data_fim_mandato = models.DateField(verbose_name=_('Fim do Mandato')) votos_recebidos = models.PositiveIntegerField( - blank=True, null=True, verbose_name=_('Votos Recebidos')) + blank=True, null=True, verbose_name=_('Votos Recebidos (Mandato)')) data_expedicao_diploma = models.DateField( verbose_name=_('Expedição do Diploma')) titular = models.BooleanField( From ba8bc9ea7588be9d9c88f9fd3401778a96dab50b Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Wed, 3 May 2017 13:59:07 -0300 Subject: [PATCH 107/140] Nginx is now part of SAPL container --- Dockerfile | 32 +++++++++++++++++++------------- config/nginx/nginx.conf | 31 +++++++++++++++++++++++++++++++ start.sh | 7 ++++--- 3 files changed, 54 insertions(+), 16 deletions(-) create mode 100644 config/nginx/nginx.conf diff --git a/Dockerfile b/Dockerfile index 6551f656b..b5edd9bf9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,31 +4,37 @@ ENV BUILD_PACKAGES postgresql-dev graphviz-dev graphviz build-base git pkgconfig python3-dev libxml2-dev jpeg-dev libressl-dev libffi-dev libxslt-dev nodejs py3-lxml \ py3-magic postgresql-client vim -RUN apk add --no-cache python3 && \ +RUN apk add --no-cache python3 nginx && \ python3 -m ensurepip && \ rm -r /usr/lib/python*/ensurepip && \ pip3 install --upgrade pip setuptools && \ - rm -r /root/.cache + rm -r /root/.cache && \ + rm -f /etc/nginx/conf.d/* -RUN mkdir -p /var/interlegis/sapl &&\ +RUN mkdir -p /var/interlegis/sapl && \ apk add --update --no-cache $BUILD_PACKAGES && \ - npm install -g bower - -# Bower aceitar root -RUN touch /root/.bowerrc \ -&& chmod 751 /root/.bowerrc \ -&& echo "{ \"allow_root\": true }" >> /root/.bowerrc \ -&& npm cache clean + npm install -g bower && \ + npm cache clean WORKDIR /var/interlegis/sapl/ ADD . /var/interlegis/sapl/ COPY start.sh /var/interlegis/sapl/ +COPY config/nginx/sapl.conf /etc/nginx/conf.d +COPY config/nginx/nginx.conf /etc/nginx/nginx.conf + +RUN pip install -r /var/interlegis/sapl/requirements/requirements.txt --upgrade setuptools && \ + rm -r /root/.cache && \ + rm -r /tmp/* -RUN chmod +x /var/interlegis/sapl/start.sh +RUN python3 manage.py bower install -- --allow-root && \ + python3 manage.py collectstatic --no-input -RUN pip install -r /var/interlegis/sapl/requirements/requirements.txt --upgrade setuptools +RUN chmod +x /var/interlegis/sapl/start.sh && \ + ln -sf /dev/stdout /var/log/nginx/access.log && \ + ln -sf /dev/stderr /var/log/nginx/error.log VOLUME ["/var/interlegis/sapl/data", "/var/interlegis/sapl/media", "/var/interlegis/sapl/collected_static"] -ENTRYPOINT ["/var/interlegis/sapl/start.sh"] + +CMD ["/var/interlegis/sapl/start.sh"] diff --git a/config/nginx/nginx.conf b/config/nginx/nginx.conf new file mode 100644 index 000000000..cfea596f1 --- /dev/null +++ b/config/nginx/nginx.conf @@ -0,0 +1,31 @@ +user nginx; +worker_processes 1; + +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile off; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + include /etc/nginx/conf.d/*.conf; +} diff --git a/start.sh b/start.sh index 250be13ea..5ee1d7d79 100755 --- a/start.sh +++ b/start.sh @@ -40,12 +40,12 @@ create_env() { create_env -python3 manage.py bower install +#python3 manage.py bower install /bin/sh busy-wait.sh $DATABASE_URL python3 manage.py migrate -python3 manage.py collectstatic --no-input +#python3 manage.py collectstatic --no-input python3 manage.py rebuild_index --noinput user_created=$(python3 create_admin.py 2>&1) @@ -66,4 +66,5 @@ if [ $lack_pwd -eq 0 ]; then fi -/bin/sh gunicorn_start.sh no-venv +/bin/sh gunicorn_start.sh no-venv & +/usr/sbin/nginx -g "daemon off;" From 8998ca2218a6c038c81d81e6441f14119f0aaad7 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Wed, 3 May 2017 14:00:35 -0300 Subject: [PATCH 108/140] Refactored SAPL docker-compose --- docker-compose.yml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index a073bb4ee..cd899e6c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,3 @@ -server: - image: nginx:latest - ports: - - "80:80" - volumes: - - ./config/nginx:/etc/nginx/conf.d - - ./collected_static:/var/interlegis/sapl/collected_static - - ./media:/var/interlegis/sapl/media - volumes_from: - - web sapldb: image: postgres environment: @@ -16,16 +6,15 @@ sapldb: POSTGRES_DB: sapl PGDATA : /var/lib/postgresql/data/ volumes: - - ./postgres-data/data/:/var/lib/postgresql/data/ - - ./data:/data-import + - sapldb_data:/var/lib/postgresql/data/ ports: - "5532:5432" -web: +sapl: build: . volumes: - - .:/var/interlegis/sapl/ - - ./data:/var/interlegis/sapl/data - - ./media:/var/interlegis/sapl/media - - ./collected_static:/var/interlegis/sapl/collected_static + - sapl_data:/var/interlegis/sapl/data + - sapl_media:/var/interlegis/sapl/media links: - sapldb + ports: + - "80:80" From 701069f5477581c6bf1831daf96bcf9de33aabde Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Wed, 3 May 2017 15:16:02 -0300 Subject: [PATCH 109/140] HOT-FIX: reinsert bang bash --- start.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/start.sh b/start.sh index dccee52ba..2a1bb4df6 100755 --- a/start.sh +++ b/start.sh @@ -1,3 +1,5 @@ +#!/bin/sh + create_env() { echo "[ENV FILE] creating .env file..." # check if file exists From 2e0cfd495dee8b1e874571783ee7d67d6af1b075 Mon Sep 17 00:00:00 2001 From: Matheus Veleci Date: Wed, 3 May 2017 16:14:23 -0300 Subject: [PATCH 110/140] =?UTF-8?q?Ajusta=20cria=C3=A7=C3=A3o=20de=20.env?= =?UTF-8?q?=20e=20banco=20sqlite3=20tempor=C3=A1rios=20no=20=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 8 ++++++-- config/env_dockerfile | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 config/env_dockerfile diff --git a/Dockerfile b/Dockerfile index b5edd9bf9..64208fe1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,13 +28,17 @@ RUN pip install -r /var/interlegis/sapl/requirements/requirements.txt --upgrade rm -r /root/.cache && \ rm -r /tmp/* +COPY config/env_dockerfile /var/interlegis/sapl/sapl/.env + RUN python3 manage.py bower install -- --allow-root && \ - python3 manage.py collectstatic --no-input + python3 manage.py collectstatic --no-input && \ + rm -rf /var/interlegis/sapl/sapl/.env && \ + rm -rf /var/interlegis/sapl/sapl.db RUN chmod +x /var/interlegis/sapl/start.sh && \ ln -sf /dev/stdout /var/log/nginx/access.log && \ ln -sf /dev/stderr /var/log/nginx/error.log -VOLUME ["/var/interlegis/sapl/data", "/var/interlegis/sapl/media", "/var/interlegis/sapl/collected_static"] +VOLUME ["/var/interlegis/sapl/data", "/var/interlegis/sapl/media"] CMD ["/var/interlegis/sapl/start.sh"] diff --git a/config/env_dockerfile b/config/env_dockerfile new file mode 100644 index 000000000..c83fc88f1 --- /dev/null +++ b/config/env_dockerfile @@ -0,0 +1,8 @@ +DATABASE_URL = sqlite:///sapl.db +SECRET_KEY = 'Dockerfile_Key' +DEBUG = False +EMAIL_USE_TLS = True +EMAIL_PORT = 587 +EMAIL_HOST = '' +EMAIL_HOST_USER = '' +EMAIL_HOST_PASSWORD = '' From 95ec95a2a9be2785365d02fc8fd27e584135eed7 Mon Sep 17 00:00:00 2001 From: Matheus Veleci Date: Wed, 3 May 2017 16:17:25 -0300 Subject: [PATCH 111/140] Ajusta start.sh --- start.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/start.sh b/start.sh index dccee52ba..0dd68dd84 100755 --- a/start.sh +++ b/start.sh @@ -1,3 +1,6 @@ +#!/bin/sh + + create_env() { echo "[ENV FILE] creating .env file..." # check if file exists @@ -63,5 +66,5 @@ if [ $lack_pwd -eq 0 ]; then fi -/bin/sh gunicorn_start.sh no-venv & +/bin/sh gunicorn_start.sh no-venv & /usr/sbin/nginx -g "daemon off;" From 808fe22d63657fa72809bbfd4bf539de162af1d3 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Wed, 3 May 2017 16:53:55 -0300 Subject: [PATCH 112/140] =?UTF-8?q?Arruma=20migra=C3=A7=C3=A3o=20de=20expe?= =?UTF-8?q?diente=20em=20RegistroVotacao?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luciano Almeida --- sapl/legacy/migration.py | 40 +++++++++++++++++++--------------------- sapl/sessao/legacy.yaml | 1 - 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 6ab3cd184..24d244d4e 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -28,7 +28,7 @@ from sapl.norma.models import (AssuntoNorma, NormaJuridica, TipoVinculoNormaJuridica, NormaRelacionada) from sapl.parlamentares.models import Parlamentar from sapl.protocoloadm.models import Protocolo, StatusTramitacaoAdministrativo -from sapl.sessao.models import ExpedienteMateria, OrdemDia +from sapl.sessao.models import ExpedienteMateria, OrdemDia, RegistroVotacao from sapl.settings import PROJECT_DIR from sapl.utils import delete_texto, normalize, save_texto @@ -413,26 +413,6 @@ class DataMigrator: if field_type == 'CharField' or field_type == 'TextField': if value is None or value == 'None': value = '' - if field.model._meta.label == 'sessao.RegistroVotacao' and \ - field.name == 'ordem' and \ - not isinstance(value, OrdemDia): - try: - new_value = ExpedienteMateria.objects.get(pk=value) - setattr(new, 'expediente', new_value) - setattr(new, field.name, None) - continue - except ObjectDoesNotExist: - msg = 'FK [%s] não encontrada para valor %s ' \ - '(em %s %s)' % ( - field.name, value, - field.model.__name__, label or '---') - with reversion.create_revision(): - value = make_stub(field.related_model, value) - descricao = 'stub criado para entrada orfã!' - warn(msg + ' => ' + descricao) - save_relation(value, [field.name], msg, descricao, - eh_stub=True) - reversion.set_comment('Stub criado pela migração') setattr(new, field.name, value) elif field.model.__name__ == 'TipoAutor' and \ field.name == 'content_type': @@ -657,6 +637,23 @@ def adjust_protocolo(new, old): new.numero = p['numero__max'] + 1 +def adjust_registrovotacao(new, old): + ordem_dia = OrdemDia.objects.filter( + pk=old.cod_ordem, materia=old.cod_materia) + expediente_materia = ExpedienteMateria.objects.filter( + pk=old.cod_ordem, materia=old.cod_materia) + + if ordem_dia and not expediente_materia: + new.ordem = ordem_dia[0] + if not ordem_dia and expediente_materia: + new.expediente = expediente_materia[0] + if len(ordem_dia) == len(expediente_materia): + assert 0, "ERRO: RegistroVotacao [PK %s]. OrdemDia tem %s entrada(s)"\ + " e ExpedienteMateria %s entrada(s).\n Deve haver somente "\ + "uma entrada de OrdemDia ou ExpedienteMateria." % ( + old.pk, len(ordem_dia), len(expediente)) + + def adjust_tipoproposicao(new, old): if old.ind_mat_ou_doc == 'M': new.tipo_conteudo_related = TipoMateriaLegislativa.objects.get( @@ -754,6 +751,7 @@ AJUSTE_ANTES_SALVAR = { Parlamentar: adjust_parlamentar, Participacao: adjust_participacao, Protocolo: adjust_protocolo, + RegistroVotacao: adjust_registrovotacao, TipoProposicao: adjust_tipoproposicao, StatusTramitacao: adjust_statustramitacao, StatusTramitacaoAdministrativo: adjust_statustramitacaoadm, diff --git a/sapl/sessao/legacy.yaml b/sapl/sessao/legacy.yaml index 6e2cc2428..90188a76c 100644 --- a/sapl/sessao/legacy.yaml +++ b/sapl/sessao/legacy.yaml @@ -65,7 +65,6 @@ RegistroVotacao: numero_votos_nao: num_votos_nao numero_votos_sim: num_votos_sim observacao: txt_observacao - ordem: cod_ordem tipo_resultado_votacao: tip_resultado_votacao VotoParlamentar (RegistroVotacaoParlamentar): From 4c777c1dfabb8974661f4a879cbd453782414213 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Thu, 4 May 2017 17:20:19 -0300 Subject: [PATCH 113/140] =?UTF-8?q?Modifica=20fun=C3=A7=C3=A3o=20ajdust=5F?= =?UTF-8?q?registrovotacao?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luciano Almeida --- sapl/legacy/migration.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 24d244d4e..93bc01ebe 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -637,7 +637,7 @@ def adjust_protocolo(new, old): new.numero = p['numero__max'] + 1 -def adjust_registrovotacao(new, old): +def adjust_registrovotacao_antes_salvar(new, old): ordem_dia = OrdemDia.objects.filter( pk=old.cod_ordem, materia=old.cod_materia) expediente_materia = ExpedienteMateria.objects.filter( @@ -647,11 +647,19 @@ def adjust_registrovotacao(new, old): new.ordem = ordem_dia[0] if not ordem_dia and expediente_materia: new.expediente = expediente_materia[0] - if len(ordem_dia) == len(expediente_materia): - assert 0, "ERRO: RegistroVotacao [PK %s]. OrdemDia tem %s entrada(s)"\ - " e ExpedienteMateria %s entrada(s).\n Deve haver somente "\ - "uma entrada de OrdemDia ou ExpedienteMateria." % ( - old.pk, len(ordem_dia), len(expediente)) + + +def adjust_registrovotacao_depois_salvar(new, old): + if not new.ordem and not new.expediente: + with reversion.create_revision(): + problema = 'RegistroVotacao de PK %s não possui nenhuma OrdemDia'\ + ' ou ExpedienteMateria.' % old.pk + descricao = 'RevistroVotacao deve ter no mínimo uma ordem do dia'\ + ' ou expediente vinculado.' + warn(problema + ' => ' + descricao) + save_relation(obj=new, problema=problema, + descricao=descricao, eh_stub=False) + reversion.set_comment('RegistroVotacao sem ordem ou expediente') def adjust_tipoproposicao(new, old): @@ -751,7 +759,7 @@ AJUSTE_ANTES_SALVAR = { Parlamentar: adjust_parlamentar, Participacao: adjust_participacao, Protocolo: adjust_protocolo, - RegistroVotacao: adjust_registrovotacao, + RegistroVotacao: adjust_registrovotacao_antes_salvar, TipoProposicao: adjust_tipoproposicao, StatusTramitacao: adjust_statustramitacao, StatusTramitacaoAdministrativo: adjust_statustramitacaoadm, @@ -761,6 +769,7 @@ AJUSTE_ANTES_SALVAR = { AJUSTE_DEPOIS_SALVAR = { NormaJuridica: adjust_normajuridica_depois_salvar, Protocolo: adjust_protocolo_depois_salvar, + RegistroVotacao: adjust_registrovotacao_depois_salvar, } # CHECKS #################################################################### From fa73345651dc35c64a75fe4a5dce44c9a986818c Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 4 May 2017 17:52:29 -0300 Subject: [PATCH 114/140] =?UTF-8?q?Gera=20migra=C3=A7=C3=A3o=20de=20dispos?= =?UTF-8?q?itivo=20em=20AsssuntoMateria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0004_auto_20170504_1751.py | 32 +++++++++++++++++++ .../migrations/0002_auto_20170504_1751.py | 25 +++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 sapl/materia/migrations/0004_auto_20170504_1751.py create mode 100644 sapl/parlamentares/migrations/0002_auto_20170504_1751.py diff --git a/sapl/materia/migrations/0004_auto_20170504_1751.py b/sapl/materia/migrations/0004_auto_20170504_1751.py new file mode 100644 index 000000000..49a7e8938 --- /dev/null +++ b/sapl/materia/migrations/0004_auto_20170504_1751.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.11 on 2017-05-04 17:51 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('materia', '0003_auto_20170403_1505'), + ] + + operations = [ + migrations.AlterField( + model_name='assuntomateria', + name='dispositivo', + field=models.CharField(blank=True, default='', max_length=200, verbose_name='Descrição do Dispositivo Legal'), + preserve_default=False, + ), + migrations.AlterField( + model_name='materiaassunto', + name='assunto', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.AssuntoMateria', verbose_name='Assunto'), + ), + migrations.AlterField( + model_name='materiaassunto', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='materia.MateriaLegislativa', verbose_name='Matéria'), + ), + ] diff --git a/sapl/parlamentares/migrations/0002_auto_20170504_1751.py b/sapl/parlamentares/migrations/0002_auto_20170504_1751.py new file mode 100644 index 000000000..7e7039e94 --- /dev/null +++ b/sapl/parlamentares/migrations/0002_auto_20170504_1751.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.11 on 2017-05-04 17:51 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('parlamentares', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='coligacao', + name='numero_votos', + field=models.PositiveIntegerField(blank=True, null=True, verbose_name='Nº Votos Recebidos (Coligação)'), + ), + migrations.AlterField( + model_name='mandato', + name='votos_recebidos', + field=models.PositiveIntegerField(blank=True, null=True, verbose_name='Votos Recebidos (Mandato)'), + ), + ] From 0f5331c9810b443e8c4a7ffe121b844323f21837 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Thu, 4 May 2017 17:56:58 -0300 Subject: [PATCH 115/140] =?UTF-8?q?Remove=20CSS=20desnecess=C3=A1rios.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/static/styles/app.css | 1 - sapl/static/styles/compilacao.css | 1 - sapl/static/styles/style_tinymce.css | 8 -------- 3 files changed, 10 deletions(-) delete mode 100644 sapl/static/styles/app.css delete mode 100644 sapl/static/styles/compilacao.css delete mode 100644 sapl/static/styles/style_tinymce.css diff --git a/sapl/static/styles/app.css b/sapl/static/styles/app.css deleted file mode 100644 index e7146b1f4..000000000 --- a/sapl/static/styles/app.css +++ /dev/null @@ -1 +0,0 @@ -.logo img{width:40px;height:40px;margin:5px 15px}.vcenter{display:inline-block;vertical-align:middle;float:none;padding:10px}nav.navbar{border-radius:0;font-size:15px}nav .navbar-nav>li>a{padding-top:0px;padding-bottom:0px;line-height:75px}nav .navbar-nav>li>a:hover{background-color:#23527c}nav .navbar-nav>li:nth-child(2)>.dropdown-menu{right:auto}nav .navbar-nav:last-child>li:last-child a{padding-right:0px}.masthead{padding:10px}.masthead .nav{clear:both}.masthead .navbar-brand{color:inherit;font-size:24px}.masthead .navbar-brand img.img-responsive{height:95px;margin-right:15px}.masthead .navbar-brand small{color:#93A4AA;font-size:75%;line-height:25px}.navbar{margin-bottom:0}.navbar-brand{padding:0px}h1,.h1{font-size:30px}h2,.h2{font-size:24px}h3,.h3{font-size:20px}h4,.h4{font-size:16px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}.page-header{margin:20px 0px 10px}.btn:hover,.btn:focus{color:inherit}.caret.top{transform:rotate(180deg)}.btn-default.btn-excluir{color:#d9534f}.btn-default.btn-excluir:hover{color:#fff;border-color:#de6764;background-color:#de6764}.controls-file{padding:10px;border:1px solid #d6e1e5;border-radius:4px}.controls-file label.checkbox-inline{margin:0px;display:block}.controls-radio-checkbox{padding:0px;border:1px solid #d6e1e5;border-radius:4px;min-height:20px}.controls-radio-checkbox .help-block{margin:15px;padding:15px;border:2px dashed #d6e1e5}.controls-radio-checkbox label{padding:5px}.controls-radio-checkbox label .icons{top:5px;left:8px}.controls-radio-checkbox label.checkbox-inline,.controls-radio-checkbox label.radio-inline{padding:8px;padding-left:36px}.controls-radio-checkbox label.checkbox-inline .icons,.controls-radio-checkbox label.radio-inline .icons{top:8px;left:8px}.controls-radio-checkbox .checkbox,.controls-radio-checkbox .radio,.controls-radio-checkbox .checkbox-inline,.controls-radio-checkbox .radio-inline{margin:0}.controls-radio-checkbox .checkbox:hover,.controls-radio-checkbox .radio:hover,.controls-radio-checkbox .checkbox-inline:hover,.controls-radio-checkbox .radio-inline:hover{background-color:#d6e1e5}p.control-label{font-weight:bold}.legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5;clear:both}.grid-gutter-width-right{margin-right:15px}html{position:relative;min-height:100%}body{margin-bottom:160px}.footer{position:absolute;bottom:0;width:100%;height:140px;background:#364347 none repeat scroll 0% 0%;color:white;text-align:center}.footer p{color:white;margin-top:10px}.footer .container{padding-top:25px}.pagination{padding-top:25px}.modal .alert{margin-bottom:0}fieldset fieldset{font-size:95%}fieldset fieldset legend{font-size:18px}.avatar-parlamentar{height:84px;width:84px}#conteudo{position:relative;padding:2em 1.5em 1.5em 1.5em;overflow:hidden;font-size:100%;text-align:left;min-height:350px;max-width:1000px;margin:0 auto}#conteudo a:hover{color:#444;-webkit-transition:0.3s ease-in;-moz-transition:0.3s ease-in;-o-transition:0.3s ease-in}#homeIndex{text-align:center}.homeBanner span{color:white;font-size:32px;font-weight:600;display:inline-block;vertical-align:middle;padding:2px 45px 4px;border:2px solid}.homeBanner::after{display:inline-block;vertical-align:middle;height:100%}.homeBlock{display:inline-block;position:relative;background-color:#F3F3F3;width:190px;height:260px;margin:3px;text-align:center;font-size:0;overflow:hidden}.homeBlock>a{display:block;position:absolute;width:100%;height:100%;top:0;left:0}.homeBlock::after{content:'';display:inline-block;vertical-align:middle;height:100%;overflow:visible;clear:none;visibility:initial}.homeContent{position:relative;padding:10px;text-align:justify;font-size:14px;color:#FFF;opacity:0;transition:opacity 0.5s ease;display:inline-block;vertical-align:middle}.homeContent p{display:block;line-height:13px;font-size:80%;color:white}.homeIcon{position:relative;display:inline-block;width:105px;height:105px;border-radius:50%;background:#364347;z-index:1}.homeIcon::before{content:'';position:absolute;width:100%;height:100%;border-radius:50%;background:#364347;top:0;left:0;transform:scale(0.95);transition:transform 0.6s ease}.homeIcon img{position:absolute;margin:auto;top:0;bottom:0;right:0;left:0;transition:opacity 0.4s 0.4s ease}.homeFront{position:absolute;top:46%;width:100%;font-size:0;transform:translateY(-60%)}.homeFront h2{position:absolute;margin-top:18px;font-size:22px;font-weight:700;color:#595959 !important;width:100%;padding:0 6%;z-index:0}.homeTitle{display:block;height:32px;text-align:center;width:100%;opacity:0;transition:opacity 0.4s ease}.homeTitle::before{content:'';display:inline-block;vertical-align:middle;height:100%}.homeTitle h2{display:inline-block;vertical-align:middle;max-width:110px;font-size:14px;color:white !important;line-height:1em}.homeTitle img{display:inline-block;vertical-align:middle;height:30px;margin-right:5px}.homeBlock:hover .homeIcon::before{transform:scale(3.6) translateY(7px)}.homeBlock:hover .homeContent{opacity:1;transition-delay:0.2s}.homeBlock:hover .homeIcon img{opacity:0;transition-duration:0.2s;transition-delay:0s}.homeBlock:hover .homeTitle{opacity:1}h1,h2,h3,h4,h5,h6,form,dl,dt,dd,p,div,img,a{margin:0;padding:0}p{margin:0.5em 0}.manual li{display:list-item;line-height:1.5em;padding-right:0}.manual li a{background-color:transparent;border:none;border-radius:none;padding:0}.manual,.manual ul{padding-left:1.5em;list-style-type:none;margin-top:0;font-size:100%}@media (max-width: 1199px){.masthead .navbar-brand{font-size:22px}.masthead .navbar-brand img.img-responsive{height:60px;width:60px;margin-right:7.5px}.navbar-nav>li>a{padding-left:10.71429px;padding-right:10.71429px}}@media (max-width: 1091px){.navbar-nav>li>a{padding-left:7.5px;padding-right:7.5px}}@media (min-width: 1092px) and (max-width: 1199px){.container{width:1070px}} diff --git a/sapl/static/styles/compilacao.css b/sapl/static/styles/compilacao.css deleted file mode 100644 index ed50d8998..000000000 --- a/sapl/static/styles/compilacao.css +++ /dev/null @@ -1 +0,0 @@ -a:link:after,a:visited:after{content:""}.test_import:nth-child(even){background-color:#ccc}#wait_message{display:block;position:fixed;top:0;bottom:0;left:0;right:0;background-color:rgba(220,220,220,0.75);z-index:99}#wait_message #msg{position:relative;margin:20% auto;padding:1.2em 2em;max-width:600px;text-align:center;font-size:1.5em;color:#677;border:1px solid #eee;background-color:#fff !important;box-shadow:0 1px 2px #999}.text-center{text-align:center}.cp-notify{z-index:9999;position:fixed;top:2em;left:50%;min-width:600px;transform:translate(-50%, 0);transition:all 0.4s ease;opacity:0.97}.cp-notify.hide{opacity:0;top:-1000px;display:block !important;transition:all 0.4s ease}.cp-notify .message{padding:1em;border:2px solid rgba(0,0,0,0.1);border-radius:4px;color:rgba(0,0,0,0.6);line-height:1em;font-size:1.3em;text-align:center;box-shadow:0 0 100px rgba(0,0,0,0.2)}.cp .desativado .dtxt,.cp .dpt .dptt>a.desativado .dtxt,.cp .desativado .dtxt *,.cp .dpt .dptt>a.desativado .dtxt *,.cp .desativado .dpt-link,.cp .dpt .dptt>a.desativado .dpt-link,.cp .desativado .dpt-link *,.cp .dpt .dptt>a.desativado .dpt-link *{text-decoration:line-through;color:#999 !important}.cp .desativado .dtxt table,.cp .dpt .dptt>a.desativado .dtxt table,.cp .desativado .dtxt table td,.cp .dpt .dptt>a.desativado .dtxt table td,.cp .desativado .dtxt * table,.cp .dpt .dptt>a.desativado .dtxt * table,.cp .desativado .dtxt * table td,.cp .dpt .dptt>a.desativado .dtxt * table td,.cp .desativado .dpt-link table,.cp .dpt .dptt>a.desativado .dpt-link table,.cp .desativado .dpt-link table td,.cp .dpt .dptt>a.desativado .dpt-link table td,.cp .desativado .dpt-link * table,.cp .dpt .dptt>a.desativado .dpt-link * table,.cp .desativado .dpt-link * table td,.cp .dpt .dptt>a.desativado .dpt-link * table td{border:1px dotted #ccc}.cp a{text-decoration:none;cursor:pointer}.cp .diff .desativado,.cp .diff .dpt .dptt>a.desativado,.cp .dpt .diff .dptt>a.desativado,.cp .diff .desativado *,.cp .diff .dpt .dptt>a.desativado *,.cp .dpt .diff .dptt>a.desativado *{text-decoration:line-through;color:#ddd !important;font-size:90%}.cp .diff .added{color:#04DE2C}.cp .dpt{font-size:1em;position:relative}.cp .dpt.indent{padding-left:1em}.cp .dpt .ementa{padding:2em 0em 2em 35%;font-weight:bold}.cp .dpt .titulo_generico,.cp .dpt .anexo,.cp .dpt .disp_preliminares,.cp .dpt .disp_gerais,.cp .dpt .disp_transitorias,.cp .dpt .disp_finais,.cp .dpt .parte,.cp .dpt .livro,.cp .dpt .titulo,.cp .dpt .capitulo,.cp .dpt .secao,.cp .dpt .subsecao,.cp .dpt .itemsecao{text-align:center;font-weight:bold;margin-bottom:1em;font-size:1.5em;margin-top:3em}.cp .dpt .titulo{margin-top:2em}.cp .dpt .capitulo{margin-top:1.5em;font-size:1.3em}.cp .dpt .secao{margin-top:1.2em;margin-bottom:0.7em;font-size:1.2em}.cp .dpt .subsecao,.cp .dpt .itemsecao{margin-top:1em;margin-bottom:0.6em;font-size:1.2em;font-style:italic}.cp .dpt .artigo{font-size:1.15em;float:left}.cp .dpt .artigo .dptt{position:relative}.cp .dpt .caput{margin-top:0.3333em;font-size:1.15em}.cp .dpt .paragrafo{font-size:1.1em;margin-top:0.2222em}.cp .dpt .inciso{font-size:1.1em;margin-top:0.1667em}.cp .dpt .alinea{font-size:1.0em;margin-top:2px}.cp .dpt .item{font-size:1.0em;margin-top:2px}.cp .dpt .bloco_alteracao{padding-left:10%;font-style:italic;color:#018}.cp .dpt .bloco_alteracao a{text-decoration:underline}.cp .dpt .bloco_alteracao a,.cp .dpt .bloco_alteracao table,.cp .dpt .bloco_alteracao table td{color:#018 !important}.cp .dpt .dn{font-weight:normal;position:relative;font-size:70%}.cp .dpt .dn p,.cp .dpt .dn ul{font-weight:normal;margin:0 0 0 0;list-style:none;padding:0}.cp .dpt .dn .dnl{display:block;text-align:left !important}.cp .dpt .dn .dnl *{display:inline}.cp .dpt .dn .dnl .bullet{padding:0 0.333em;display:inline-block}.cp .dpt .dn .dnl .dnli{min-height:2.5em}.cp .dpt .dn .dnl .dnli:hover ul{transition:opacity 0.5s linear, clip 0s 0.3s;clip:auto;opacity:1;background:rgba(230,230,230,0.9)}.cp .dpt .dn .dnl .dnli ul{transition:opacity 0.5s linear, clip 0s 0.3s;clip:rect(0, 0, 0, 0);opacity:0;position:absolute;background:transparent;right:0;padding:0.2em 0.5em 0em 0.5em;border:1px solid #c7e3d3;border-top:0px;font-size:1.5rem}.cp .dpt .dn .dnl .dnli ul li{display:table-cell;color:#aaa}.cp .dpt .dn .dnl .dnli ul li:hover{color:#787}.cp .dpt .dn .dnl .dnli ul li:hover a{color:#27AE60 !important}.cp .dpt .dn .dnl .dnli ul li .nowner{color:#27AE60 !important}.cp .dpt .dn .dnl .dnli .ntitulo{font-weight:bold;color:#03A203;text-decoration:none}.cp .dpt .dn .dnl .dnli .ntitulo a{color:#294 !important}.cp .dpt .dn .dnl .dnli .ntexto{color:#06D806}.cp .dpt .dn .dnl .dnli .ntexto a{color:#03A203 !important}.cp .dpt .dn .dnl:hover{display:block}.cp .dpt .dn .dnl:hover *{display:block}.cp .dpt .dn .dnl:hover>.bullet{display:none}.cp .dpt .dn .dnl:hover .dnli{margin-top:0.5em;border-top:1px solid #c7e3d3}.cp .dpt .dptt>a{color:#444444}.cp .dpt .dptt>a.nota-alteracao{color:#02baf2;font-size:0.75em}.cp .dpt .dptt>a.nota-alteracao:hover{text-decoration:underline}.cp .dpt .dptt .dne{position:absolute;display:block;right:0;left:0;top:0;height:0;transform:scaleX(0);transform-origin:right;transition:all 0.3s ease;border-top:1px solid #2980B9}.cp .dpt .dptt .dne ul.btns-action{list-style:none;padding:0;position:absolute;right:0;background-color:#2980B9}.cp .dpt .dptt .dne ul.btns-action li{float:left}.cp .dpt .dptt .dne ul.btns-action li:hover{background-color:rgba(0,0,0,0.1)}.cp .dpt .dptt .dne ul.btns-action li a{color:white;padding:0.15em 1em 0;display:inline-block}.cp .dpt .dptt .dne-nota{position:relative;transform:scaleX(1);height:auto;border-top:0px}.cp .dpt .dptt .dne-nota ul.btns-action{display:none}.cp .dpt .dptt .dne-nota .dne-form{margin:1em -2em 0em;text-align:left;font-size:1.6rem}.cp .dpt .dptt:hover .dne{height:0.1667rem;transform:scaleX(1);transition-delay:1s}.cp .dpt .dptt:hover .dne-nota{height:auto;transition-delay:0s}.cp .tipo-vigencias{list-style:none;position:fixed;bottom:0px;left:50%;transform:translate(-50%, 0);margin:0;padding:0;background-color:#2980B9;z-index:1000;opacity:0.9;transition:all 0.3s ease-in-out}.cp .tipo-vigencias li{display:inline-block;border-left:1px solid #fff;float:left}.cp .tipo-vigencias li a{color:white;padding:0.3em 1em 0;display:inline-block;font-size:110%;cursor:pointer}.cp .tipo-vigencias li a.selected{background-color:rgba(0,0,0,0.5)}.cp .tipo-vigencias li:hover{background-color:rgba(0,0,0,0.2)}.cp .tipo-vigencias:hover{opacity:1}.cp.cpe .desativado,.cp.cpe .dpt .dptt>a.desativado{text-decoration:line-through;color:#999 !important}.cp.cpe .desativado table,.cp.cpe .dpt .dptt>a.desativado table,.cp.cpe .desativado table td,.cp.cpe .dpt .dptt>a.desativado table td{border:1px dotted #ccc}.cp.cpe .desativado a.nota-alteracao *{color:#02baf2 !important}.cp.cpe .dpt{display:block}.cp.cpe .dpt>.dpt-actions-fixed{position:absolute;right:-0.8em;top:-0.8em;z-index:3;opacity:0}.cp.cpe .dpt>.dpt-actions-fixed .activate{display:none}.cp.cpe .dpt>.dpt-actions-fixed .deactivate{display:inline}.cp.cpe .dpt>.dpt-actions-fixed .btn-dpt-edit.btn-default{color:#333}.cp.cpe .dpt>.dpt-actions-fixed .btn-dpt-edit.btn-default:hover{color:#fff;background-color:#02baf2}.cp.cpe .dpt>.dpt-actions,.cp.cpe .dpt>.dpt-actions-bottom{display:none}.cp.cpe .dpt>.dpt-text{cursor:text;min-height:30px;border:1px solid transparent}.cp.cpe .dpt>.dpt-text:hover,.cp.cpe .dpt>.dpt-text.hover-fixed{background-color:rgba(0,0,0,0.01);color:#2980B9;border:1px solid #eee;transition:color 0.3s ease}.cp.cpe .dpt>.dpt-text.artigo{float:none}.cp.cpe .dpt>.dpt-text a.link-rotulo{color:#000}.cp.cpe .dpt:hover>.dpt-actions-fixed{opacity:1}.cp.cpe .dpt:hover>.dpt-actions-fixed:hover ~ .dpt-text{background-color:rgba(0,0,0,0.01);color:#2980B9;border:1px solid #eee;transition:color 0.3s ease}.cp.cpe .dpt .semtexto{font-weight:bold;color:#9aaed6}.cp.cpe .dpt .semtexto:hover{color:#5f76a4}.cp.cpe .dpt-alts{margin:0;margin-bottom:1em;padding:0;background-color:transparent;min-height:100px;border:2px dashed #fff}.cp.cpe .dpt-alts:hover{border-color:#d9ddde}.cp.cpe .dpt-alts:empty{border-color:#ddd}.cp.cpe .dpt-alts.drag{width:100% !important;border-color:#d9ddde}.cp.cpe .dpt-alts.drag .dpt{transition-duration:0s !important}.cp.cpe .dpt-alts .dpt{width:100% !important;box-shadow:0 -1px 0 #e5e5e5,0 0 2px rgba(0,0,0,0.12),0 2px 4px rgba(0,0,0,0.24);padding:0;margin:0;background-color:#edf0f1;height:auto !important;min-height:2em;z-index:1}.cp.cpe .dpt-alts .dpt:not(:first-child){border-top:1px solid white}.cp.cpe .dpt-alts .dpt>.dpt-text{padding:0.3em 1em;margin-top:0;margin-bottom:0}.cp.cpe .dpt-alts .dpt>.dpt-text a.link-rotulo{text-decoration:underline}.cp.cpe .dpt-alts .dpt-selected.dpt{margin:0em -0.5em}.cp.cpe .dpt-selected.dpt{width:auto !important;margin:1em -0.5em;border:1px solid #fad46b !important;padding:0;background-color:#fafafa;border-radius:3px;z-index:4}.cp.cpe .dpt-selected.dpt>.dpt-text{border:1px solid transparent}.cp.cpe .dpt-selected.dpt>.dpt-text:hover{border:1px solid transparent;background-color:transparent}.cp.cpe .dpt-selected.dpt>.dpt-form{margin-bottom:0em}.cp.cpe .dpt-selected.dpt>.dpt-actions,.cp.cpe .dpt-selected.dpt>.dpt-actions-bottom{display:table;background-color:#e5e5e5;padding:1em;margin-bottom:0em;width:100%}.cp.cpe .dpt-selected.dpt>.dpt-actions>.btn-action,.cp.cpe .dpt-selected.dpt>.dpt-actions-bottom>.btn-action{display:table-cell;float:none}.cp.cpe .dpt-selected.dpt>.dpt-actions .btn-excluir,.cp.cpe .cp.cpe1_old_apagar .dpt-selected.dpt>.dpt-actions .csform .actions_inserts>li>a.btn-salvar,.cp.cpe1_old_apagar .cp.cpe .dpt-selected.dpt>.dpt-actions .csform .actions_inserts>li>a.btn-salvar,.cp.cpe .dpt-selected.dpt>.dpt-actions-bottom .btn-excluir,.cp.cpe .cp.cpe1_old_apagar .dpt-selected.dpt>.dpt-actions-bottom .csform .actions_inserts>li>a.btn-salvar,.cp.cpe1_old_apagar .cp.cpe .dpt-selected.dpt>.dpt-actions-bottom .csform .actions_inserts>li>a.btn-salvar{display:inline-block;opacity:0.3}.cp.cpe .dpt-selected.dpt>.dpt-actions .btn-excluir:hover,.cp.cpe .cp.cpe1_old_apagar .dpt-selected.dpt>.dpt-actions .csform .actions_inserts>li>a.btn-salvar:hover,.cp.cpe1_old_apagar .cp.cpe .dpt-selected.dpt>.dpt-actions .csform .actions_inserts>li>a.btn-salvar:hover,.cp.cpe .dpt-selected.dpt>.dpt-actions-bottom .btn-excluir:hover,.cp.cpe .cp.cpe1_old_apagar .dpt-selected.dpt>.dpt-actions-bottom .csform .actions_inserts>li>a.btn-salvar:hover,.cp.cpe1_old_apagar .cp.cpe .dpt-selected.dpt>.dpt-actions-bottom .csform .actions_inserts>li>a.btn-salvar:hover{opacity:1}.cp.cpe .dpt-selected.dpt>.dpt-actions-bottom{margin:0}.cp.cpe .dpt-selected .dpt-block{border-top:1px solid #e5e5e5 !important;opacity:0.6;transition:opacity 0.4s ease}.cp.cpe .dpt-selected .dpt-block:hover{opacity:1}.cp.cpe .dpt-selected .dpt-text{opacity:0.7;margin:0;padding:0.7em}.cp.cpe .dpt-selected .dpt-text:hover{opacity:1;background-color:#f5f5f5}.cp.cpe .dpt-selected .dpt-alts{margin:1em}.cp.cpe .dpt-selected .dpt-alts .dpt{box-shadow:0 0 0}.cp.cpe .dpt-selected>.dpt-actions-fixed{opacity:1;top:-12px;right:0.5em}.cp.cpe .dpt-selected>.dpt-actions-fixed .activate{display:inline}.cp.cpe .dpt-selected>.dpt-actions-fixed .deactivate{display:none}.cp.cpe .dpt-selected>.dpt-actions-fixed .btn-dpt-edit{padding-top:2px;padding-bottom:1px}.cp.cpe .dpt-selected>.dpt-actions-fixed .btn-dpt-edit.btn-default{background-color:#fad46b;border:1px solid #fad46b}.cp.cpe .dpt-selected .dropdown-menu.dropdown-menu-left{right:auto !important;left:0;padding:2px 0}.cp.cpe .dpt-selected .dropdown-menu.dropdown-menu-left>.top.arrow{right:88%;left:auto}.cp.cpe .dpt-selected .dropdown-menu li a{padding-top:2px;padding-bottom:2px}.cp.cpe .dpt-selected .btn-group .radius-right{border-bottom-right-radius:4px !important;border-top-right-radius:4px !important}.cp.cpe .dpt-selected:hover>.dpt-actions-fixed{opacity:1}.cp.cpe1_old_apagar{margin-bottom:15em}.cp.cpe1_old_apagar .desativado,.cp.cpe1_old_apagar .dpt .dptt>a.desativado,.cp.cpe1_old_apagar .desativado *,.cp.cpe1_old_apagar .dpt .dptt>a.desativado *{text-decoration:line-through;color:#999 !important}.cp.cpe1_old_apagar .desativado table,.cp.cpe1_old_apagar .dpt .dptt>a.desativado table,.cp.cpe1_old_apagar .desativado table td,.cp.cpe1_old_apagar .dpt .dptt>a.desativado table td,.cp.cpe1_old_apagar .desativado * table,.cp.cpe1_old_apagar .dpt .dptt>a.desativado * table,.cp.cpe1_old_apagar .desativado * table td,.cp.cpe1_old_apagar .dpt .dptt>a.desativado * table td{border:1px dotted #ccc}.cp.cpe1_old_apagar a{text-decoration:none;cursor:pointer}.cp.cpe1_old_apagar .dpt{position:relative;display:block}.cp.cpe1_old_apagar .dpt .semtexto{font-weight:bold;color:#BFD1F6}.cp.cpe1_old_apagar .dpt .artigo{float:none}.cp.cpe1_old_apagar .dpt .caput{margin-top:0}.cp.cpe1_old_apagar .dpt>.actions_right,.cp.cpe1_old_apagar .dpt-selected .csform .dpt>.actions_left{color:#fff;right:0em;position:absolute;opacity:0;transition:all 0.4s ease-in-out;z-index:1000}.cp.cpe1_old_apagar .dpt>.actions_right a.btn-bloco,.cp.cpe1_old_apagar .dpt-selected .csform .dpt>.actions_left a.btn-bloco{background-color:#3498db;color:#ffffff !important;padding:8px 18px 6px;display:inline-block;line-height:1;float:right}.cp.cpe1_old_apagar .dpt>.actions_right a.btn-bloco:hover,.cp.cpe1_old_apagar .dpt-selected .csform .dpt>.actions_left a.btn-bloco:hover{opacity:1;background-image:-webkit-linear-gradient(top, #1c81c4, #0b6dad);background-image:-moz-linear-gradient(top, #1c81c4, #0b6dad);background-image:-ms-linear-gradient(top, #1c81c4, #0b6dad);background-image:-o-linear-gradient(top, #1c81c4, #0b6dad);background-image:linear-gradient(to bottom, #1c81c4, #0b6dad)}.cp.cpe1_old_apagar .dpt:hover>.actions_right,.cp.cpe1_old_apagar .dpt-selected .csform .dpt:hover>.actions_left{opacity:1}.cp.cpe1_old_apagar .dpt .bloco{display:block;clear:both}.cp.cpe1_old_apagar .dpt .bloco *:hover{color:#27AE60}.cp.cpe1_old_apagar .dpt .bloco .de{cursor:pointer}.cp.cpe1_old_apagar .dpt .articulacao{border-top:2px solid #e5e5e5;margin:2em 0}.cp.cpe1_old_apagar .dpt .bloco_alteracao{margin:1em 0;padding:0em;background-color:transparent;min-height:100px;border:2px dashed #fff}.cp.cpe1_old_apagar .dpt .bloco_alteracao:hover{border-color:#d9ddde}.cp.cpe1_old_apagar .dpt .bloco_alteracao.drag{width:100% !important;border-color:#d9ddde}.cp.cpe1_old_apagar .dpt .bloco_alteracao.drag .dpt{transition-duration:0s !important}.cp.cpe1_old_apagar .dpt .bloco_alteracao .dpt{width:100% !important;box-shadow:0 -1px 0 #e5e5e5,0 0 2px rgba(0,0,0,0.12),0 2px 4px rgba(0,0,0,0.24);padding:0.3em 1em;margin:0;background-color:#edf0f1;z-index:1}.cp.cpe1_old_apagar .dpt .bloco_alteracao .dpt:not(:first-child){border-top:1px solid white}.cp.cpe1_old_apagar .dpt .bloco_alteracao .dpt.ui-draggable div{cursor:pointer}.cp.cpe1_old_apagar .dpt .bloco_alteracao .dpt.dpt-comp-selected{transition:all 0.3s ease;width:auto !important;margin:2em -3.7em;box-shadow:0 0 6px rgba(0,0,0,0.16),0 6px 12px rgba(0,0,0,0.32)}.cp.cpe1_old_apagar .dpt-selected{font-size:1em;border:0px solid #CCC;margin:1em -1.8em 1em -1.8em;padding:2.2em 2.2em 1.6em 2.2em;box-shadow:-4px 15px 15px rgba(0,0,0,0.1),0px 6px 6px rgba(0,0,0,0.23);background-image:-webkit-linear-gradient(top, #eaeaee, #ddd);background-image:-moz-linear-gradient(top, #eaeaee, #ddd);background-image:-ms-linear-gradient(top, #eaeaee, #ddd);background-image:-o-linear-gradient(top, #eaeaee, #ddd);background-image:linear-gradient(to bottom, #eaeaee, #ddd)}.cp.cpe1_old_apagar .dpt-selected ul{list-style:none;margin:0;padding:0}.cp.cpe1_old_apagar .dpt-selected .semtexto{color:#999}.cp.cpe1_old_apagar .dpt-selected .bloco{opacity:0.5}.cp.cpe1_old_apagar .dpt-selected .bloco:hover{opacity:1}.cp.cpe1_old_apagar .dpt-selected .bloco a:hover{background:transparent}.cp.cpe1_old_apagar .dpt-selected>.bloco{opacity:1;margin:1em}.cp.cpe1_old_apagar .dpt-selected .bloco_alteracao{margin:0;padding:1em;border:0 transparent;background-image:-webkit-linear-gradient(top, #eaeaee, #ddd);background-image:-moz-linear-gradient(top, #eaeaee, #ddd);background-image:-ms-linear-gradient(top, #eaeaee, #ddd);background-image:-o-linear-gradient(top, #eaeaee, #ddd);background-image:linear-gradient(to bottom, #eaeaee, #ddd)}.cp.cpe1_old_apagar .dpt-selected .bloco_alteracao:hover{border-color:transparent}.cp.cpe1_old_apagar .dpt-selected .bloco_alteracao.drag{width:100% !important}.cp.cpe1_old_apagar .dpt-selected .bloco_alteracao.drag .dpt{transition-duration:0s !important}.cp.cpe1_old_apagar .dpt-selected .bloco_alteracao .dpt{width:auto !important;transition:all 0.3s ease;background-color:white}.cp.cpe1_old_apagar .dpt-selected .bloco_alteracao .dpt:not(:first-child){border-top:0px solid white}.cp.cpe1_old_apagar .dpt-selected>.dpt{padding:0}.cp.cpe1_old_apagar .dpt-selected>.dpt:last-child{padding-bottom:1em}.cp.cpe1_old_apagar .dpt-selected>.actions_right a.btn-bloco,.cp.cpe1_old_apagar .dpt-selected .csform .dpt-selected>.actions_left a.btn-bloco{display:none}.cp.cpe1_old_apagar .dpt-selected .csform{display:block;clear:both;z-index:9;position:static}.cp.cpe1_old_apagar .dpt-selected .csform .btns-action{-webkit-animation:fadeIn 1s ease-in-out;-moz-animation:fadeIn 1s ease-in-out;-o-animation:fadeIn 1s ease-in-out;opacity:1;position:absolute;display:table;transition:all 0.4s ease-in-out}.cp.cpe1_old_apagar .dpt-selected .csform .btns-action a{color:#16407c;display:block;background:transparent;vertical-align:middle;text-align:center;font-weight:normal;text-shadow:0 0 10px rgba(0,0,0,0.3);padding:0.33em 0.4em}.cp.cpe1_old_apagar .dpt-selected .csform .btns-action>li{position:relative;display:table-cell;vertical-align:top}.cp.cpe1_old_apagar .dpt-selected .csform .btns-action>li:hover{background-color:rgba(255,255,255,0.5)}.cp.cpe1_old_apagar .dpt-selected .csform .btns-action>li:hover>a{text-shadow:0 0 5px #777;color:#0a5}.cp.cpe1_old_apagar .dpt-selected .csform .label_status{position:absolute;bottom:0;right:0;color:#889;padding:0.3em;font-size:80%;text-align:right;z-index:15;display:table}.cp.cpe1_old_apagar .dpt-selected .csform .label_status li{display:table-cell;padding:0 0.5em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_parents{z-index:11;top:0em;left:0em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_parents a{padding:0.62em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_parents div,.cp.cpe1_old_apagar .dpt-selected .csform .actions_parents li{font-size:80%;display:table-cell;vertical-align:middle;border-right:1px solid #CCC}.cp.cpe1_old_apagar .dpt-selected .csform .actions_parents div{padding:0 0.4em;font-stretch:condensed;font-variant:small-caps;font-weight:bold;text-shadow:0 0 10px #fff}.cp.cpe1_old_apagar .dpt-selected .csform .actions_parents>li:hover a{color:#16407c;font-weight:normal}.cp.cpe1_old_apagar .dpt-selected .csform .actions_top,.cp.cpe1_old_apagar .dpt-selected .csform .actions_bottom{top:0em;right:0em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_top a,.cp.cpe1_old_apagar .dpt-selected .csform .actions_bottom a{padding-right:1em;padding-left:1em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_top li,.cp.cpe1_old_apagar .dpt-selected .csform .actions_bottom li{display:table-cell;vertical-align:middle;border-left:1px solid #CCC}.cp.cpe1_old_apagar .dpt-selected .csform .actions_bottom{top:auto;left:0;bottom:0;display:inline-block;border-top:1px solid #CCC}.cp.cpe1_old_apagar .dpt-selected .csform .actions_bottom a{padding:0 0.4em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_bottom li{border:0px;border-right:1px solid #CCC}.cp.cpe1_old_apagar .dpt-selected .csform .actions_right,.cp.cpe1_old_apagar .dpt-selected .csform .actions_left{top:2.2em;right:0em;bottom:0;display:block}.cp.cpe1_old_apagar .dpt-selected .csform .actions_right li,.cp.cpe1_old_apagar .dpt-selected .csform .actions_left li{width:2.2em;display:block;border-bottom:1px solid #CCC}.cp.cpe1_old_apagar .dpt-selected .csform .actions_right li:first-child,.cp.cpe1_old_apagar .dpt-selected .csform .actions_left li:first-child{border-top:1px solid #CCC}.cp.cpe1_old_apagar .dpt-selected .csform .actions_left{right:auto;left:0em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts{background:transparent;position:relative;z-index:19;display:table;width:100%}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li{display:table-cell}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li:hover>a{background-image:-webkit-linear-gradient(top, #1c81c4, #0b6dad);background-image:-moz-linear-gradient(top, #1c81c4, #0b6dad);background-image:-ms-linear-gradient(top, #1c81c4, #0b6dad);background-image:-o-linear-gradient(top, #1c81c4, #0b6dad);background-image:linear-gradient(to bottom, #1c81c4, #0b6dad)}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a{background-image:-webkit-linear-gradient(top, #3498DB, #2980C9);background-image:-moz-linear-gradient(top, #3498DB, #2980C9);background-image:-ms-linear-gradient(top, #3498DB, #2980C9);background-image:-o-linear-gradient(top, #3498DB, #2980C9);background-image:linear-gradient(to bottom, #3498DB, #2980C9);border-right:1px solid #fff;padding:0.2em;display:block;color:white;text-align:center;white-space:nowrap}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-excluir,.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar{text-align:left;background:#A70808;color:#c99;padding-left:1.7em;position:relative}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-excluir:hover,.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar:hover{background-color:#c70808;color:#ecc}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-excluir::before,.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar::before{z-index:20;position:absolute;background:url(/static/img/icon_delete_white.png) no-repeat 50% 50%;content:"";top:0;left:0;display:block;color:black;margin-left:0.4em;height:100%;width:2em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar{background:#1f8b4d;color:white}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar:hover{background:#2d9c5c;color:white}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar::before{background:url(/static/img/icon_save_white.png) no-repeat 50% 50%}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a span{padding:0 0.7em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li:last-child>a{border-right:0px solid #fff}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>ul li:nth-child(even) a{background:#3385CA}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>ul li a{border-right:1px solid #fff;display:block;color:white;background:#2980C9;font-size:80%;padding:0.23em 1em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>ul li a:hover{background:#0a5ea4}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.add_prior{table-layout:fixed}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.add_prior>ul{transform:translateY(30px);transition:transform 0.1s linear, opacity 0.1s linear, clip 0s 0.3s;clip:rect(0, 0, 0, 0);opacity:0;position:absolute;margin-left:0.5em;box-shadow:0px 6px 18px rgba(0,0,0,0.19),0px 2px 6px rgba(0,0,0,0.23);-webkit-transition-delay:0.4s;transition-delay:0.4s}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.add_prior>ul li a{border-right:0px !important}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.add_prior>ul li:first-child::before{border-width:0.375rem;border-style:inset inset solid;content:"";display:block;height:0px;width:0px;border-color:transparent transparent #3385CA;position:absolute;top:-0.71rem;left:0.9375rem}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.add_prior>ul li:first-child:hover::before{border-color:transparent transparent #0A5EA4}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.add_prior>ul::after{content:"";position:absolute;z-index:-1;left:0;top:rem-calc(-25px);height:rem-calc(25px);width:100%;transition:all 0.3s cubic-bezier(0.55, 0, 0.1, 1)}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.add_prior:hover>ul{transform:translateY(7px);transition:transform 0.4s linear, opacity 0.4s linear, clip 0s 0.2s;opacity:1;clip:rect(-100px, 2000px, 2000px, -100px)}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir{display:block;position:static}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul{transform:translateY(30px);transition:transform 0.1s linear, opacity 0.1s linear, clip 0s 0.3s;clip:rect(0, 0, 0, 0);opacity:0;position:absolute;margin-left:0.5em;box-shadow:0px 6px 18px rgba(0,0,0,0.19),0px 2px 6px rgba(0,0,0,0.23);-webkit-transition-delay:0.4s;transition-delay:0.4s}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li a{border-right:0px !important}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li:first-child::before{border-width:0.375rem;border-style:inset inset solid;content:"";display:block;height:0px;width:0px;border-color:transparent transparent #3385CA;position:absolute;top:-0.71rem;left:0.9375rem}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li:first-child:hover::before{border-color:transparent transparent #0A5EA4}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul::after{content:"";position:absolute;z-index:-1;left:0;top:rem-calc(-25px);height:rem-calc(25px);width:100%;transition:all 0.3s cubic-bezier(0.55, 0, 0.1, 1)}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir:hover>ul{transform:translateY(7px);transition:transform 0.4s linear, opacity 0.4s linear, clip 0s 0.2s;opacity:1;clip:rect(-100px, 2000px, 2000px, -100px)}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul{right:0.5em}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li a{background-color:#A70808}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li a:hover{background:#c70808}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li:first-child::before{border-color:transparent transparent #A70808;right:10%;left:auto}.cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li:first-child:hover::before{border-color:transparent transparent #c70808}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo{z-index:2000}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante>li>ul,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo>li>ul{transform:translateY(30px);transition:transform 0.1s linear, opacity 0.1s linear, clip 0s 0.3s;clip:rect(0, 0, 0, 0);opacity:0;position:absolute;margin-left:0.5em;box-shadow:0px 6px 18px rgba(0,0,0,0.19),0px 2px 6px rgba(0,0,0,0.23);-webkit-transition-delay:0.4s;transition-delay:0.4s}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante>li>ul li a,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo>li>ul li a{border-right:0px !important}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante>li>ul li:first-child::before,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo>li>ul li:first-child::before{border-width:0.375rem;border-style:inset inset solid;content:"";display:block;height:0px;width:0px;border-color:transparent transparent #3385CA;position:absolute;top:-0.71rem;left:0.9375rem}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante>li>ul li:first-child:hover::before,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo>li>ul li:first-child:hover::before{border-color:transparent transparent #0A5EA4}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante>li>ul::after,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo>li>ul::after{content:"";position:absolute;z-index:-1;left:0;top:rem-calc(-25px);height:rem-calc(25px);width:100%;transition:all 0.3s cubic-bezier(0.55, 0, 0.1, 1)}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante>li:hover>ul,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo>li:hover>ul{transform:translateY(7px);transition:transform 0.4s linear, opacity 0.4s linear, clip 0s 0.2s;opacity:1;clip:rect(-100px, 2000px, 2000px, -100px)}.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante>li.menu_excluir>ul li:first-child::before,.cp.cpe1_old_apagar .dpt-selected .csform .menu_flutuante_fixo>li.menu_excluir>ul li:first-child::before{right:auto;left:0.9375rem}.cp.cpe1_old_apagar .dpt-selected .csform textarea{margin:0;resize:vertical;min-height:12.6em;border:0px;font-size:120%;width:100%}.cp.cpe1_old_apagar .dpt-selected .csform textarea:focus{background:#fff}.cp.cpe1_old_apagar .dpt-selected .csform textarea::-webkit-input-placeholder{color:#c70808;opacity:0.6;font-size:80%}.cp.cpe1_old_apagar .dpt-selected .csform textarea:-moz-placeholder{color:#c70808}.cp.cpe1_old_apagar .dpt-selected .csform textarea::-moz-placeholder{color:#c70808}.cp.cpe1_old_apagar .dpt-selected .csform textarea:-ms-input-placeholder{color:#c70808;opacity:0.6}.cp.cpe1_old_apagar .selected{background-color:rgba(255,255,255,0.5)}.cp.cpe1_old_apagar .selected a:hover{color:#16407c !important;font-weight:normal !important}.result-busca-dispositivo,.lista-dispositivo{padding:0 0 1em;min-height:3em}.result-busca-dispositivo ul,.lista-dispositivo ul{list-style:none;margin:0;padding:1em 0 0;transition:all 2s linear;clear:both}.result-busca-dispositivo ul li,.lista-dispositivo ul li{display:table;border-collapse:separate;border-bottom:1px solid white;width:100%}.result-busca-dispositivo ul li.ta_title,.lista-dispositivo ul li.ta_title{background-color:rgba(0,0,0,0.15);border-radius:4px 4px 0 0;width:100%}.result-busca-dispositivo ul li.ta_title span,.lista-dispositivo ul li.ta_title span{padding:0.5em}.result-busca-dispositivo ul li:last-child .itemlabel,.lista-dispositivo ul li:last-child .itemlabel{border-radius:0 0 4px 0px;margin:0px}.result-busca-dispositivo ul li:last-child .iteminput,.lista-dispositivo ul li:last-child .iteminput{border-radius:0 0 0px 4px}.result-busca-dispositivo ul li .iteminput,.lista-dispositivo ul li .iteminput{background-color:rgba(0,0,0,0.1);border-right:1px solid white;display:table-cell;padding:0.5em;vertical-align:middle;text-align:center}.result-busca-dispositivo ul li .iteminput input,.lista-dispositivo ul li .iteminput input{margin:0}.result-busca-dispositivo ul li .itemlabel,.lista-dispositivo ul li .itemlabel{background-color:rgba(0,0,0,0.1);display:table-cell;padding:0.5em;vertical-align:middle;width:100%}.result-busca-dispositivo ul li .itemlabel label,.lista-dispositivo ul li .itemlabel label{line-height:1;font-family:"SourceSansPro", Helvetica, Arial, sans-serif;display:block;margin:0px}.result-busca-dispositivo ul li .itemlabel .artigo,.lista-dispositivo ul li .itemlabel .artigo{float:none}.result-busca-dispositivo .nomenclatura_heranca,.lista-dispositivo .nomenclatura_heranca{font-size:90%;color:#057dba;display:inline}.cp-nav-parents>.dropdown-menu{left:0;right:auto}.cp-nav-parents>.dropdown-menu::before{content:'';position:absolute;top:-11px;width:100%;height:11px}.cp-nav-parents:hover>.dropdown-menu{display:block}.table-notificacoes tbody tr td{border-top:1px solid white;padding:5px;vertical-align:middle}.table-notificacoes tbody tr td ul{margin:0px}.table-notificacoes tbody tr td ul li:hover{background-color:rgba(0,0,0,0.1)}.btn-modal-open{float:right}.class_color_container{background:#ddd !important}.clear{clear:both}.mce-tinymce.mce-container{border:1px solid #ccc !important;margin-right:2px}.mce-btn button:hover{background-color:rgba(0,0,0,0.1) !important;text-shadow:0 0 5px #fff;box-shadow:0 0 5px #777}.mce-menu{background:#eee !important}.displaynone{display:none !important}@media only screen and (max-width: 800px){.cp .fixed{z-index:98;position:relative}.cp.cpe1 .dpt-selected{margin:1em 0}.cp.cpe1 .dpt-selected .csform .actions_parents,.cp.cpe1 .dpt-selected .csform .label_status{font-size:80%;position:static !important;display:block !important;padding:0em;height:auto !important;left:0;right:auto;text-align:left}.cp.cpe1 .dpt-selected .csform .actions_parents div,.cp.cpe1 .dpt-selected .csform .actions_parents li,.cp.cpe1 .dpt-selected .csform .label_status div,.cp.cpe1 .dpt-selected .csform .label_status li{display:inline-block !important}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>ul{transform:translateY(30px);transition:transform 0.1s linear, opacity 0.1s linear, clip 0s 0.3s;clip:rect(0, 0, 0, 0);opacity:0;position:absolute;margin-left:0.5em;box-shadow:0px 6px 18px rgba(0,0,0,0.19),0px 2px 6px rgba(0,0,0,0.23);-webkit-transition-delay:0.4s;transition-delay:0.4s}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>ul li a{border-right:0px !important}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>ul li:first-child::before{border-width:0.375rem;border-style:inset inset solid;content:"";display:block;height:0px;width:0px;border-color:transparent transparent #3385CA;position:absolute;top:-0.71rem;left:0.9375rem}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>ul li:first-child:hover::before{border-color:transparent transparent #0A5EA4}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>ul::after{content:"";position:absolute;z-index:-1;left:0;top:rem-calc(-25px);height:rem-calc(25px);width:100%;transition:all 0.3s cubic-bezier(0.55, 0, 0.1, 1)}.cp.cpe1 .dpt-selected .csform .actions_inserts>li:hover>ul{transform:translateY(7px);transition:transform 0.4s linear, opacity 0.4s linear, clip 0s 0.2s;opacity:1;clip:rect(-100px, 2000px, 2000px, -100px)}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>a span{display:none}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>a.btn-excluir,.cp.cpe1 .cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar,.cp.cpe1_old_apagar .cp.cpe1 .dpt-selected .csform .actions_inserts>li>a.btn-salvar,.cp.cpe1 .dpt-selected .csform .actions_inserts>li>a.btn-salvar{padding-left:0;min-width:1em}.cp.cpe1 .dpt-selected .csform .actions_inserts>li>a.btn-excluir::before,.cp.cpe1 .cp.cpe1_old_apagar .dpt-selected .csform .actions_inserts>li>a.btn-salvar::before,.cp.cpe1_old_apagar .cp.cpe1 .dpt-selected .csform .actions_inserts>li>a.btn-salvar::before,.cp.cpe1 .dpt-selected .csform .actions_inserts>li>a.btn-salvar::before{width:100%;margin:0}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_in,.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_next,.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_prior{position:static}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_in>ul{left:1em !important;right:1em !important;margin-left:0}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_in>ul li:first-child::before{left:37%}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_next>ul{left:0 !important;right:1em !important}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_prior>ul{left:1em !important;right:0 !important;margin-left:0;margin-right:0.5em}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.add_prior>ul li:first-child::before{right:42%;left:auto}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.menu_excluir>ul{left:10% !important;right:0 !important;margin-left:0;margin-right:0.5em}.cp.cpe1 .dpt-selected .csform .actions_inserts>li.menu_excluir>ul li:first-child::before{right:0;left:auto}}@media print{.cp .vigencias,.toggle-topbar,.menu-icon,.button,.tipo-vigencias,.dne{display:none}#btn_font_menos,#btn_font_mais{display:none}.container{width:100%}} diff --git a/sapl/static/styles/style_tinymce.css b/sapl/static/styles/style_tinymce.css deleted file mode 100644 index d2909b025..000000000 --- a/sapl/static/styles/style_tinymce.css +++ /dev/null @@ -1,8 +0,0 @@ -.mce-content-body { - font-family: "Open Sans" "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; - font-style: normal; - font-weight: normal; - line-height: 1.5; - font-size: 1em; - color: #444444; -} \ No newline at end of file From 0b4aa5d448efe804fbaba41a2434e3880086af02 Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Fri, 5 May 2017 11:09:24 -0300 Subject: [PATCH 116/140] =?UTF-8?q?Coloca=20permiss=C3=A3o=20na=20mudan?= =?UTF-8?q?=C3=A7a=20dinamica=20de=20ordena=C3=A7=C3=A3o=20de=20mat=C3=A9r?= =?UTF-8?q?ias?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/sessao/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 3bcba074e..47f887c7b 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -2462,12 +2462,13 @@ class AdicionarVariasMateriasOrdemDia(AdicionarVariasMateriasExpediente): @csrf_exempt +@permission_required('sessao.change_expedientemateria', + 'sessao.change_ordemdia') def mudar_ordem_materia_sessao(request): # Pega os dados vindos da requisição posicao_inicial = int(request.POST['pos_ini']) + 1 posicao_final = int(request.POST['pos_fim']) + 1 pk_sessao = int(request.POST['pk_sessao']) - pk_list = request.POST.getlist('pk_list[]') materia = request.POST['materia'] From 7c2907caab2bb59473edd5cb285e3725d2a45f4e Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Fri, 5 May 2017 13:08:46 -0300 Subject: [PATCH 117/140] =?UTF-8?q?HOT-FIX:=20conserta=20nome=20de=20vari?= =?UTF-8?q?=C3=A1vel=20errada.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/sessao/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 47f887c7b..852444752 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -2019,7 +2019,7 @@ class VotacaoExpedienteEditView(SessaoPermissionMixin): expediente_id=expediente_id).last() votacao_existente = {'observacao': sub( ' ', ' ', strip_tags(votacao.observacao)), - 'resultado': votacao.tipo_resultado.nome, + 'resultado': votacao.tipo_resultado_votacao.nome, 'tipo_resultado': votacao.tipo_resultado_votacao_id} context.update({'votacao_titulo': titulo, From 1a400d9ca7d0385550b88d7986524cfeb3fddf4f Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Fri, 5 May 2017 14:03:45 -0300 Subject: [PATCH 118/140] Fix bug in bower install --- Dockerfile | 4 +++- requirements/requirements.txt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 64208fe1b..59bee177e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,9 @@ RUN pip install -r /var/interlegis/sapl/requirements/requirements.txt --upgrade COPY config/env_dockerfile /var/interlegis/sapl/sapl/.env -RUN python3 manage.py bower install -- --allow-root && \ +# manage.py bower install bug: https://github.com/nvbn/django-bower/issues/51 + +RUN python3 manage.py bower_install -- --allow-root --no-input && \ python3 manage.py collectstatic --no-input && \ rm -rf /var/interlegis/sapl/sapl/.env && \ rm -rf /var/interlegis/sapl/sapl.db diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 6d7592cda..7fd7dbd80 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -15,7 +15,7 @@ django-extra-views==0.8.0 django-filter==0.15.3 django-floppyforms==1.6.2 django-model-utils==2.5 -django-sass-processor==0.4.6 +django-sass-processor==0.5.3 djangorestframework drfdocs easy-thumbnails==2.3 From 9b40b34dd56591536818bb002be67de0a873b586 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Fri, 5 May 2017 14:20:44 -0300 Subject: [PATCH 119/140] Pick from sapl latest --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index cd899e6c4..50bdf6512 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ sapldb: ports: - "5532:5432" sapl: - build: . + image: interlegis/sapl:latest volumes: - sapl_data:/var/interlegis/sapl/data - sapl_media:/var/interlegis/sapl/media From ce0d0ff6e9232011c7f191d928dd324e0421e6fa Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Mon, 8 May 2017 15:56:22 -0300 Subject: [PATCH 120/140] Muda jeito e pegar ultimo valor do model Signed-off-by: Luciano Almeida --- sapl/legacy/migration.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sapl/legacy/migration.py b/sapl/legacy/migration.py index 6ab3cd184..0d2f5be10 100644 --- a/sapl/legacy/migration.py +++ b/sapl/legacy/migration.py @@ -130,9 +130,7 @@ def get_fk_related(field, value, label=None): if not field.null: fields_dict = get_fields_dict(field.related_model) # Cria stub ao final da tabela para evitar erros - pk = 1 - if hasattr(field.related_model.objects.last(), 'pk'): - pk = field.related_model.objects.last().pk + pk = get_last_value(field.related_model) with reversion.create_revision(): reversion.set_comment('Stub criado pela migração') value = mommy.make( From 30b61d9f84cd6ea651e56a69ae8cb54bb9b01a30 Mon Sep 17 00:00:00 2001 From: Luciano Almeida Date: Mon, 8 May 2017 16:01:44 -0300 Subject: [PATCH 121/140] Adiciona colunas no script sql Signed-off-by: Luciano Almeida --- sapl/legacy/scripts/fix_tables.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sapl/legacy/scripts/fix_tables.sql b/sapl/legacy/scripts/fix_tables.sql index 479a2ed5e..ed93373b1 100644 --- a/sapl/legacy/scripts/fix_tables.sql +++ b/sapl/legacy/scripts/fix_tables.sql @@ -2,15 +2,19 @@ SELECT REPLACE(@@sql_mode,'STRICT_TRANS_TABLES,',''); -- Exclui procedures caso já existam DROP PROCEDURE IF EXISTS verifica_campos_proposicao; +DROP PROCEDURE IF EXISTS verifica_campos_tipo_materia_legislativa; DROP PROCEDURE IF EXISTS verifica_campos_sessao_plenaria_presenca; DROP PROCEDURE IF EXISTS cria_lexml_registro_provedor_e_publicador; -- Procedure para criar campo num_proposicao em proposicao CREATE PROCEDURE verifica_campos_proposicao() BEGIN IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='proposicao' AND column_name='num_proposicao') THEN ALTER TABLE proposicao ADD COLUMN num_proposicao INT(11) NULL after txt_justif_devolucao; END IF; END; +-- Procedure para criar campo iind_num_automatica em tipo_materia_legislativa +CREATE PROCEDURE verifica_campos_tipo_materia_legislativa() BEGIN IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='tipo_materia_legislativa' AND column_name='ind_num_automatica') THEN ALTER TABLE tipo_materia_legislativa ADD COLUMN ind_num_automatica BOOLEAN NULL DEFAULT FALSE after des_tipo_materia; END IF; IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='tipo_materia_legislativa' AND column_name='quorum_minimo_votacao') THEN ALTER TABLE tipo_materia_legislativa ADD COLUMN quorum_minimo_votacao INT(11) NULL after ind_num_automatica; END IF; END; -- Procedure para criar campos cod_presenca_sessao (sendo a nova PK da tabela) e dat_sessao em sessao_plenaria_presenca CREATE PROCEDURE verifica_campos_sessao_plenaria_presenca() BEGIN IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='sessao_plenaria_presenca' AND column_name='cod_presenca_sessao') THEN ALTER TABLE sessao_plenaria_presenca DROP PRIMARY KEY, ADD cod_presenca_sessao INT AUTO_INCREMENT PRIMARY KEY FIRST; END IF; IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='sessao_plenaria_presenca' AND column_name='dat_sessao') THEN ALTER TABLE sessao_plenaria_presenca ADD COLUMN dat_sessao DATE NULL after cod_parlamentar; END IF; END; -- Procedure para criar tabela lexml_registro_provedor e lexml_registro_publicador CREATE PROCEDURE cria_lexml_registro_provedor_e_publicador() BEGIN IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='lexml_registro_publicador') THEN CREATE TABLE lexml_registro_publicador (cod_publicador INT AUTO_INCREMENT NOT NULL, id_publicador INT, nom_publicador VARCHAR(255), adm_email VARCHAR(50), sigla VARCHAR(255), nom_responsavel VARCHAR(255), tipo VARCHAR(50), id_responsavel INT, PRIMARY KEY (cod_publicador)); END IF; IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='lexml_registro_provedor') THEN CREATE TABLE lexml_registro_provedor (cod_provedor INT AUTO_INCREMENT NOT NULL, id_provedor INT, nom_provedor VARCHAR(255), sgl_provedor VARCHAR(15), adm_email VARCHAR(50), nom_responsavel VARCHAR(255), tipo VARCHAR(50), id_responsavel INT, xml_provedor LONGTEXT, PRIMARY KEY (cod_provedor)); END IF; END; -- Executa as procedures criadas acima CALL verifica_campos_proposicao; +CALL verifica_campos_tipo_materia_legislativa; CALL verifica_campos_sessao_plenaria_presenca; CALL cria_lexml_registro_provedor_e_publicador; From ef4441d4e394e4a8946f1f6a256e202567259491 Mon Sep 17 00:00:00 2001 From: eduardocalil Date: Tue, 9 May 2017 12:53:36 -0300 Subject: [PATCH 122/140] Fix #1056 (#1059) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix #1056 * Retira try-except desnecessário --- sapl/parlamentares/views.py | 43 +++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/sapl/parlamentares/views.py b/sapl/parlamentares/views.py index d703e1c2c..afbe80ed0 100644 --- a/sapl/parlamentares/views.py +++ b/sapl/parlamentares/views.py @@ -1,7 +1,7 @@ from django.contrib import messages -from django.core.exceptions import ObjectDoesNotExist +from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.core.urlresolvers import reverse, reverse_lazy -from django.db.models import F +from django.db.models import F, Q from django.http.response import HttpResponseRedirect from django.utils.datastructures import MultiValueDictKeyError from django.utils.translation import ugettext_lazy as _ @@ -344,8 +344,47 @@ class ParlamentarCrud(Crud): # Tira Link do avatar_html e coloca no nome for row in context['rows']: + # Coloca a filiação atual ao invés da última + if row[0][1]: + # Pega o Parlamentar por meio da pk + parlamentar = Parlamentar.objects.get( + id=(row[0][1].split('/')[-1])) + + # Pega a Legislatura + legislatura = Legislatura.objects.get( + id=context['legislatura_id']) + + # As condições para mostrar a filiação são: + # A data de filiacao deve ser menor que a data de fim + # da legislatura e data de desfiliação deve nula, ou maior, + # ou igual a data de fim da legislatura + try: + filiacao = parlamentar.filiacao_set.get(Q( + data__lte=legislatura.data_fim, + data_desfiliacao__gte=legislatura.data_fim) | Q( + data__lte=legislatura.data_fim, + data_desfiliacao__isnull=True)) + + # Caso não exista filiação com essas condições + except ObjectDoesNotExist: + row[2] = ('Não possui filiação', None) + + # Caso exista mais de uma filiação nesse intervalo + # Entretanto, NÃO DEVE OCORRER + except MultipleObjectsReturned: + filiacao = parlamentar.filiacao_set.filter(Q( + data__lte=legislatura.data_fim, + data_desfiliacao__gte=legislatura.data_fim) | Q( + data__lte=legislatura.data_fim, + data_desfiliacao__isnull=True)).last() + + # Caso encontre UMA filiação nessas condições + else: + row[2] = (filiacao.partido.sigla, None) + row[1] = (row[1][0], row[0][1]) row[0] = (row[0][0], None) + return context From a7ed403bc08729de84c55ef4585b404d0752f045 Mon Sep 17 00:00:00 2001 From: eduardocalil Date: Tue, 9 May 2017 12:54:20 -0300 Subject: [PATCH 123/140] Fix #1012 bug mesa diretora (#1022) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Inicia o bug fix * Refatora funcionalidades de inserção e remoção * Lança os possíveis erros para o usuário na tela * Otimiza o codigo --- sapl/parlamentares/urls.py | 17 +- sapl/parlamentares/views.py | 235 ++++++----- sapl/static/js/app.js | 17 + .../parlamentares/composicaomesa_form.html | 371 ++++++++++++++---- 4 files changed, 463 insertions(+), 177 deletions(-) diff --git a/sapl/parlamentares/urls.py b/sapl/parlamentares/urls.py index 1d9885053..29a31adfb 100644 --- a/sapl/parlamentares/urls.py +++ b/sapl/parlamentares/urls.py @@ -1,14 +1,18 @@ from django.conf.urls import include, url -from sapl.parlamentares.views import (CargoMesaCrud, ColigacaoCrud, +from sapl.parlamentares.views import (altera_field_mesa, + CargoMesaCrud, ColigacaoCrud, ComposicaoColigacaoCrud, DependenteCrud, FiliacaoCrud, FrenteCrud, FrenteList, - LegislaturaCrud, MandatoCrud, + LegislaturaCrud, + insere_parlamentar_composicao, + MandatoCrud, MesaDiretoraView, NivelInstrucaoCrud, ParlamentarCrud, ParticipacaoParlamentarCrud, PartidoCrud, ProposicaoParlamentarCrud, RelatoriaParlamentarCrud, + remove_parlamentar_composicao, SessaoLegislativaCrud, TipoAfastamentoCrud, TipoDependenteCrud, TipoMilitarCrud, VotanteView) @@ -51,4 +55,13 @@ urlpatterns = [ url(r'^mesa-diretora/$', MesaDiretoraView.as_view(), name='mesa_diretora'), + + url(r'^mesa-diretora/altera-field-mesa/$', + altera_field_mesa, name='altera_field_mesa'), + + url(r'^mesa-diretora/insere-parlamentar-composicao/$', + insere_parlamentar_composicao, name='insere_parlamentar_composicao'), + + url(r'^mesa-diretora/remove-parlamentar-composicao/$', + remove_parlamentar_composicao, name='remove_parlamentar_composicao'), ] diff --git a/sapl/parlamentares/views.py b/sapl/parlamentares/views.py index afbe80ed0..3c6ac630a 100644 --- a/sapl/parlamentares/views.py +++ b/sapl/parlamentares/views.py @@ -2,6 +2,7 @@ from django.contrib import messages from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.core.urlresolvers import reverse, reverse_lazy from django.db.models import F, Q +from django.http import JsonResponse from django.http.response import HttpResponseRedirect from django.utils.datastructures import MultiValueDictKeyError from django.utils.translation import ugettext_lazy as _ @@ -434,6 +435,11 @@ class MesaDiretoraView(FormView): [p.parlamentar for p in parlamentares]) - set( parlamentares_ocupados)) + # Se todos os cargos estiverem ocupados, a listagem de parlamentares + # deve ser renderizada vazia + if not cargos_vagos: + parlamentares_vagos = [] + return self.render_to_response( {'legislaturas': Legislatura.objects.all( ).order_by('-numero'), @@ -447,107 +453,138 @@ class MesaDiretoraView(FormView): 'cargos_vagos': cargos_vagos }) - def existe_membro_mesa(self, sessao_plenaria, cargo): - return ComposicaoMesa.objects.filter( - sessao_legislativa_id=sessao_plenaria.id, - # parlamentar_id = integrante.parlamentar_id, - cargo_id=cargo.id - ).exists() - - def post(self, request, *args, **kwargs): - - if (not Legislatura.objects.exists() or - not SessaoLegislativa.objects.exists()): - return self.validation(request) - - if 'Incluir' in request.POST and request.user.has_perm( - '%s.add_%s' % ( - AppConfig.label, ComposicaoMesa._meta.model_name)): - - composicao = ComposicaoMesa() - - try: - composicao.sessao_legislativa = SessaoLegislativa.objects.get( - id=int(request.POST['sessao'])) - except MultiValueDictKeyError: - messages.error(request, _( - 'Nenhuma sessão foi inserida!')) - return self.get(request) - - try: - composicao.parlamentar = Parlamentar.objects.get( - id=int(request.POST['parlamentar'])) - except MultiValueDictKeyError: - messages.error(request, _( - 'Nenhum parlamentar foi inserido!')) - return self.get(request) - try: - composicao.cargo = CargoMesa.objects.get( - id=int(request.POST['cargo'])) - if self.existe_membro_mesa(composicao.sessao_legislativa, - composicao.cargo): - messages.error(request, _('Parlamentar já inserido!')) - return self.get(request) - - composicao.save() - except MultiValueDictKeyError: - messages.error(request, _( - 'Nenhum cargo foi inserido!')) - return self.get(request) - - messages.success(request, _( - 'Parlamentar adicionado com sucesso!')) - - elif 'Excluir' in request.POST and request.user.has_perm( - '%s.delete_%s' % ( - AppConfig.label, ComposicaoMesa._meta.model_name)): +def altera_field_mesa(request): + """ + Essa função lida com qualquer alteração nos campos + da Mesa Diretora, após qualquer + operação (Legislatura/Sessão/Inclusão/Remoção), + atualizando os campos após cada alteração + """ + + legislatura = request.GET['legislatura'] + sessoes = SessaoLegislativa.objects.filter( + legislatura=legislatura).order_by('-data_inicio') + + if not sessoes: + return JsonResponse({'msg': ('Nenhuma sessão encontrada!', 0)}) + + # Verifica se já tem uma sessão selecionada. Ocorre quando + # é alterado o campo de sessão ou feita alguma operação + # de inclusão/remoção. + if request.GET['sessao']: + sessao_selecionada = request.GET['sessao'] + # Caso a mudança tenha sido no campo legislatura, a sessão + # atual deve ser a primeira daquela legislatura + else: + sessao_selecionada = SessaoLegislativa.objects.filter( + legislatura=legislatura).order_by( + '-data_inicio').first().id + + # Atualiza os componentes da view após a mudança + composicao_mesa = ComposicaoMesa.objects.filter( + sessao_legislativa=sessao_selecionada) + + cargos_ocupados = [m.cargo for m in composicao_mesa] + cargos = CargoMesa.objects.all() + cargos_vagos = list(set(cargos) - set(cargos_ocupados)) + + parlamentares = Legislatura.objects.get( + id=legislatura).mandato_set.all() + parlamentares_ocupados = [m.parlamentar for m in composicao_mesa] + parlamentares_vagos = list( + set( + [p.parlamentar for p in parlamentares]) - set( + parlamentares_ocupados)) + + lista_sessoes = [(s.id, s.__str__()) for s in sessoes] + lista_composicao = [(c.id, c.parlamentar.__str__(), + c.cargo.__str__()) for c in composicao_mesa] + lista_parlamentares = [( + p.id, p.__str__()) for p in parlamentares_vagos] + lista_cargos = [(c.id, c.__str__()) for c in cargos_vagos] + + return JsonResponse( + {'lista_sessoes': lista_sessoes, + 'lista_composicao': lista_composicao, + 'lista_parlamentares': lista_parlamentares, + 'lista_cargos': lista_cargos, + 'sessao_selecionada': sessao_selecionada, + 'msg': ('', 1)}) + + +def insere_parlamentar_composicao(request): + """ + Essa função lida com qualquer operação de inserção + na composição da Mesa Diretora + """ + + if request.user.has_perm( + '%s.add_%s' % ( + AppConfig.label, ComposicaoMesa._meta.model_name)): + + composicao = ComposicaoMesa() + + try: + composicao.sessao_legislativa = SessaoLegislativa.objects.get( + id=int(request.POST['sessao'])) + except MultiValueDictKeyError: + return JsonResponse({'msg': ('Nenhuma sessão foi inserida!', 0)}) + + try: + composicao.parlamentar = Parlamentar.objects.get( + id=int(request.POST['parlamentar'])) + except MultiValueDictKeyError: + return JsonResponse({ + 'msg': ('Nenhum parlamentar foi inserido!', 0)}) + + try: + composicao.cargo = CargoMesa.objects.get( + id=int(request.POST['cargo'])) + parlamentar_ja_inserido = ComposicaoMesa.objects.filter( + sessao_legislativa_id=composicao.sessao_legislativa.id, + cargo_id=composicao.cargo.id).exists() + + if parlamentar_ja_inserido: + return JsonResponse({'msg': ('Parlamentar já inserido!', 0)}) + + composicao.save() + + except MultiValueDictKeyError: + return JsonResponse({'msg': ('Nenhum cargo foi inserido!', 0)}) + + return JsonResponse({'msg': ('Parlamentar inserido com sucesso!', 1)}) + + else: + return JsonResponse( + {'msg': ('Você não tem permissão para esta operação!', 0)}) + + +def remove_parlamentar_composicao(request): + """ + Essa função lida com qualquer operação de remoção + na composição da Mesa Diretora + """ + + if request.POST and request.user.has_perm( + '%s.delete_%s' % ( + AppConfig.label, ComposicaoMesa._meta.model_name)): if 'composicao_mesa' in request.POST: - ids = request.POST['composicao_mesa'].split(':') - composicao = ComposicaoMesa.objects.get( - sessao_legislativa_id=int(request.POST['sessao']), - parlamentar_id=int(ids[0]), - cargo_id=int(ids[1]) - ) - composicao.delete() - messages.success(request, _( - 'Parlamentar excluido com sucesso!')) - else: - messages.error(request, _( - 'Selecione um parlamentar para ser excluido!')) - - mesa = ComposicaoMesa.objects.filter( - sessao_legislativa=request.POST['sessao']) - - cargos_ocupados = [m.cargo for m in mesa] - cargos = CargoMesa.objects.all() - cargos_vagos = list(set(cargos) - set(cargos_ocupados)) - - parlamentares = Legislatura.objects.get( - id=int(request.POST['legislatura'])).mandato_set.all() - parlamentares_ocupados = [m.parlamentar for m in mesa] - parlamentares_vagos = list( - set( - [p.parlamentar for p in parlamentares]) - set( - parlamentares_ocupados)) - - sessao_sel = SessaoLegislativa.objects.get( - id=int(request.POST['sessao'])) + try: + composicao = ComposicaoMesa.objects.get( + id=request.POST['composicao_mesa']) + except ObjectDoesNotExist: + return JsonResponse( + {'msg': ( + 'Composição da Mesa não pôde ser removida!', 0)}) - if str(sessao_sel.legislatura_id) != request.POST['legislatura']: - sessao_sel = SessaoLegislativa.objects.filter( - legislatura=Legislatura.objects.first()).first() + composicao.delete() - return self.render_to_response( - {'legislaturas': Legislatura.objects.all( - ).order_by('-numero'), - 'legislatura_selecionada': Legislatura.objects.get( - id=int(request.POST['legislatura'])), - 'sessoes': SessaoLegislativa.objects.filter( - legislatura_id=int(request.POST['legislatura'])), - 'sessao_selecionada': sessao_sel, - 'composicao_mesa': mesa, - 'parlamentares': parlamentares_vagos, - 'cargos_vagos': cargos_vagos - }) + return JsonResponse( + {'msg': ( + 'Parlamentar excluido com sucesso!', 1)}) + else: + return JsonResponse( + {'msg': ( + 'Selecione algum parlamentar para ser excluido!', 0)}) diff --git a/sapl/static/js/app.js b/sapl/static/js/app.js index d96090f5e..bbb54171a 100644 --- a/sapl/static/js/app.js +++ b/sapl/static/js/app.js @@ -217,3 +217,20 @@ $(document).ready(function(){ OptionalCustomFrontEnd(); }); + + +function getCookie(name) { + var cookieValue = null; + if (document.cookie && document.cookie !== '') { + var cookies = document.cookie.split(';'); + for (var i = 0; i < cookies.length; i++) { + var cookie = jQuery.trim(cookies[i]); + // Does this cookie string begin with the name we want? + if (cookie.substring(0, name.length + 1) === (name + '=')) { + cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); + break; + } + } + } + return cookieValue; +} \ No newline at end of file diff --git a/sapl/templates/parlamentares/composicaomesa_form.html b/sapl/templates/parlamentares/composicaomesa_form.html index af261facc..855313442 100644 --- a/sapl/templates/parlamentares/composicaomesa_form.html +++ b/sapl/templates/parlamentares/composicaomesa_form.html @@ -8,82 +8,301 @@ {{legislatura_selecionada}} não possui nenhuma Sessão Legislativa cadastrada.
    Clique aqui para cadastrar uma nova.
    + {% else %} -
    - {% csrf_token %} -
    - Escolha da Legislatura e da Sessão Legislativa -
    -
    - - -
    -
    - - -
    -
    -
    -
    -
    - Escolha da Composição da Mesa Diretora -
    -
    - - -
    - -
    -

    - {% if cargos_vagos %} - {% if perms.parlamentares.add_cargomesa %} - - {% endif %} - {% endif %} -
    -
    - {% if perms.parlamentares.add_composicaomesa %} - - {% endif %} -
    - - {% if cargos_vagos %} -
    - - -
    - -
    - {% endif %} - -
    -
    -
    + + + + +
    + Escolha da Legislatura e da Sessão Legislativa +
    +
    + + +
    +
    + + +
    +
    +
    +
    +
    + Escolha da Composição da Mesa Diretora +
    +
    + + +
    + +
    +

    + {% if perms.parlamentares.add_cargomesa %} + + {% endif %} +
    +
    + {% if perms.parlamentares.add_composicaomesa %} + + {% endif %} +
    + +
    + + +
    + +
    + +
    +
    {% endif %} {% endblock detail_content %} + + +{% block extra_js %} + + + +{% endblock %} From b9d72aa0a2a4c77e304e02c0f2ea521f3cba5d0f Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 9 May 2017 14:04:55 -0300 Subject: [PATCH 124/140] Fix #1066 --- sapl/sessao/urls.py | 4 ++ sapl/sessao/views.py | 60 ++++++++++++++++++- .../sessao/votacao/nominal_detail.html | 54 +++++++++++++++++ 3 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 sapl/templates/sessao/votacao/nominal_detail.html diff --git a/sapl/sessao/urls.py b/sapl/sessao/urls.py index e06376fd6..f237bf721 100644 --- a/sapl/sessao/urls.py +++ b/sapl/sessao/urls.py @@ -16,6 +16,7 @@ from sapl.sessao.views import (AdicionarVariasMateriasExpediente, VotacaoEditView, VotacaoExpedienteEditView, VotacaoExpedienteView, VotacaoNominalEditView, VotacaoNominalExpedienteEditView, + VotacaoNominalExpedienteDetailView, VotacaoNominalExpedienteView, VotacaoNominalView, VotacaoView, abrir_votacao_expediente_view, @@ -120,6 +121,9 @@ urlpatterns = [ url(r'^sessao/(?P\d+)/matexp/votnom/edit/(?P\d+)/(?P\d+)$', VotacaoNominalExpedienteEditView.as_view(), name='votacaonominalexpedit'), + url(r'^sessao/(?P\d+)/matexp/votnom/detail/(?P\d+)/(?P\d+)$', + VotacaoNominalExpedienteDetailView.as_view(), + name='votacaonominalexpdetail'), url(r'^sessao/(?P\d+)/matexp/votsimb/(?P\d+)/(?P\d+)$', VotacaoExpedienteView.as_view(), name='votacaosimbolicaexp'), url(r'^sessao/(?P\d+)/matexp/votsec/view/(?P\d+)/(?P\d+)$', diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 852444752..a4dc33b48 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -354,9 +354,20 @@ class ExpedienteMateriaCrud(MasterDetailCrud): resultado_descricao, resultado_observacao)) else: - obj.resultado = ('%s
    %s' % - (resultado_descricao, + if obj.tipo_votacao == 2: + url = reverse('sapl.sessao:votacaonominalexpdetail', + kwargs={ + 'pk': obj.sessao_plenaria_id, + 'oid': obj.materia_id, + 'mid': obj.pk}) + obj.resultado = ('%s
    %s' % + (url, + resultado_descricao, resultado_observacao)) + else: + obj.resultado = ('%s
    %s' % + (resultado_descricao, + resultado_observacao)) return [self._as_row(obj) for obj in object_list] class CreateView(MasterDetailCrud.CreateView): @@ -1847,6 +1858,51 @@ class VotacaoNominalExpedienteEditView(SessaoPermissionMixin): return reverse('sapl.sessao:expedientemateria_list', kwargs={'pk': pk}) +class VotacaoNominalExpedienteDetailView(DetailView): + template_name = 'sessao/votacao/nominal_detail.html' + + def get(self, request, *args, **kwargs): + context = {} + materia_id = kwargs['oid'] + expediente_id = kwargs['mid'] + + votacao = RegistroVotacao.objects.get( + materia_id=materia_id, + expediente_id=expediente_id) + expediente = ExpedienteMateria.objects.get(id=expediente_id) + votos = VotoParlamentar.objects.filter(votacao_id=votacao.id) + + list_votos = [] + for v in votos: + parlamentar = Parlamentar.objects.get(id=v.parlamentar_id) + list_votos.append({'parlamentar': parlamentar, 'voto': v.voto}) + + context.update({'votos': list_votos}) + + materia = {'materia': expediente.materia, + 'ementa': sub( + ' ', ' ', strip_tags(expediente.observacao))} + context.update({'materia': materia}) + + votacao_existente = {'observacao': sub( + ' ', ' ', strip_tags(votacao.observacao)), + 'resultado': votacao.tipo_resultado_votacao.nome, + 'tipo_resultado': + votacao.tipo_resultado_votacao_id} + context.update({'votacao': votacao_existente, + 'tipos': self.get_tipos_votacao()}) + + return self.render_to_response(context) + + def get_tipos_votacao(self): + for tipo in TipoResultadoVotacao.objects.all(): + yield tipo + + def get_success_url(self): + pk = self.kwargs['pk'] + return reverse('sapl.sessao:expedientemateria_list', + kwargs={'pk': pk}) + class VotacaoExpedienteView(SessaoPermissionMixin): diff --git a/sapl/templates/sessao/votacao/nominal_detail.html b/sapl/templates/sessao/votacao/nominal_detail.html new file mode 100644 index 000000000..e27fd3c53 --- /dev/null +++ b/sapl/templates/sessao/votacao/nominal_detail.html @@ -0,0 +1,54 @@ +{% extends "crud/detail.html" %} +{% load i18n %} + +{% block detail_content %} +
    + {% csrf_token %} + +
    + Votação Nominal +
    + Matéria: {{materia.materia|safe}} +
    + Ementa: {{materia.ementa|safe}} +
    + +
    +
    + Votos +
    + {% for v in votos %} +
    {{v.parlamentar}}
    +
    {{v.voto}}
    + {% endfor %} +
    +
    +
    +
    +
    +
    + Resultado da Votação: + {% for tipo in tipos %} + {% if votacao.tipo_resultado == tipo.id %} + {{ tipo.nome }} + {% endif %} + {% endfor %} +
    +
    + +
    +
    +
    + Observações + +
    +
    +
    +
    +{% endblock detail_content %} + +{% block foot_js %} + +{% endblock %} From 8287c1428000da3efb88965ec24a25bb04ddd878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Tue, 9 May 2017 15:16:12 -0300 Subject: [PATCH 125/140] =?UTF-8?q?Ajusta=20t=C3=ADtulo=20(#1070)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/interlegis/sapl/issues/1065 --- sapl/norma/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapl/norma/models.py b/sapl/norma/models.py index d91ee2da2..0d0b8ce6b 100644 --- a/sapl/norma/models.py +++ b/sapl/norma/models.py @@ -18,8 +18,8 @@ class AssuntoNorma(models.Model): max_length=250, blank=True, verbose_name=_('Descrição')) class Meta: - verbose_name = _('Assunto de Norma') - verbose_name_plural = _('Assuntos de Norma') + verbose_name = _('Assunto de Norma Jurídica') + verbose_name_plural = _('Assuntos de Normas Jurídicas') def __str__(self): return self.assunto From 9143bd345732695b739a1380ee40b2e296646a01 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 9 May 2017 17:24:41 -0300 Subject: [PATCH 126/140] Reverte de volta para bower install --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 59bee177e..2b12ece18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ COPY config/env_dockerfile /var/interlegis/sapl/sapl/.env # manage.py bower install bug: https://github.com/nvbn/django-bower/issues/51 -RUN python3 manage.py bower_install -- --allow-root --no-input && \ +RUN python3 manage.py bower install --no-input && \ python3 manage.py collectstatic --no-input && \ rm -rf /var/interlegis/sapl/sapl/.env && \ rm -rf /var/interlegis/sapl/sapl.db From f49ffc956e65d9ef02eb6dc59eb84bd0d72887aa Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 9 May 2017 17:32:09 -0300 Subject: [PATCH 127/140] Fixes #1011 --- sapl/sessao/views.py | 16 +++++++++++----- sapl/templates/sessao/resumo.html | 2 ++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index a4dc33b48..899ed533e 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -1083,11 +1083,13 @@ class ResumoView(DetailView): numero = o.numero_ordem # Verificar resultado - resultado = o.registrovotacao_set.filter(materia=o.materia) - if resultado: - resultado = resultado[0].tipo_resultado_votacao.nome + rv = o.registrovotacao_set.filter(materia=o.materia).first() + if rv: + resultado = rv.tipo_resultado_votacao.nome + resultado_observacao = rv.observacao else: resultado = _('Matéria não votada') + resultado_observacao = _(' ') autoria = Autoria.objects.filter( materia_id=o.materia_id) @@ -1097,6 +1099,7 @@ class ResumoView(DetailView): 'titulo': titulo, 'numero': numero, 'resultado': resultado, + 'resultado_observacao': resultado_observacao, 'autor': autor } materias_ordem.append(mat) @@ -2169,11 +2172,13 @@ class PautaSessaoDetailView(DetailView): situacao = m.materia.tramitacao_set.last().status if situacao is None: situacao = _("Não informada") - resultado = m.registrovotacao_set.all() + rv = m.registrovotacao_set.all() if resultado: - resultado = resultado[0].tipo_resultado_votacao.nome + resultado = rv[0].tipo_resultado_votacao.nome + resultado_observacao = rv[0].observacao else: resultado = _('Matéria não votada') + resultado_observacao = _(' ') autoria = Autoria.objects.filter(materia_id=m.materia_id) autor = [str(x.autor) for x in autoria] @@ -2183,6 +2188,7 @@ class PautaSessaoDetailView(DetailView): 'titulo': titulo, 'numero': numero, 'resultado': resultado, + 'resultado_observacao': resultado_observacao, 'situacao': situacao, 'autor': autor } diff --git a/sapl/templates/sessao/resumo.html b/sapl/templates/sessao/resumo.html index 37554992a..db3a27c3a 100644 --- a/sapl/templates/sessao/resumo.html +++ b/sapl/templates/sessao/resumo.html @@ -139,6 +139,7 @@ Matéria Ementa Resultado da Votação + Observação da Votação @@ -151,6 +152,7 @@ {{m.ementa|safe}} {{m.resultado}} + {{m.resultado_observacao}} {% endfor %} From 717028f00c9c1cdf9941505060c6b96696e1efda Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 9 May 2017 19:27:35 -0300 Subject: [PATCH 128/140] Fix unbounded variable --- sapl/sessao/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 899ed533e..1a78adaa4 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -2173,7 +2173,7 @@ class PautaSessaoDetailView(DetailView): if situacao is None: situacao = _("Não informada") rv = m.registrovotacao_set.all() - if resultado: + if rv: resultado = rv[0].tipo_resultado_votacao.nome resultado_observacao = rv[0].observacao else: From a4d6ba9f33bbaf0eadcecafa5df8a696023a6f26 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 9 May 2017 19:32:29 -0300 Subject: [PATCH 129/140] Test dockerfile --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2b12ece18..be1a2c528 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,9 +32,10 @@ COPY config/env_dockerfile /var/interlegis/sapl/sapl/.env # manage.py bower install bug: https://github.com/nvbn/django-bower/issues/51 -RUN python3 manage.py bower install --no-input && \ - python3 manage.py collectstatic --no-input && \ - rm -rf /var/interlegis/sapl/sapl/.env && \ +RUN python3 manage.py bower install && \ + python3 manage.py collectstatic --no-input + +RUN rm -rf /var/interlegis/sapl/sapl/.env && \ rm -rf /var/interlegis/sapl/sapl.db RUN chmod +x /var/interlegis/sapl/start.sh && \ From 8f43e919540d2f73e88ac8e01dbf8e9c0dca50f2 Mon Sep 17 00:00:00 2001 From: Edward Ribeiro Date: Tue, 9 May 2017 21:17:59 -0300 Subject: [PATCH 130/140] Restaura bower_install --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index be1a2c528..e690045ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,7 @@ COPY start.sh /var/interlegis/sapl/ COPY config/nginx/sapl.conf /etc/nginx/conf.d COPY config/nginx/nginx.conf /etc/nginx/nginx.conf -RUN pip install -r /var/interlegis/sapl/requirements/requirements.txt --upgrade setuptools && \ +RUN pip install -r /var/interlegis/sapl/requirements/dev-requirements.txt --upgrade setuptools && \ rm -r /root/.cache && \ rm -r /tmp/* @@ -32,11 +32,11 @@ COPY config/env_dockerfile /var/interlegis/sapl/sapl/.env # manage.py bower install bug: https://github.com/nvbn/django-bower/issues/51 -RUN python3 manage.py bower install && \ +RUN python3 manage.py bower_install -- --allow-root --no-input && \ python3 manage.py collectstatic --no-input - + RUN rm -rf /var/interlegis/sapl/sapl/.env && \ - rm -rf /var/interlegis/sapl/sapl.db + rm -rf /var/interlegis/sapl/sapl.db RUN chmod +x /var/interlegis/sapl/start.sh && \ ln -sf /dev/stdout /var/log/nginx/access.log && \ From 93cf2b36f3165d2381df0a6b0a57f8b6fe134a48 Mon Sep 17 00:00:00 2001 From: Edward Date: Tue, 9 May 2017 22:00:41 -0300 Subject: [PATCH 131/140] Docker debug (#1072) * Habilita debug * point to experimental tag * Fix dev-requirements.txt * Bumping sass processor * Change bower install call --- Dockerfile | 5 ++--- config/env-sample | 2 +- config/env_dockerfile | 2 +- requirements/requirements.txt | 2 +- start.sh | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index e690045ec..2455200e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,9 +33,8 @@ COPY config/env_dockerfile /var/interlegis/sapl/sapl/.env # manage.py bower install bug: https://github.com/nvbn/django-bower/issues/51 RUN python3 manage.py bower_install -- --allow-root --no-input && \ - python3 manage.py collectstatic --no-input - -RUN rm -rf /var/interlegis/sapl/sapl/.env && \ + python3 manage.py collectstatic --no-input && \ + rm -rf /var/interlegis/sapl/sapl/.env && \ rm -rf /var/interlegis/sapl/sapl.db RUN chmod +x /var/interlegis/sapl/start.sh && \ diff --git a/config/env-sample b/config/env-sample index c358f9017..33fed9806 100644 --- a/config/env-sample +++ b/config/env-sample @@ -1,6 +1,6 @@ DATABASE_URL = postgresql://postgres:@sapldb:/sapl KEY -DEBUG = False +DEBUG = True EMAIL_USE_TLS = True EMAIL_PORT = 587 EMAIL_HOST = '' diff --git a/config/env_dockerfile b/config/env_dockerfile index c83fc88f1..f4a9291f7 100644 --- a/config/env_dockerfile +++ b/config/env_dockerfile @@ -1,6 +1,6 @@ DATABASE_URL = sqlite:///sapl.db SECRET_KEY = 'Dockerfile_Key' -DEBUG = False +DEBUG = True EMAIL_USE_TLS = True EMAIL_PORT = 587 EMAIL_HOST = '' diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 7fd7dbd80..9c49a47f2 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -15,7 +15,7 @@ django-extra-views==0.8.0 django-filter==0.15.3 django-floppyforms==1.6.2 django-model-utils==2.5 -django-sass-processor==0.5.3 +django-sass-processor==0.5.4 djangorestframework drfdocs easy-thumbnails==2.3 diff --git a/start.sh b/start.sh index 1b00801a2..8a213affd 100755 --- a/start.sh +++ b/start.sh @@ -27,7 +27,7 @@ create_env() { echo "SECRET_KEY="$KEY > $FILENAME # now only appends echo "DATABASE_URL = "$DATABASE_URL >> $FILENAME - echo "DEBUG = ""${DEBUG-False}" >> $FILENAME + echo "DEBUG = ""${DEBUG-True}" >> $FILENAME echo "EMAIL_USE_TLS = ""${USE_TLS-True}" >> $FILENAME echo "EMAIL_PORT = ""${EMAIL_PORT-587}" >> $FILENAME echo "EMAIL_HOST = ""${EMAIL_HOST-''}" >> $FILENAME From d19d6cf6e24480b91fff9e789dde4188700fc223 Mon Sep 17 00:00:00 2001 From: Matheus Veleci Date: Wed, 10 May 2017 10:36:54 -0300 Subject: [PATCH 132/140] =?UTF-8?q?Fix=20das=20vari=C3=A1veis=20de=20DEBUG?= =?UTF-8?q?=20do=20=C3=BAltimo=20commit(#1072)=20e=20adiciona=20o=20comand?= =?UTF-8?q?o=20compilescss=20no=20Dockerfile,=20para=20compilar=20os=20arq?= =?UTF-8?q?uivos=20SASS/SCSS=20em=20ambiente=20de=20produ=C3=A7=C3=A3o.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 3 +++ config/env-sample | 4 ++-- config/env_dockerfile | 2 +- start.sh | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2455200e1..838257c66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,10 @@ COPY config/env_dockerfile /var/interlegis/sapl/sapl/.env # manage.py bower install bug: https://github.com/nvbn/django-bower/issues/51 +# compilescss - Precompile all occurrences of your SASS/SCSS files for the whole project into css files + RUN python3 manage.py bower_install -- --allow-root --no-input && \ + python3 manage.py compilescss && \ python3 manage.py collectstatic --no-input && \ rm -rf /var/interlegis/sapl/sapl/.env && \ rm -rf /var/interlegis/sapl/sapl.db diff --git a/config/env-sample b/config/env-sample index 33fed9806..bde081a92 100644 --- a/config/env-sample +++ b/config/env-sample @@ -1,6 +1,6 @@ DATABASE_URL = postgresql://postgres:@sapldb:/sapl -KEY -DEBUG = True +KEY +DEBUG = False EMAIL_USE_TLS = True EMAIL_PORT = 587 EMAIL_HOST = '' diff --git a/config/env_dockerfile b/config/env_dockerfile index f4a9291f7..c83fc88f1 100644 --- a/config/env_dockerfile +++ b/config/env_dockerfile @@ -1,6 +1,6 @@ DATABASE_URL = sqlite:///sapl.db SECRET_KEY = 'Dockerfile_Key' -DEBUG = True +DEBUG = False EMAIL_USE_TLS = True EMAIL_PORT = 587 EMAIL_HOST = '' diff --git a/start.sh b/start.sh index 8a213affd..1b00801a2 100755 --- a/start.sh +++ b/start.sh @@ -27,7 +27,7 @@ create_env() { echo "SECRET_KEY="$KEY > $FILENAME # now only appends echo "DATABASE_URL = "$DATABASE_URL >> $FILENAME - echo "DEBUG = ""${DEBUG-True}" >> $FILENAME + echo "DEBUG = ""${DEBUG-False}" >> $FILENAME echo "EMAIL_USE_TLS = ""${USE_TLS-True}" >> $FILENAME echo "EMAIL_PORT = ""${EMAIL_PORT-587}" >> $FILENAME echo "EMAIL_HOST = ""${EMAIL_HOST-''}" >> $FILENAME From 9fd9da539ed91133362703956c692905bf53497c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fr=C3=A1?= Date: Wed, 10 May 2017 11:25:46 -0300 Subject: [PATCH 133/140] #1011 (#1077) --- sapl/templates/sessao/resumo.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sapl/templates/sessao/resumo.html b/sapl/templates/sessao/resumo.html index db3a27c3a..226a50966 100644 --- a/sapl/templates/sessao/resumo.html +++ b/sapl/templates/sessao/resumo.html @@ -139,7 +139,6 @@ Matéria Ementa Resultado da Votação - Observação da Votação @@ -151,8 +150,7 @@ Autor{{ m.autor|length|pluralize:"es" }}: {{ m.autor|join:', ' }} {{m.ementa|safe}} - {{m.resultado}} - {{m.resultado_observacao}} + {{m.resultado}}
    {{m.resultado_observacao}} {% endfor %} From e84733ccc3b6c315123c1a78aa307b4f5e702d80 Mon Sep 17 00:00:00 2001 From: eduardocalil Date: Wed, 10 May 2017 13:53:15 -0300 Subject: [PATCH 134/140] =?UTF-8?q?Refatora=20Mesa=20Diretora=20para=20Usu?= =?UTF-8?q?=C3=A1rio=20An=C3=B4nimo=20(#1078)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + sapl/parlamentares/urls.py | 4 + sapl/parlamentares/views.py | 99 ++++++++++++++++++- sapl/settings.py | 1 + .../parlamentares/composicaomesa_form.html | 3 +- .../public_composicaomesa_form.html | 89 ++++++++++++++++- 6 files changed, 186 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 52baa1622..b09b6cf6f 100644 --- a/.gitignore +++ b/.gitignore @@ -93,5 +93,6 @@ bower bower_components media whoosh/ +solr-4.10.2/ postgres-data/ data/ diff --git a/sapl/parlamentares/urls.py b/sapl/parlamentares/urls.py index 29a31adfb..0d8d406da 100644 --- a/sapl/parlamentares/urls.py +++ b/sapl/parlamentares/urls.py @@ -1,6 +1,7 @@ from django.conf.urls import include, url from sapl.parlamentares.views import (altera_field_mesa, + altera_field_mesa_public_view, CargoMesaCrud, ColigacaoCrud, ComposicaoColigacaoCrud, DependenteCrud, FiliacaoCrud, FrenteCrud, FrenteList, @@ -59,6 +60,9 @@ urlpatterns = [ url(r'^mesa-diretora/altera-field-mesa/$', altera_field_mesa, name='altera_field_mesa'), + url(r'^mesa-diretora/altera-field-mesa-public-view/$', + altera_field_mesa_public_view, name='altera_field_mesa_public_view'), + url(r'^mesa-diretora/insere-parlamentar-composicao/$', insere_parlamentar_composicao, name='insere_parlamentar_composicao'), diff --git a/sapl/parlamentares/views.py b/sapl/parlamentares/views.py index 3c6ac630a..f9dc33f60 100644 --- a/sapl/parlamentares/views.py +++ b/sapl/parlamentares/views.py @@ -373,11 +373,9 @@ class ParlamentarCrud(Crud): # Caso exista mais de uma filiação nesse intervalo # Entretanto, NÃO DEVE OCORRER except MultipleObjectsReturned: - filiacao = parlamentar.filiacao_set.filter(Q( - data__lte=legislatura.data_fim, - data_desfiliacao__gte=legislatura.data_fim) | Q( - data__lte=legislatura.data_fim, - data_desfiliacao__isnull=True)).last() + row[2] = ( + 'O Parlamentar possui duas filiações conflitantes', + None) # Caso encontre UMA filiação nessas condições else: @@ -588,3 +586,94 @@ def remove_parlamentar_composicao(request): return JsonResponse( {'msg': ( 'Selecione algum parlamentar para ser excluido!', 0)}) + + +def partido_parlamentar_sessao_legislativa(sessao, parlamentar): + """ + Função para descobrir o partido do parlamentar durante + o período de uma dada Sessão Legislativa + """ + + # As condições para mostrar a filiação são: + # A data de filiacao deve ser menor que a data de fim + # da sessao legislativa e data de desfiliação deve nula, ou maior, + # ou igual a data de fim da sessao + try: + filiacao = parlamentar.filiacao_set.get(Q( + data__lte=sessao.data_fim, + data_desfiliacao__gte=sessao.data_fim) | Q( + data__lte=sessao.data_fim, + data_desfiliacao__isnull=True)) + + # Caso não exista filiação com essas condições + except ObjectDoesNotExist: + return '' + + # Caso exista mais de uma filiação nesse intervalo + # Entretanto, NÃO DEVE OCORRER + except MultipleObjectsReturned: + return 'O Parlamentar possui duas filiações conflitantes' + + # Caso encontre UMA filiação nessas condições + else: + return filiacao.partido.sigla + + +def altera_field_mesa_public_view(request): + """ + Essa função lida com qualquer alteração nos campos + da Mesa Diretora para usuários anônimos, + atualizando os campos após cada alteração + """ + + legislatura = request.GET['legislatura'] + sessoes = SessaoLegislativa.objects.filter( + legislatura=legislatura).order_by('-data_inicio') + + if not sessoes: + return JsonResponse({'msg': ('Nenhuma sessão encontrada!', 0)}) + + # Verifica se já tem uma sessão selecionada. Ocorre quando + # é alterado o campo de sessão + if request.GET['sessao']: + sessao_selecionada = request.GET['sessao'] + # Caso a mudança tenha sido no campo legislatura, a sessão + # atual deve ser a primeira daquela legislatura + else: + sessao_selecionada = sessoes.first().id + + # Atualiza os componentes da view após a mudança + lista_sessoes = [(s.id, s.__str__()) for s in sessoes] + + composicao_mesa = ComposicaoMesa.objects.filter( + sessao_legislativa=sessao_selecionada) + + cargos_ocupados = [(m.cargo.id, + m.cargo.__str__()) for m in composicao_mesa] + + parlamentares_ocupados = [(m.parlamentar.id, + m.parlamentar.__str__() + ) for m in composicao_mesa] + + lista_fotos = [] + lista_partidos = [] + + sessao = SessaoLegislativa.objects.get(id=sessao_selecionada) + for p in parlamentares_ocupados: + parlamentar = Parlamentar.objects.get(id=p[0]) + lista_partidos.append( + partido_parlamentar_sessao_legislativa(sessao, + parlamentar)) + if parlamentar.fotografia: + lista_fotos.append(parlamentar.fotografia.url) + else: + lista_fotos.append(None) + + return JsonResponse( + {'lista_parlamentares': parlamentares_ocupados, + 'lista_partidos': lista_partidos, + 'lista_cargos': cargos_ocupados, + 'lista_sessoes': lista_sessoes, + 'lista_fotos': lista_fotos, + 'sessao_selecionada': sessao_selecionada, + 'msg': ('', 1)}) diff --git a/sapl/settings.py b/sapl/settings.py index 11b94b3de..3c757842e 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -208,6 +208,7 @@ LOCALE_PATHS = ( # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.8/howto/static-files/ + STATIC_URL = '/static/' STATIC_ROOT = PROJECT_DIR.child("collected_static") STATICFILES_DIRS = (BASE_DIR.child("static"),) diff --git a/sapl/templates/parlamentares/composicaomesa_form.html b/sapl/templates/parlamentares/composicaomesa_form.html index 855313442..6ba96835f 100644 --- a/sapl/templates/parlamentares/composicaomesa_form.html +++ b/sapl/templates/parlamentares/composicaomesa_form.html @@ -158,8 +158,7 @@ // Atualiza os campos após alguma operação de mudança da Legislatura/Sessao ou // Inserção/Remoção function altera_field(id_legislatura, id_sessao=null, msg=null){ - // Pega o novo valor do campo que foi modificado (Sessao/Legislatura) ou utiliza - // o valor da Legislatura, por conveniência, quando há alguma inserção ou remoção + // Pega o novo valor dos campos modificados var sessao_value = id_sessao var legislatura_value = id_legislatura diff --git a/sapl/templates/parlamentares/public_composicaomesa_form.html b/sapl/templates/parlamentares/public_composicaomesa_form.html index fbd780a30..6eaa3f6e5 100644 --- a/sapl/templates/parlamentares/public_composicaomesa_form.html +++ b/sapl/templates/parlamentares/public_composicaomesa_form.html @@ -10,7 +10,7 @@
    - {% for l in legislaturas %}
    - {% for s in sessoes %}