Browse Source

Pequenos ajustes

pull/776/head
Edward Ribeiro 8 years ago
parent
commit
1d52849fe9
  1. 3
      sapl/compilacao/views.py
  2. 7
      sapl/crud/base.py
  3. 2
      sapl/materia/views.py
  4. 3
      sapl/parlamentares/views.py
  5. 8
      sapl/rules/tests/test_rules.py
  6. 2
      sapl/sessao/views.py
  7. 1
      scripts/lista_permissions_in_decorators.py

3
sapl/compilacao/views.py

@ -53,8 +53,7 @@ TipoNotaCrud = Crud.build(TipoNota, 'tipo_nota')
TipoVideCrud = Crud.build(TipoVide, 'tipo_vide') TipoVideCrud = Crud.build(TipoVide, 'tipo_vide')
TipoPublicacaoCrud = Crud.build(TipoPublicacao, 'tipo_publicacao') TipoPublicacaoCrud = Crud.build(TipoPublicacao, 'tipo_publicacao')
VeiculoPublicacaoCrud = Crud.build(VeiculoPublicacao, 'veiculo_publicacao') VeiculoPublicacaoCrud = Crud.build(VeiculoPublicacao, 'veiculo_publicacao')
TipoDispositivoCrud = Crud.build( TipoDispositivoCrud = Crud.build(TipoDispositivo, 'tipo_dispositivo')
TipoDispositivo, 'tipo_dispositivo')
logger = logging.getLogger(BASE_DIR.name) logger = logging.getLogger(BASE_DIR.name)

7
sapl/crud/base.py

@ -16,20 +16,19 @@ 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
from django.views.generic.list import MultipleObjectMixin from django.views.generic.list import MultipleObjectMixin
from sapl.crispy_layout_mixin import CrispyLayoutFormMixin, get_field_display from sapl.crispy_layout_mixin import CrispyLayoutFormMixin, get_field_display
from sapl.rules.map_rules import (RP_ADD, RP_CHANGE, RP_DELETE, from sapl.rules.map_rules import (RP_ADD, RP_CHANGE, RP_DELETE, RP_DETAIL,
RP_DETAIL, RP_LIST) RP_LIST)
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 = \

2
sapl/materia/views.py

@ -84,7 +84,7 @@ class MateriaTaView(IntegracaoTaView):
class ProposicaoTaView(IntegracaoTaView): class ProposicaoTaView(IntegracaoTaView):
model = Proposicao model = Proposicao
model_type_foreignkey = TipoProposicao model_type_foreignkey = TipoProposicao
# TODO implmentar o mapa de fields e utiliza-lo em IntegracaoTaView # TODO implementar o mapa de fields e utiliza-lo em IntegracaoTaView
fields = { fields = {
} }

3
sapl/parlamentares/views.py

@ -64,8 +64,7 @@ class ProposicaoParlamentarCrud(CrudBaseForListAndDetailExternalAppView):
class ListView(CrudBaseForListAndDetailExternalAppView.ListView): class ListView(CrudBaseForListAndDetailExternalAppView.ListView):
def get_queryset(self): def get_queryset(self):
return super().get_queryset().filter( return super().get_queryset().filter(data_envio__isnull=False)
data_envio__isnull=False)
class ParticipacaoParlamentarCrud(CrudBaseForListAndDetailExternalAppView): class ParticipacaoParlamentarCrud(CrudBaseForListAndDetailExternalAppView):

8
sapl/rules/tests/test_rules.py

@ -7,11 +7,11 @@ from django.utils import six
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from sapl.base.models import CasaLegislativa, ProblemaMigracao from sapl.base.models import CasaLegislativa, ProblemaMigracao
from sapl.compilacao.models import TipoDispositivo,\ from sapl.compilacao.models import (PerfilEstruturalTextoArticulado,
PerfilEstruturalTextoArticulado, TipoDispositivoRelationship TipoDispositivo,
TipoDispositivoRelationship)
from sapl.materia.models import AcompanhamentoMateria from sapl.materia.models import AcompanhamentoMateria
from sapl.rules import SAPL_GROUPS from sapl.rules import SAPL_GROUPS, map_rules
from sapl.rules import map_rules
from sapl.test_urls import create_perms_post_migrate from sapl.test_urls import create_perms_post_migrate
from scripts.lista_permissions_in_decorators import \ from scripts.lista_permissions_in_decorators import \
lista_permissions_in_decorators lista_permissions_in_decorators

2
sapl/sessao/views.py

@ -70,7 +70,7 @@ def reordernar_materias_expediente(request, pk):
def reordernar_materias_ordem(request, pk): def reordernar_materias_ordem(request, pk):
ordens = OrdemDia.objects.filter( ordens = OrdemDia.objects.filter(
sessao_plenaria_id=pk) sessao_plenaria_id=pk)
for ordem_num, o in enumerate(ordens,1): for ordem_num, o in enumerate(ordens, 1):
o.numero_ordem = ordem_num o.numero_ordem = ordem_num
o.save() o.save()

1
scripts/lista_permissions_in_decorators.py

@ -2,7 +2,6 @@ import ast
import inspect import inspect
import os import os
if __name__ == '__main__': if __name__ == '__main__':
import django import django

Loading…
Cancel
Save