Browse Source

Corrige os erros relacionados a ordem dos imports

pull/1416/head
Mariana Mendes 7 years ago
parent
commit
3955575f4d
  1. 2
      create_admin.py
  2. 4
      sapl/api/forms.py
  3. 6
      sapl/api/urls.py
  4. 4
      sapl/api/views.py
  5. 5
      sapl/base/forms.py
  6. 3
      sapl/base/models.py
  7. 3
      sapl/base/urls.py
  8. 6
      sapl/base/views.py
  9. 2
      sapl/crispy_layout_mixin.py
  10. 3
      sapl/crud/base.py
  11. 10
      sapl/legacy/migration.py
  12. 10
      sapl/materia/forms.py
  13. 3
      sapl/materia/models.py
  14. 4
      sapl/materia/signals.py
  15. 2
      sapl/materia/tests/test_materia.py
  16. 9
      sapl/materia/urls.py
  17. 17
      sapl/materia/views.py
  18. 4
      sapl/painel/urls.py
  19. 4
      sapl/painel/views.py
  20. 2
      sapl/parlamentares/models.py
  21. 3
      sapl/parlamentares/urls.py
  22. 4
      sapl/parlamentares/views.py
  23. 6
      sapl/protocoloadm/forms.py
  24. 12
      sapl/protocoloadm/views.py
  25. 32
      sapl/redireciona_urls/urls.py
  26. 4
      sapl/redireciona_urls/views.py
  27. 2
      sapl/relatorios/views.py
  28. 4
      sapl/sessao/forms.py
  29. 13
      sapl/sessao/views.py
  30. 1
      sapl/settings.py
  31. 7
      sapl/utils.py
  32. 2
      scripts/set_inicio_mandato.py

2
create_admin.py

@ -1,6 +1,8 @@
import os import os
import sys import sys
import django import django
from sapl import settings from sapl import settings
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sapl.settings") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sapl.settings")

4
sapl/api/forms.py

@ -1,9 +1,9 @@
from django.db.models import Q, F from django.db.models import F, Q
from django.forms.fields import CharField, MultiValueField from django.forms.fields import CharField, MultiValueField
from django.forms.widgets import MultiWidget, TextInput from django.forms.widgets import MultiWidget, TextInput
from django.utils import timezone from django.utils import timezone
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django_filters.filters import MethodFilter, ModelChoiceFilter, DateFilter from django_filters.filters import DateFilter, MethodFilter, ModelChoiceFilter
from rest_framework import serializers from rest_framework import serializers
from rest_framework.compat import django_filters from rest_framework.compat import django_filters
from rest_framework.filters import FilterSet from rest_framework.filters import FilterSet

6
sapl/api/urls.py

@ -2,9 +2,9 @@ from django.conf import settings
from django.conf.urls import include, url from django.conf.urls import include, url
from rest_framework.routers import DefaultRouter from rest_framework.routers import DefaultRouter
from sapl.api.views import (AutorListView, MateriaLegislativaViewSet, from sapl.api.views import (AutoresPossiveisListView, AutoresProvaveisListView,
ModelChoiceView, SessaoPlenariaViewSet, AutorListView, MateriaLegislativaViewSet,
AutoresPossiveisListView, AutoresProvaveisListView) ModelChoiceView, SessaoPlenariaViewSet)
from .apps import AppConfig from .apps import AppConfig

4
sapl/api/views.py

@ -9,8 +9,8 @@ from rest_framework.permissions import (AllowAny, IsAuthenticated,
IsAuthenticatedOrReadOnly) IsAuthenticatedOrReadOnly)
from rest_framework.viewsets import GenericViewSet, ModelViewSet from rest_framework.viewsets import GenericViewSet, ModelViewSet
from sapl.api.forms import AutorChoiceFilterSet, AutorSearchForFieldFilterSet,\ from sapl.api.forms import (AutorChoiceFilterSet, AutoresPossiveisFilterSet,
AutoresPossiveisFilterSet AutorSearchForFieldFilterSet)
from sapl.api.serializers import (AutorChoiceSerializer, AutorSerializer, from sapl.api.serializers import (AutorChoiceSerializer, AutorSerializer,
ChoiceSerializer, ChoiceSerializer,
MateriaLegislativaSerializer, MateriaLegislativaSerializer,

5
sapl/base/forms.py

@ -1,3 +1,4 @@
import django_filters
from crispy_forms.bootstrap import FieldWithButtons, InlineRadios, StrictButton from crispy_forms.bootstrap import FieldWithButtons, InlineRadios, StrictButton
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, Button, Div, Field, Fieldset, Layout, Row from crispy_forms.layout import HTML, Button, Div, Field, Fieldset, Layout, Row
@ -12,9 +13,8 @@ from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.db import models, transaction from django.db import models, transaction
from django.forms import ModelForm from django.forms import ModelForm
from django.utils.translation import string_concat
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import django_filters from django.utils.translation import string_concat
from sapl.base.models import Autor, TipoAutor from sapl.base.models import Autor, TipoAutor
from sapl.crispy_layout_mixin import (SaplFormLayout, form_actions, to_column, from sapl.crispy_layout_mixin import (SaplFormLayout, form_actions, to_column,
@ -29,7 +29,6 @@ from sapl.utils import (RANGE_ANOS, ChoiceWithoutValidationField,
from .models import AppConfig, CasaLegislativa from .models import AppConfig, CasaLegislativa
ACTION_CREATE_USERS_AUTOR_CHOICE = [ ACTION_CREATE_USERS_AUTOR_CHOICE = [
('C', _('Criar novo Usuário')), ('C', _('Criar novo Usuário')),
('A', _('Associar um usuário existente')), ('A', _('Associar um usuário existente')),

3
sapl/base/models.py

@ -1,12 +1,11 @@
import reversion
from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.db import models from django.db import models
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import reversion
from sapl.utils import UF, YES_NO_CHOICES, get_settings_auth_user_model from sapl.utils import UF, YES_NO_CHOICES, get_settings_auth_user_model
TIPO_DOCUMENTO_ADMINISTRATIVO = (('O', _('Ostensivo')), TIPO_DOCUMENTO_ADMINISTRATIVO = (('O', _('Ostensivo')),
('R', _('Restritivo'))) ('R', _('Restritivo')))

3
sapl/base/urls.py

@ -16,8 +16,7 @@ from .views import (AppConfigCrud, CasaLegislativaCrud, HelpView,
RelatorioMateriasPorAnoAutorTipoView, RelatorioMateriasPorAnoAutorTipoView,
RelatorioMateriasPorAutorView, RelatorioMateriasPorAutorView,
RelatorioMateriasTramitacaoView, RelatorioMateriasTramitacaoView,
RelatorioPresencaSessaoView, RelatorioPresencaSessaoView, SaplSearchView)
SaplSearchView)
app_name = AppConfig.name app_name = AppConfig.name

6
sapl/base/views.py

@ -14,7 +14,6 @@ from django.utils.http import urlsafe_base64_decode, urlsafe_base64_encode
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from django_filters.views import FilterView from django_filters.views import FilterView
from haystack.views import SearchView from haystack.views import SearchView
from sapl.base.forms import AutorForm, AutorFormForAdmin, TipoAutorForm from sapl.base.forms import AutorForm, AutorFormForAdmin, TipoAutorForm
@ -22,7 +21,8 @@ from sapl.base.models import Autor, TipoAutor
from sapl.crud.base import CrudAux from sapl.crud.base import CrudAux
from sapl.materia.models import MateriaLegislativa, TipoMateriaLegislativa from sapl.materia.models import MateriaLegislativa, TipoMateriaLegislativa
from sapl.parlamentares.models import Parlamentar from sapl.parlamentares.models import Parlamentar
from sapl.sessao.models import PresencaOrdemDia, SessaoPlenaria, SessaoPlenariaPresenca from sapl.sessao.models import (PresencaOrdemDia, SessaoPlenaria,
SessaoPlenariaPresenca)
from sapl.utils import parlamentares_ativos, sapl_logger from sapl.utils import parlamentares_ativos, sapl_logger
from .forms import (CasaLegislativaForm, ConfiguracoesAppForm, from .forms import (CasaLegislativaForm, ConfiguracoesAppForm,
@ -497,4 +497,4 @@ class SaplSearchView(SearchView):
for m in models: for m in models:
context['models'] = context['models'] + '&models=' + m context['models'] = context['models'] + '&models=' + m
return context return context

2
sapl/crispy_layout_mixin.py

@ -1,5 +1,6 @@
from math import ceil from math import ceil
import rtyaml
from crispy_forms.bootstrap import FormActions from crispy_forms.bootstrap import FormActions
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, Div, Fieldset, Layout, Submit from crispy_forms.layout import HTML, Div, Fieldset, Layout, Submit
@ -7,7 +8,6 @@ from django import template
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.utils import formats from django.utils import formats
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
import rtyaml
def heads_and_tails(list_of_lists): def heads_and_tails(list_of_lists):

3
sapl/crud/base.py

@ -17,8 +17,8 @@ from django.http.response import Http404
from django.shortcuts import redirect from django.shortcuts import redirect
from django.utils.decorators import classonlymethod from django.utils.decorators import classonlymethod
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils.translation import string_concat
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.utils.translation import string_concat
from django.views.generic import (CreateView, DeleteView, DetailView, ListView, from django.views.generic import (CreateView, DeleteView, DetailView, ListView,
UpdateView) UpdateView)
from django.views.generic.base import ContextMixin from django.views.generic.base import ContextMixin
@ -30,7 +30,6 @@ from sapl.rules.map_rules import (RP_ADD, RP_CHANGE, RP_DELETE, RP_DETAIL,
from sapl.settings import BASE_DIR from sapl.settings import BASE_DIR
from sapl.utils import normalize from sapl.utils import normalize
logger = logging.getLogger(BASE_DIR.name) logger = logging.getLogger(BASE_DIR.name)
ACTION_LIST, ACTION_CREATE, ACTION_DETAIL, ACTION_UPDATE, ACTION_DELETE = \ ACTION_LIST, ACTION_CREATE, ACTION_DETAIL, ACTION_UPDATE, ACTION_DELETE = \

10
sapl/legacy/migration.py

@ -12,7 +12,7 @@ from django.contrib.auth.models import Group
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django.db import OperationalError, ProgrammingError, connections, models from django.db import OperationalError, ProgrammingError, connections, models
from django.db.models import CharField, Max, ProtectedError, TextField, Count from django.db.models import CharField, Count, Max, ProtectedError, TextField
from django.db.models.base import ModelBase from django.db.models.base import ModelBase
from django.db.models.signals import post_delete, post_save from django.db.models.signals import post_delete, post_save
from model_mommy import mommy from model_mommy import mommy
@ -26,11 +26,11 @@ from sapl.materia.models import (AcompanhamentoMateria, DocumentoAcessorio,
StatusTramitacao, TipoDocumento, StatusTramitacao, TipoDocumento,
TipoMateriaLegislativa, TipoProposicao, TipoMateriaLegislativa, TipoProposicao,
Tramitacao) Tramitacao)
from sapl.norma.models import (AssuntoNorma, NormaJuridica, from sapl.norma.models import (AssuntoNorma, NormaJuridica, NormaRelacionada,
TipoVinculoNormaJuridica, NormaRelacionada) TipoVinculoNormaJuridica)
from sapl.parlamentares.models import (Legislatura,Mandato, Parlamentar, from sapl.parlamentares.models import (Legislatura, Mandato, Parlamentar,
TipoAfastamento) TipoAfastamento)
from sapl.protocoloadm.models import (DocumentoAdministrativo,Protocolo, from sapl.protocoloadm.models import (DocumentoAdministrativo, Protocolo,
StatusTramitacaoAdministrativo) StatusTramitacaoAdministrativo)
from sapl.sessao.models import ExpedienteMateria, OrdemDia, RegistroVotacao from sapl.sessao.models import ExpedienteMateria, OrdemDia, RegistroVotacao
from sapl.settings import PROJECT_DIR from sapl.settings import PROJECT_DIR

10
sapl/materia/forms.py

@ -1,7 +1,8 @@
from datetime import date, datetime
import os import os
from datetime import date, datetime
import django_filters
from crispy_forms.bootstrap import Alert, FormActions, InlineRadios from crispy_forms.bootstrap import Alert, FormActions, InlineRadios
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import (HTML, Button, Column, Div, Field, Fieldset, from crispy_forms.layout import (HTML, Button, Column, Div, Field, Fieldset,
@ -13,16 +14,16 @@ from django.core.files.base import File
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.db import models, transaction from django.db import models, transaction
from django.db.models import Max from django.db.models import Max
from django.forms import ModelForm, ModelChoiceField, widgets from django.forms import ModelChoiceField, ModelForm, widgets
from django.forms.forms import Form from django.forms.forms import Form
from django.forms.models import ModelMultipleChoiceField from django.forms.models import ModelMultipleChoiceField
from django.forms.widgets import Select, CheckboxSelectMultiple, HiddenInput from django.forms.widgets import CheckboxSelectMultiple, HiddenInput, Select
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils.html import format_html from django.utils.html import format_html
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import django_filters
import sapl
from sapl.base.models import Autor, TipoAutor from sapl.base.models import Autor, TipoAutor
from sapl.comissoes.models import Comissao from sapl.comissoes.models import Comissao
from sapl.compilacao.models import (STATUS_TA_IMMUTABLE_PUBLIC, from sapl.compilacao.models import (STATUS_TA_IMMUTABLE_PUBLIC,
@ -41,7 +42,6 @@ from sapl.utils import (RANGE_ANOS, YES_NO_CHOICES,
MateriaPesquisaOrderingFilter, RangeWidgetOverride, MateriaPesquisaOrderingFilter, RangeWidgetOverride,
autor_label, autor_modal, models_with_gr_for_model, autor_label, autor_modal, models_with_gr_for_model,
qs_override_django_filter) qs_override_django_filter)
import sapl
from .models import (AcompanhamentoMateria, Anexada, Autoria, DespachoInicial, from .models import (AcompanhamentoMateria, Anexada, Autoria, DespachoInicial,
DocumentoAcessorio, Numeracao, Proposicao, Relatoria, DocumentoAcessorio, Numeracao, Proposicao, Relatoria,

3
sapl/materia/models.py

@ -1,5 +1,6 @@
from datetime import datetime from datetime import datetime
import reversion
from django.contrib.auth.models import Group from django.contrib.auth.models import Group
from django.contrib.contenttypes.fields import GenericRelation from django.contrib.contenttypes.fields import GenericRelation
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
@ -8,7 +9,6 @@ from django.db import models
from django.utils import formats from django.utils import formats
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from model_utils import Choices from model_utils import Choices
import reversion
from sapl.base.models import Autor from sapl.base.models import Autor
from sapl.comissoes.models import Comissao from sapl.comissoes.models import Comissao
@ -19,7 +19,6 @@ from sapl.utils import (RANGE_ANOS, YES_NO_CHOICES, SaplGenericForeignKey,
SaplGenericRelation, restringe_tipos_de_arquivo_txt, SaplGenericRelation, restringe_tipos_de_arquivo_txt,
texto_upload_path) texto_upload_path)
EM_TRAMITACAO = [(1, 'Sim'), EM_TRAMITACAO = [(1, 'Sim'),
(0, 'Não')] (0, 'Não')]

4
sapl/materia/signals.py

@ -1,8 +1,6 @@
from django.db.models.signals import post_delete, post_save
import django.dispatch import django.dispatch
from django.db.models.signals import post_delete, post_save
from .models import DocumentoAcessorio, MateriaLegislativa from .models import DocumentoAcessorio, MateriaLegislativa
tramitacao_signal = django.dispatch.Signal(providing_args=['post', 'request']) tramitacao_signal = django.dispatch.Signal(providing_args=['post', 'request'])

2
sapl/materia/tests/test_materia.py

@ -1,9 +1,9 @@
import pytest
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.core.files.uploadedfile import SimpleUploadedFile from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from model_mommy import mommy from model_mommy import mommy
import pytest
from sapl.base.models import Autor, TipoAutor from sapl.base.models import Autor, TipoAutor
from sapl.comissoes.models import Comissao, TipoComissao from sapl.comissoes.models import Comissao, TipoComissao

9
sapl/materia/urls.py

@ -4,8 +4,9 @@ from sapl.materia.views import (AcompanhamentoConfirmarView,
AcompanhamentoExcluirView, AcompanhamentoExcluirView,
AcompanhamentoMateriaView, AnexadaCrud, AcompanhamentoMateriaView, AnexadaCrud,
AssuntoMateriaCrud, AutoriaCrud, AssuntoMateriaCrud, AutoriaCrud,
ConfirmarProposicao, CriarProtocoloMateriaView, AutoriaMultiCreateView, ConfirmarProposicao,
DespachoInicialCrud, DocumentoAcessorioCrud, CriarProtocoloMateriaView, DespachoInicialCrud,
DocumentoAcessorioCrud,
DocumentoAcessorioEmLoteView, DocumentoAcessorioEmLoteView,
LegislacaoCitadaCrud, MateriaAssuntoCrud, LegislacaoCitadaCrud, MateriaAssuntoCrud,
MateriaLegislativaCrud, MateriaLegislativaCrud,
@ -20,13 +21,11 @@ from sapl.materia.views import (AcompanhamentoConfirmarView,
TipoFimRelatoriaCrud, TipoMateriaCrud, TipoFimRelatoriaCrud, TipoMateriaCrud,
TipoProposicaoCrud, TramitacaoCrud, TipoProposicaoCrud, TramitacaoCrud,
TramitacaoEmLoteView, UnidadeTramitacaoCrud, TramitacaoEmLoteView, UnidadeTramitacaoCrud,
proposicao_texto, recuperar_materia, proposicao_texto, recuperar_materia)
AutoriaMultiCreateView)
from . import receivers from . import receivers
from .apps import AppConfig from .apps import AppConfig
app_name = AppConfig.name app_name = AppConfig.name
urlpatterns_materia = [ urlpatterns_materia = [

17
sapl/materia/views.py

@ -1,4 +1,4 @@
from datetime import datetime, date from datetime import date, datetime
from random import choice from random import choice
from string import ascii_letters, digits from string import ascii_letters, digits
@ -9,8 +9,7 @@ from django.contrib import messages
from django.contrib.auth.decorators import permission_required from django.contrib.auth.decorators import permission_required
from django.contrib.auth.mixins import PermissionRequiredMixin from django.contrib.auth.mixins import PermissionRequiredMixin
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import (ObjectDoesNotExist, from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
MultipleObjectsReturned)
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.db.models import Q from django.db.models import Q
from django.http import HttpResponse, JsonResponse from django.http import HttpResponse, JsonResponse
@ -23,6 +22,7 @@ from django.views.generic.base import RedirectView
from django.views.generic.edit import FormView from django.views.generic.edit import FormView
from django_filters.views import FilterView from django_filters.views import FilterView
import sapl
from sapl.base.models import Autor, CasaLegislativa from sapl.base.models import Autor, CasaLegislativa
from sapl.comissoes.models import Comissao, Participacao from sapl.comissoes.models import Comissao, Participacao
from sapl.compilacao.models import (STATUS_TA_IMMUTABLE_RESTRICT, from sapl.compilacao.models import (STATUS_TA_IMMUTABLE_RESTRICT,
@ -33,16 +33,16 @@ from sapl.crud.base import (ACTION_CREATE, ACTION_DELETE, ACTION_DETAIL,
ACTION_LIST, ACTION_UPDATE, RP_DETAIL, RP_LIST, ACTION_LIST, ACTION_UPDATE, RP_DETAIL, RP_LIST,
Crud, CrudAux, MasterDetailCrud, Crud, CrudAux, MasterDetailCrud,
PermissionRequiredForAppCrudMixin, make_pagination) PermissionRequiredForAppCrudMixin, make_pagination)
from sapl.materia.forms import (AnexadaForm, ConfirmarProposicaoForm, from sapl.materia.forms import (AnexadaForm, AutoriaForm,
LegislacaoCitadaForm, AutoriaForm, ProposicaoForm, AutoriaMultiCreateForm,
TipoProposicaoForm, TramitacaoForm, ConfirmarProposicaoForm, LegislacaoCitadaForm,
TramitacaoUpdateForm, AutoriaMultiCreateForm) ProposicaoForm, TipoProposicaoForm,
TramitacaoForm, TramitacaoUpdateForm)
from sapl.norma.models import LegislacaoCitada from sapl.norma.models import LegislacaoCitada
from sapl.protocoloadm.models import Protocolo from sapl.protocoloadm.models import Protocolo
from sapl.utils import (TURNO_TRAMITACAO_CHOICES, YES_NO_CHOICES, autor_label, from sapl.utils import (TURNO_TRAMITACAO_CHOICES, YES_NO_CHOICES, autor_label,
autor_modal, gerar_hash_arquivo, get_base_url, autor_modal, gerar_hash_arquivo, get_base_url,
montar_row_autor) montar_row_autor)
import sapl
from .email_utils import do_envia_email_confirmacao from .email_utils import do_envia_email_confirmacao
from .forms import (AcessorioEmLoteFilterSet, AcompanhamentoMateriaForm, from .forms import (AcessorioEmLoteFilterSet, AcompanhamentoMateriaForm,
@ -62,7 +62,6 @@ from .models import (AcompanhamentoMateria, Anexada, AssuntoMateria, Autoria,
TipoProposicao, Tramitacao, UnidadeTramitacao) TipoProposicao, Tramitacao, UnidadeTramitacao)
from .signals import tramitacao_signal from .signals import tramitacao_signal
AssuntoMateriaCrud = Crud.build(AssuntoMateria, 'assunto_materia') AssuntoMateriaCrud = Crud.build(AssuntoMateria, 'assunto_materia')
OrigemCrud = Crud.build(Origem, '') OrigemCrud = Crud.build(Origem, '')

4
sapl/painel/urls.py

@ -2,8 +2,8 @@ from django.conf.urls import url
from .apps import AppConfig from .apps import AppConfig
from .views import (cronometro_painel, get_dados_painel, painel_mensagem_view, from .views import (cronometro_painel, get_dados_painel, painel_mensagem_view,
painel_parlamentar_view, painel_view, painel_parlamentar_view, painel_view, painel_votacao_view,
painel_votacao_view, votante_view) votante_view)
app_name = AppConfig.name app_name = AppConfig.name

4
sapl/painel/views.py

@ -2,9 +2,9 @@ from datetime import date
from django.contrib import messages from django.contrib import messages
from django.contrib.auth.decorators import user_passes_test from django.contrib.auth.decorators import user_passes_test
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db.models import Q
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import HttpResponse, JsonResponse from django.http import HttpResponse, JsonResponse
from django.http.response import Http404, HttpResponseRedirect from django.http.response import Http404, HttpResponseRedirect
from django.shortcuts import render from django.shortcuts import render

2
sapl/parlamentares/models.py

@ -1,9 +1,9 @@
from datetime import datetime from datetime import datetime
import reversion
from django.db import models from django.db import models
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from model_utils import Choices from model_utils import Choices
import reversion
from sapl.base.models import Autor from sapl.base.models import Autor
from sapl.utils import (INDICADOR_AFASTAMENTO, UF, YES_NO_CHOICES, from sapl.utils import (INDICADOR_AFASTAMENTO, UF, YES_NO_CHOICES,

3
sapl/parlamentares/urls.py

@ -5,8 +5,7 @@ from sapl.parlamentares.views import (CargoMesaCrud, ColigacaoCrud,
FiliacaoCrud, FrenteCrud, FrenteList, FiliacaoCrud, FrenteCrud, FrenteList,
LegislaturaCrud, MandatoCrud, LegislaturaCrud, MandatoCrud,
MesaDiretoraView, NivelInstrucaoCrud, MesaDiretoraView, NivelInstrucaoCrud,
ParlamentarCrud, ParlamentarCrud, ParlamentarMateriasView,
ParlamentarMateriasView,
ParticipacaoParlamentarCrud, PartidoCrud, ParticipacaoParlamentarCrud, PartidoCrud,
ProposicaoParlamentarCrud, ProposicaoParlamentarCrud,
RelatoriaParlamentarCrud, RelatoriaParlamentarCrud,

4
sapl/parlamentares/views.py

@ -21,8 +21,7 @@ from sapl.comissoes.models import Participacao
from sapl.crud.base import (RP_CHANGE, RP_DETAIL, RP_LIST, Crud, CrudAux, from sapl.crud.base import (RP_CHANGE, RP_DETAIL, RP_LIST, Crud, CrudAux,
CrudBaseForListAndDetailExternalAppView, CrudBaseForListAndDetailExternalAppView,
MasterDetailCrud) MasterDetailCrud)
from sapl.materia.models import Autoria from sapl.materia.models import Autoria, Proposicao, Relatoria
from sapl.materia.models import Proposicao, Relatoria
from sapl.parlamentares.apps import AppConfig from sapl.parlamentares.apps import AppConfig
from sapl.utils import parlamentares_ativos from sapl.utils import parlamentares_ativos
@ -34,7 +33,6 @@ from .models import (CargoMesa, Coligacao, ComposicaoColigacao, ComposicaoMesa,
NivelInstrucao, Parlamentar, Partido, SessaoLegislativa, NivelInstrucao, Parlamentar, Partido, SessaoLegislativa,
SituacaoMilitar, TipoAfastamento, TipoDependente, Votante) SituacaoMilitar, TipoAfastamento, TipoDependente, Votante)
CargoMesaCrud = CrudAux.build(CargoMesa, 'cargo_mesa') CargoMesaCrud = CrudAux.build(CargoMesa, 'cargo_mesa')
PartidoCrud = CrudAux.build(Partido, 'partidos') PartidoCrud = CrudAux.build(Partido, 'partidos')
SessaoLegislativaCrud = CrudAux.build(SessaoLegislativa, 'sessao_legislativa') SessaoLegislativaCrud = CrudAux.build(SessaoLegislativa, 'sessao_legislativa')

6
sapl/protocoloadm/forms.py

@ -1,5 +1,6 @@
from datetime import datetime from datetime import datetime
import django_filters
from crispy_forms.bootstrap import InlineRadios from crispy_forms.bootstrap import InlineRadios
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, Button, Fieldset, Layout, Submit from crispy_forms.layout import HTML, Button, Fieldset, Layout, Submit
@ -8,11 +9,11 @@ from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import models from django.db import models
from django.forms import ModelForm from django.forms import ModelForm
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import django_filters
from sapl.base.models import Autor, TipoAutor from sapl.base.models import Autor, TipoAutor
from sapl.crispy_layout_mixin import form_actions, to_row from sapl.crispy_layout_mixin import form_actions, to_row
from sapl.materia.models import MateriaLegislativa, TipoMateriaLegislativa, UnidadeTramitacao from sapl.materia.models import (MateriaLegislativa, TipoMateriaLegislativa,
UnidadeTramitacao)
from sapl.utils import (RANGE_ANOS, AnoNumeroOrderingFilter, from sapl.utils import (RANGE_ANOS, AnoNumeroOrderingFilter,
RangeWidgetOverride, autor_label, autor_modal) RangeWidgetOverride, autor_label, autor_modal)
@ -20,7 +21,6 @@ from .models import (DocumentoAcessorioAdministrativo, DocumentoAdministrativo,
Protocolo, TipoDocumentoAdministrativo, Protocolo, TipoDocumentoAdministrativo,
TramitacaoAdministrativo) TramitacaoAdministrativo)
TIPOS_PROTOCOLO = [('0', 'Recebido'), ('1', 'Enviado'), ('', 'Ambos')] TIPOS_PROTOCOLO = [('0', 'Recebido'), ('1', 'Enviado'), ('', 'Ambos')]
TIPOS_PROTOCOLO_CREATE = [('0', 'Recebido'), ('1', 'Enviado')] TIPOS_PROTOCOLO_CREATE = [('0', 'Recebido'), ('1', 'Enviado')]

12
sapl/protocoloadm/views.py

@ -1,13 +1,12 @@
from datetime import date, datetime from datetime import date, datetime
from braces.views import FormValidMessageMixin from braces.views import FormValidMessageMixin
from django.contrib import messages from django.contrib import messages
from django.contrib.auth.mixins import PermissionRequiredMixin from django.contrib.auth.mixins import PermissionRequiredMixin
from django.db.models import Q from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.db.models import Max from django.db.models import Max, Q
from django.http import (Http404, HttpResponse, HttpResponseRedirect, from django.http import (Http404, HttpResponse, HttpResponseRedirect,
JsonResponse) JsonResponse)
from django.shortcuts import redirect from django.shortcuts import redirect
@ -18,8 +17,11 @@ from django_filters.views import FilterView
import sapl import sapl
from sapl.base.models import Autor from sapl.base.models import Autor
from sapl.comissoes.models import Comissao
from sapl.crud.base import Crud, CrudAux, MasterDetailCrud, make_pagination from sapl.crud.base import Crud, CrudAux, MasterDetailCrud, make_pagination
from sapl.materia.models import MateriaLegislativa, TipoMateriaLegislativa from sapl.materia.models import MateriaLegislativa, TipoMateriaLegislativa
from sapl.parlamentares.models import Parlamentar
from sapl.protocoloadm.models import Protocolo
from sapl.utils import create_barcode, get_client_ip from sapl.utils import create_barcode, get_client_ip
from .forms import (AnularProcoloAdmForm, DocumentoAcessorioAdministrativoForm, from .forms import (AnularProcoloAdmForm, DocumentoAcessorioAdministrativoForm,
@ -30,10 +32,6 @@ from .forms import (AnularProcoloAdmForm, DocumentoAcessorioAdministrativoForm,
from .models import (DocumentoAcessorioAdministrativo, DocumentoAdministrativo, from .models import (DocumentoAcessorioAdministrativo, DocumentoAdministrativo,
Protocolo, StatusTramitacaoAdministrativo, Protocolo, StatusTramitacaoAdministrativo,
TipoDocumentoAdministrativo, TramitacaoAdministrativo) TipoDocumentoAdministrativo, TramitacaoAdministrativo)
from sapl.parlamentares.models import Parlamentar
from sapl.protocoloadm.models import Protocolo
from sapl.comissoes.models import Comissao
from django.contrib.contenttypes.models import ContentType
TipoDocumentoAdministrativoCrud = CrudAux.build( TipoDocumentoAdministrativoCrud = CrudAux.build(
TipoDocumentoAdministrativo, '') TipoDocumentoAdministrativo, '')

32
sapl/redireciona_urls/urls.py

@ -1,24 +1,18 @@
from .apps import AppConfig
from .views import (
RedirecionaAtasList,
RedirecionaComissao,
RedirecionaHistoricoTramitacoesList,
RedirecionaMateriaLegislativaDetail,
RedirecionaMateriaLegislativaList,
RedirecionaMateriasPorAnoAutorTipo,
RedirecionaMateriasPorAutor,
RedirecionaMesaDiretoraView,
RedirecionaNormasJuridicasDetail,
RedirecionaNormasJuridicasList,
RedirecionaParlamentar,
RedirecionaPautaSessao,
RedirecionaPresencaParlamentares,
RedirecionaRelatoriosList,
RedirecionaRelatoriosMateriasEmTramitacaoList,
RedirecionaSessaoPlenaria,
RedirecionaSAPLIndex)
from django.conf.urls import url from django.conf.urls import url
from .apps import AppConfig
from .views import (RedirecionaAtasList, RedirecionaComissao,
RedirecionaHistoricoTramitacoesList,
RedirecionaMateriaLegislativaDetail,
RedirecionaMateriaLegislativaList,
RedirecionaMateriasPorAnoAutorTipo,
RedirecionaMateriasPorAutor, RedirecionaMesaDiretoraView,
RedirecionaNormasJuridicasDetail,
RedirecionaNormasJuridicasList, RedirecionaParlamentar,
RedirecionaPautaSessao, RedirecionaPresencaParlamentares,
RedirecionaRelatoriosList,
RedirecionaRelatoriosMateriasEmTramitacaoList,
RedirecionaSAPLIndex, RedirecionaSessaoPlenaria)
app_name = AppConfig.name app_name = AppConfig.name

4
sapl/redireciona_urls/views.py

@ -1,6 +1,6 @@
from .exceptions import UnknownUrlNameError
from django.core.urlresolvers import NoReverseMatch, reverse from django.core.urlresolvers import NoReverseMatch, reverse
from django.views.generic import RedirectView from django.views.generic import RedirectView
from sapl.base.apps import AppConfig as atasConfig from sapl.base.apps import AppConfig as atasConfig
from sapl.base.apps import AppConfig as presenca_sessaoConfig from sapl.base.apps import AppConfig as presenca_sessaoConfig
from sapl.base.apps import AppConfig as relatoriosConfig from sapl.base.apps import AppConfig as relatoriosConfig
@ -10,6 +10,8 @@ from sapl.norma.apps import AppConfig as normaConfig
from sapl.parlamentares.apps import AppConfig as parlamentaresConfig from sapl.parlamentares.apps import AppConfig as parlamentaresConfig
from sapl.sessao.apps import AppConfig as sessaoConfig from sapl.sessao.apps import AppConfig as sessaoConfig
from .exceptions import UnknownUrlNameError
EMPTY_STRING = '' EMPTY_STRING = ''
app_parlamentares = parlamentaresConfig.name app_parlamentares = parlamentaresConfig.name

2
sapl/relatorios/views.py

@ -19,7 +19,7 @@ from sapl.sessao.models import (ExpedienteMateria, ExpedienteSessao,
SessaoPlenaria, SessaoPlenariaPresenca, SessaoPlenaria, SessaoPlenariaPresenca,
TipoExpediente) TipoExpediente)
from sapl.settings import STATIC_ROOT from sapl.settings import STATIC_ROOT
from sapl.utils import filiacao_data, UF from sapl.utils import UF, filiacao_data
from .templates import (pdf_capa_processo_gerar, from .templates import (pdf_capa_processo_gerar,
pdf_documento_administrativo_gerar, pdf_espelho_gerar, pdf_documento_administrativo_gerar, pdf_espelho_gerar,

4
sapl/sessao/forms.py

@ -10,8 +10,8 @@ from django.utils.translation import ugettext_lazy as _
from sapl.crispy_layout_mixin import form_actions, to_row from sapl.crispy_layout_mixin import form_actions, to_row
from sapl.materia.forms import MateriaLegislativaFilterSet from sapl.materia.forms import MateriaLegislativaFilterSet
from sapl.materia.models import (MateriaLegislativa, TipoMateriaLegislativa, from sapl.materia.models import (MateriaLegislativa, StatusTramitacao,
StatusTramitacao) TipoMateriaLegislativa)
from sapl.parlamentares.models import Parlamentar from sapl.parlamentares.models import Parlamentar
from sapl.utils import (RANGE_DIAS_MES, RANGE_MESES, from sapl.utils import (RANGE_DIAS_MES, RANGE_MESES,
MateriaPesquisaOrderingFilter, autor_label, MateriaPesquisaOrderingFilter, autor_label,

13
sapl/sessao/views.py

@ -30,22 +30,23 @@ from sapl.materia.models import (Autoria, DocumentoAcessorio,
TipoMateriaLegislativa, Tramitacao) TipoMateriaLegislativa, Tramitacao)
from sapl.materia.views import MateriaLegislativaPesquisaView from sapl.materia.views import MateriaLegislativaPesquisaView
from sapl.norma.models import NormaJuridica from sapl.norma.models import NormaJuridica
from sapl.parlamentares.models import (Filiacao, Legislatura, Parlamentar, from sapl.parlamentares.models import (Filiacao, Legislatura, Mandato,
SessaoLegislativa, Mandato) Parlamentar, SessaoLegislativa)
from sapl.sessao.apps import AppConfig from sapl.sessao.apps import AppConfig
from sapl.sessao.forms import ExpedienteMateriaForm, OrdemDiaForm from sapl.sessao.forms import ExpedienteMateriaForm, OrdemDiaForm
from .forms import (AdicionarVariasMateriasFilterSet, ExpedienteForm, from .forms import (AdicionarVariasMateriasFilterSet, ExpedienteForm,
ListMateriaForm, MesaForm, OradorExpedienteForm, ListMateriaForm, MesaForm, OradorExpedienteForm,
OradorForm, PautaSessaoFilterSet, PresencaForm, OradorForm, PautaSessaoFilterSet, PresencaForm,
ResumoOrdenacaoForm, SessaoPlenariaFilterSet, SessaoPlenariaForm, ResumoOrdenacaoForm, SessaoPlenariaFilterSet,
VotacaoEditForm, VotacaoForm, VotacaoNominalForm) SessaoPlenariaForm, VotacaoEditForm, VotacaoForm,
VotacaoNominalForm)
from .models import (Bancada, Bloco, CargoBancada, CargoMesa, from .models import (Bancada, Bloco, CargoBancada, CargoMesa,
ExpedienteMateria, ExpedienteSessao, IntegranteMesa, ExpedienteMateria, ExpedienteSessao, IntegranteMesa,
MateriaLegislativa, Orador, OradorExpediente, OrdemDia, MateriaLegislativa, Orador, OradorExpediente, OrdemDia,
PresencaOrdemDia, RegistroVotacao, ResumoOrdenacao, PresencaOrdemDia, RegistroVotacao, ResumoOrdenacao,
SessaoPlenaria, SessaoPlenariaPresenca, TipoExpediente, SessaoPlenaria, SessaoPlenariaPresenca, TipoExpediente,
TipoResultadoVotacao, TipoSessaoPlenaria, TipoResultadoVotacao, TipoSessaoPlenaria, VotoParlamentar)
VotoParlamentar)
TipoSessaoCrud = CrudAux.build(TipoSessaoPlenaria, 'tipo_sessao_plenaria') TipoSessaoCrud = CrudAux.build(TipoSessaoPlenaria, 'tipo_sessao_plenaria')
TipoExpedienteCrud = CrudAux.build(TipoExpediente, 'tipo_expediente') TipoExpedienteCrud = CrudAux.build(TipoExpediente, 'tipo_expediente')

1
sapl/settings.py

@ -22,7 +22,6 @@ from unipath import Path
from .temp_suppress_crispy_form_warnings import \ from .temp_suppress_crispy_form_warnings import \
SUPRESS_CRISPY_FORM_WARNINGS_LOGGING SUPRESS_CRISPY_FORM_WARNINGS_LOGGING
BASE_DIR = Path(__file__).ancestor(1) BASE_DIR = Path(__file__).ancestor(1)
PROJECT_DIR = Path(__file__).ancestor(2) PROJECT_DIR = Path(__file__).ancestor(2)

7
sapl/utils.py

@ -3,7 +3,6 @@ import logging
import os import os
import re import re
from datetime import date from datetime import date
from django_filters.filterset import STRICTNESS
from functools import wraps from functools import wraps
from subprocess import PIPE, call from subprocess import PIPE, call
from threading import Thread from threading import Thread
@ -15,21 +14,21 @@ from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, Button from crispy_forms.layout import HTML, Button
from django import forms from django import forms
from django.apps import apps from django.apps import apps
from django.db.models import Q
from django.conf import settings from django.conf import settings
from django.contrib import admin from django.contrib import admin
from django.contrib.contenttypes.fields import (GenericForeignKey, GenericRel, from django.contrib.contenttypes.fields import (GenericForeignKey, GenericRel,
GenericRelation) GenericRelation)
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.db.models import Q
from django.utils import six from django.utils import six
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django_filters.filterset import STRICTNESS
from floppyforms import ClearableFileInput from floppyforms import ClearableFileInput
from reversion.admin import VersionAdmin from reversion.admin import VersionAdmin
from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row
from sapl.settings import BASE_DIR, PROJECT_DIR from sapl.settings import BASE_DIR, PROJECT_DIR
sapl_logger = logging.getLogger(BASE_DIR.name) sapl_logger = logging.getLogger(BASE_DIR.name)
@ -642,4 +641,4 @@ def parlamentares_ativos(data_inicio, data_fim=None):
'parlamentar_id', 'parlamentar_id',
flat=True).distinct('parlamentar_id') flat=True).distinct('parlamentar_id')
return Parlamentar.objects.filter(id__in=parlamentares_id) return Parlamentar.objects.filter(id__in=parlamentares_id)

2
scripts/set_inicio_mandato.py

@ -7,4 +7,4 @@ def popula_campo_data_inicio():
m.save() m.save()
if __name__ == '__main__': if __name__ == '__main__':
popula_campo_data_inicio() popula_campo_data_inicio()

Loading…
Cancel
Save