Browse Source

Merge branch 'master' into 738-refatorar-proposicoes

pull/752/head
LeandroRoberto 8 years ago
parent
commit
1576660102
  1. 1
      README.rst
  2. 14029
      echo
  3. 3
      sapl/api/forms.py
  4. 1
      sapl/api/urls.py
  5. 8
      sapl/api/views.py
  6. 8
      sapl/base/forms.py
  7. 3
      sapl/base/templatetags/menus.py
  8. 2
      sapl/base/urls.py
  9. 4
      sapl/base/views.py
  10. 2
      sapl/comissoes/views.py
  11. 7
      sapl/compilacao/views.py
  12. 5
      sapl/crud/base.py
  13. 16
      sapl/materia/forms.py
  14. 4
      sapl/materia/tests/test_materia.py
  15. 5
      sapl/materia/urls.py
  16. 30
      sapl/materia/views.py
  17. 5
      sapl/parlamentares/views.py
  18. 3
      sapl/protocoloadm/forms.py
  19. 3
      sapl/protocoloadm/models.py
  20. 14
      sapl/protocoloadm/views.py
  21. 2
      sapl/relatorios/templates/pdf_espelho_preparar_pysc.py
  22. 7
      sapl/relatorios/views.py
  23. 4
      sapl/sessao/models.py
  24. 1
      sapl/sessao/views.py
  25. 3
      sapl/settings.py
  26. BIN
      sapl/static/img/pdflogo.png
  27. 2
      sapl/templates/index.html
  28. 6
      sapl/templates/materia/em_lote/acessorio.html
  29. 6
      sapl/templates/materia/em_lote/tramitacao.html
  30. 6
      sapl/templates/materia/relatoria_form.html
  31. 2
      sapl/templates/sessao/pauta_sessao_filter.html
  32. 3
      sapl/test_urls.py
  33. 14
      sapl/utils.py
  34. 1
      scripts/inicializa_grupos_autorizacoes.py

1
README.rst

@ -1,6 +1,7 @@
.. image:: https://travis-ci.org/interlegis/sapl.svg?branch=master
:target: https://travis-ci.org/interlegis/sapl
***********************************************
SAPL - Sistema de Apoio ao Processo Legislativo
***********************************************

14029
echo

File diff suppressed because it is too large

3
sapl/api/forms.py

@ -1,9 +1,6 @@
from django.db.models import Q
from django_filters.filters import MethodFilter, ModelChoiceFilter
from rest_framework.filters import FilterSet
from sapl.base.models import Autor, TipoAutor
from sapl.utils import generic_relations_for_model

1
sapl/api/urls.py

@ -7,7 +7,6 @@ from sapl.api.views import MateriaLegislativaViewSet, AutorListView,\
from .apps import AppConfig
app_name = AppConfig.name

8
sapl/api/views.py

@ -1,13 +1,9 @@
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from django.http import Http404
from django.utils.translation import ugettext_lazy as _
from rest_framework.filters import DjangoFilterBackend
from rest_framework.generics import ListAPIView
from rest_framework.mixins import ListModelMixin, RetrieveModelMixin
from rest_framework.permissions import IsAuthenticated, AllowAny
from rest_framework.viewsets import GenericViewSet
@ -15,6 +11,7 @@ from rest_framework.viewsets import GenericViewSet
from sapl.api.forms import AutorChoiceFilterSet
from sapl.api.serializers import ChoiceSerializer, AutorSerializer,\
AutorChoiceSerializer, ModelChoiceSerializer, MateriaLegislativaSerializer
from sapl.base.models import Autor, TipoAutor
from sapl.materia.models import MateriaLegislativa
from sapl.utils import SaplGenericRelation, sapl_logger
@ -61,7 +58,10 @@ class AutorListView(ListAPIView):
de Autores mas feito para Possíveis Autores armazenados
segundo o ContentType associado ao Tipo de Autor via
relacionamento genérico.
<<<<<<< HEAD
=======
>>>>>>> master
Busca feita sem django-filter processada no get_queryset
-> processo no cadastro de autores para seleção e busca
dos possíveis autores

8
sapl/base/forms.py

@ -1,4 +1,3 @@
from crispy_forms.bootstrap import FieldWithButtons, InlineRadios, StrictButton
from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, Button, Div, Field, Fieldset, Layout, Row
@ -18,6 +17,8 @@ from django.forms import ModelForm
from django.utils.translation import ugettext_lazy as _, string_concat
import django_filters
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import string_concat
from sapl.base.models import Autor, TipoAutor
from sapl.crispy_layout_mixin import (SaplFormLayout, form_actions, to_column,
@ -31,10 +32,8 @@ from sapl.utils import (RANGE_ANOS, ImageThumbnailFileInput,
SaplGenericRelation, models_with_gr_for_model,
ChoiceWithoutValidationField)
from .models import AppConfig, CasaLegislativa
ACTION_CREATE_USERS_AUTOR_CHOICE = [
('C', _('Criar novo Usuário')),
('A', _('Associar um usuário existente')),
@ -149,7 +148,8 @@ class AutorForm(ModelForm):
autor_select = Row(to_column(('tipo', 3)),
Div(to_column(('nome', 5)),
to_column(('cargo', 4)), css_class="div_nome_cargo"),
to_column(('cargo', 4)),
css_class="div_nome_cargo"),
to_column((autor_related, 9)),
to_column((Div(
Field('autor_related'),

3
sapl/base/templatetags/menus.py

@ -1,11 +1,10 @@
import yaml
from django import template
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
import yaml
from sapl.utils import sapl_logger
register = template.Library()

2
sapl/base/urls.py

@ -3,7 +3,7 @@ from django.contrib.auth import views
from django.contrib.auth.decorators import permission_required
from django.views.generic.base import TemplateView
from sapl.base.views import AutorCrud, TipoAutorCrud, ConfirmarEmailView
from sapl.base.views import AutorCrud, ConfirmarEmailView, TipoAutorCrud
from .apps import AppConfig
from .forms import LoginForm

4
sapl/base/views.py

@ -9,12 +9,10 @@ from django.core.urlresolvers import reverse
from django.db.models import Count, Q
from django.http import HttpResponseRedirect
from django.utils.encoding import force_bytes
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
from django.utils.http import urlsafe_base64_decode, urlsafe_base64_encode
from django.utils.translation import ugettext_lazy as _
from django.views.generic.base import TemplateView
from django_filters.views import FilterView
from sapl.base.forms import AutorForm, TipoAutorForm, AutorFormForAdmin
from sapl.base.models import Autor, TipoAutor

2
sapl/comissoes/views.py

@ -3,7 +3,7 @@ from django.core.urlresolvers import reverse
from django.db.models import F
from django.views.generic import ListView
from sapl.crud.base import Crud, CrudAux, MasterDetailCrud, RP_DETAIL, RP_LIST
from sapl.crud.base import RP_DETAIL, RP_LIST, Crud, CrudAux, MasterDetailCrud
from sapl.materia.models import MateriaLegislativa, Tramitacao
from .models import (CargoComissao, Comissao, Composicao, Participacao,

7
sapl/compilacao/views.py

@ -1,7 +1,7 @@
from collections import OrderedDict
from datetime import datetime, timedelta
import logging
import sys
from collections import OrderedDict
from datetime import datetime, timedelta
from braces.views import FormMessagesMixin
from django import forms
@ -20,8 +20,8 @@ from django.shortcuts import get_object_or_404, redirect
from django.utils.dateparse import parse_date
from django.utils.decorators import method_decorator
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 string_concat
from django.views.generic.base import TemplateView
from django.views.generic.detail import DetailView
from django.views.generic.edit import (CreateView, DeleteView, FormView,
@ -49,7 +49,6 @@ from sapl.compilacao.utils import (DISPOSITIVO_SELECT_RELATED,
from sapl.crud.base import Crud, CrudListView, make_pagination
from sapl.settings import BASE_DIR
TipoNotaCrud = Crud.build(TipoNota, 'tipo_nota')
TipoVideCrud = Crud.build(TipoVide, 'tipo_vide')
TipoPublicacaoCrud = Crud.build(TipoPublicacao, 'tipo_publicacao')

5
sapl/crud/base.py

@ -16,8 +16,8 @@ from django.http.response import Http404
from django.shortcuts import redirect
from django.utils.decorators import classonlymethod
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 string_concat
from django.views.generic import (CreateView, DeleteView, DetailView, ListView,
UpdateView)
from django.views.generic.base import ContextMixin
@ -27,7 +27,6 @@ from sapl.crispy_layout_mixin import CrispyLayoutFormMixin, get_field_display
from sapl.settings import BASE_DIR
from sapl.utils import normalize
logger = logging.getLogger(BASE_DIR.name)
ACTION_LIST, ACTION_CREATE, ACTION_DETAIL, ACTION_UPDATE, ACTION_DELETE = \
@ -1311,7 +1310,7 @@ class MasterDetailCrud(Crud):
if hasattr(obj, 'parent_field'):
parent_field = obj.parent_field.split('__')
if not obj.is_m2m or len(parent_field) > 1:
field = self.model._meta.get_field(parent_field[0])
# field = self.model._meta.get_field(parent_field[0])
if isinstance(getattr(
self.object, parent_field[0]), models.Model):

16
sapl/materia/forms.py

@ -4,6 +4,7 @@ import os
from crispy_forms.bootstrap import Alert, InlineCheckboxes, FormActions,\
InlineRadios
import django_filters
from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, Button, Column, Fieldset, Layout, Row,\
Field, Submit
@ -16,7 +17,6 @@ from django.db.models import Max
from django.forms import ModelForm, widgets
from django.forms.forms import Form
from django.utils.translation import ugettext_lazy as _
import django_filters
from sapl.base.models import Autor
from sapl.comissoes.models import Comissao
@ -33,10 +33,10 @@ from sapl.utils import (RANGE_ANOS, RangeWidgetOverride, autor_label,
ChoiceWithoutValidationField, YES_NO_CHOICES)
import sapl
from .models import (AcompanhamentoMateria, Anexada, Autoria,
DespachoInicial, DocumentoAcessorio, MateriaLegislativa,
Numeracao, Proposicao, Relatoria, TipoMateriaLegislativa,
Tramitacao, UnidadeTramitacao)
from .models import (AcompanhamentoMateria, Anexada, Autoria, DespachoInicial,
DocumentoAcessorio, MateriaLegislativa, Numeracao,
Proposicao, Relatoria, TipoMateriaLegislativa, Tramitacao,
UnidadeTramitacao)
def ANO_CHOICES():
@ -499,6 +499,10 @@ class MateriaLegislativaFilterSet(django_filters.FilterSet):
ementa = django_filters.CharFilter(lookup_expr='icontains')
em_tramitacao = django_filters.ChoiceFilter(required=False,
label=u'Ano da Matéria',
choices=em_tramitacao)
class Meta:
model = MateriaLegislativa
fields = ['numero',
@ -565,7 +569,7 @@ class MateriaLegislativaFilterSet(django_filters.FilterSet):
'limpar Autor',
css_class='btn btn-primary btn-sm'), 10)])
row5 = to_row(
[('autoria__autor__tipo', 6),
[('autoria__autor__tipo', 12),
# ('autoria__autor__partido', 6)
])
row6 = to_row(

4
sapl/materia/tests/test_materia.py

@ -1,10 +1,10 @@
import pytest
from django.contrib.auth import get_user_model
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from model_mommy import mommy
import pytest
from sapl.base.models import TipoAutor, Autor
from sapl.base.models import Autor, TipoAutor
from sapl.comissoes.models import Comissao, TipoComissao
from sapl.materia.models import (Anexada, Autoria, DespachoInicial,
DocumentoAcessorio, MateriaLegislativa,

5
sapl/materia/urls.py

@ -3,9 +3,8 @@ from django.conf.urls import include, url
from sapl.materia.views import (AcompanhamentoConfirmarView,
AcompanhamentoExcluirView,
AcompanhamentoMateriaView, AnexadaCrud,
AutoriaCrud,
ConfirmarProposicao, DespachoInicialCrud,
DocumentoAcessorioCrud,
AutoriaCrud, ConfirmarProposicao,
DespachoInicialCrud, DocumentoAcessorioCrud,
DocumentoAcessorioEmLoteView,
LegislacaoCitadaCrud, MateriaLegislativaCrud,
MateriaLegislativaPesquisaView, MateriaTaView,

30
sapl/materia/views.py

@ -5,7 +5,6 @@ from string import ascii_letters, digits
from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist,\
PermissionDenied
@ -37,11 +36,13 @@ from sapl.materia.forms import AnexadaForm, LegislacaoCitadaForm,\
from sapl.norma.models import LegislacaoCitada
from sapl.utils import (TURNO_TRAMITACAO_CHOICES, YES_NO_CHOICES, autor_label,
autor_modal, gerar_hash_arquivo, get_base_url,
montar_row_autor, permission_required_for_app,
permissoes_autor, permissoes_materia,
permissoes_protocoloadm, permission_required_for_app,
montar_row_autor)
import sapl
from .forms import (AcessorioEmLoteFilterSet, AcompanhamentoMateriaForm,
DocumentoAcessorioForm,
MateriaLegislativaFilterSet,
@ -130,7 +131,6 @@ def recuperar_materia(request):
OrgaoCrud = CrudAux.build(Orgao, 'orgao')
StatusTramitacaoCrud = CrudAux.build(StatusTramitacao, 'status_tramitacao')
UnidadeTramitacaoCrud = CrudAux.build(UnidadeTramitacao, 'unidade_tramitacao')
class TipoProposicaoCrud(CrudAux):
@ -341,6 +341,32 @@ class ConfirmarProposicao(PermissionRequiredForAppCrudMixin, UpdateView):
return context
class UnidadeTramitacaoCrud(CrudAux):
model = UnidadeTramitacao
help_path = 'unidade_tramitacao'
class BaseMixin(Crud.BaseMixin):
list_field_names = ['comissao', 'orgao', 'parlamentar']
class ListView(Crud.ListView):
template_name = "crud/list.html"
def get_headers(self):
return [_('Unidade de Tramitação')]
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
for row in context['rows']:
if row[0][0]: # Comissão
pass
elif row[1][0]: # Órgão
row[0] = (row[1][0], row[0][1])
elif row[2][0]: # Parlamentar
row[0] = (row[2][0], row[0][1])
row[1], row[2] = ('', ''), ('', '')
return context
class ProposicaoCrud(Crud):
model = Proposicao
help_path = ''

5
sapl/parlamentares/views.py

@ -12,9 +12,8 @@ from sapl.crud.base import (RP_CHANGE, RP_DETAIL, RP_LIST, Crud, CrudAux,
from sapl.materia.models import Proposicao, Relatoria
from sapl.parlamentares.apps import AppConfig
from .forms import (FiliacaoForm, LegislaturaCreateForm,
LegislaturaUpdateForm, ParlamentarCreateForm,
ParlamentarForm)
from .forms import (FiliacaoForm, LegislaturaCreateForm, LegislaturaUpdateForm,
ParlamentarCreateForm, ParlamentarForm)
from .models import (CargoMesa, Coligacao, ComposicaoColigacao, ComposicaoMesa,
Dependente, Filiacao, Frente, Legislatura, Mandato,
NivelInstrucao, Parlamentar, Partido, SessaoLegislativa,

3
sapl/protocoloadm/forms.py

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

3
sapl/protocoloadm/models.py

@ -5,6 +5,7 @@ from django.utils.translation import ugettext_lazy as _
from model_utils import Choices
from sapl.base.models import Autor
from sapl.materia.models import (TipoMateriaLegislativa,
UnidadeTramitacao)
from sapl.utils import RANGE_ANOS, YES_NO_CHOICES, texto_upload_path
@ -190,8 +191,6 @@ class TramitacaoAdministrativo(models.Model):
blank=True, null=True, verbose_name=_('Data Encaminhamento'))
unidade_tramitacao_destino = models.ForeignKey(
UnidadeTramitacao,
blank=True,
null=True,
related_name='adm_tramitacoes_destino',
verbose_name=_('Unidade Destino'))
texto = models.TextField(

14
sapl/protocoloadm/views.py

@ -1,13 +1,11 @@
from datetime import date, datetime
import json
from braces.views import FormValidMessageMixin
from django.contrib import messages
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.db.models import Max, Q
from django.http import HttpResponse, HttpResponseRedirect
from django.db.models import Max
from django.http import HttpResponseRedirect
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from django.views.generic import CreateView, DetailView, FormView, ListView
@ -15,7 +13,7 @@ from django.views.generic.base import TemplateView
from django_filters.views import FilterView
from sapl.base.apps import AppConfig as AppsAppConfig
from sapl.base.models import AppConfig, Autor
from sapl.base.models import AppConfig
from sapl.crud.base import Crud, CrudAux, MasterDetailCrud, make_pagination
from sapl.materia.models import TipoMateriaLegislativa
from sapl.utils import (create_barcode, get_client_ip, permissoes_adm,
@ -26,12 +24,10 @@ from .forms import (AnularProcoloAdmForm, DocumentoAcessorioAdministrativoForm,
DocumentoAdministrativoForm, ProtocoloDocumentForm,
ProtocoloFilterSet, ProtocoloMateriaForm,
TramitacaoAdmEditForm, TramitacaoAdmForm)
from .models import (DocumentoAcessorioAdministrativo,
DocumentoAdministrativo, Protocolo,
StatusTramitacaoAdministrativo,
from .models import (DocumentoAcessorioAdministrativo, DocumentoAdministrativo,
Protocolo, StatusTramitacaoAdministrativo,
TipoDocumentoAdministrativo, TramitacaoAdministrativo)
TipoDocumentoAdministrativoCrud = CrudAux.build(
TipoDocumentoAdministrativo, '')

2
sapl/relatorios/templates/pdf_espelho_preparar_pysc.py

@ -60,7 +60,7 @@ if REQUEST.txt_check=='1':
REQUEST=context.REQUEST
for materia in context.zsql.materia_obter_zsql(cod_materia=cod_mat):
dic={}
dic['titulo']="INDICAÇÃO: "+str(materia.num_ident_basica)+" "+str(materia.ano_ident_basica)
dic['titulo']="INDICAÇÃO: "+str(materia.num_ident_basica)+" "+str(materia.ano_ident_basica)
dic['materia']=str(materia.num_ident_basica)+"/"+str(materia.ano_ident_basica)
dic['dat_apresentacao']=materia.dat_apresentacao
dic['txt_ementa']=materia.txt_ementa

7
sapl/relatorios/views.py

@ -1,10 +1,12 @@
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 _
from sapl.base.models import CasaLegislativa, Autor
from sapl.base.models import Autor, CasaLegislativa
from sapl.comissoes.models import Comissao
from sapl.materia.models import (Autoria, MateriaLegislativa, Numeracao,
Tramitacao, UnidadeTramitacao)
@ -783,7 +785,10 @@ def relatorio_sessao_plenaria(request, pk):
rodape = get_rodape(casa)
imagem = get_imagem(casa)
try:
sessao = SessaoPlenaria.objects.get(id=pk)
except ObjectDoesNotExist:
raise Http404('Essa página não existe')
(inf_basicas_dic,
lst_mesa,

4
sapl/sessao/models.py

@ -6,8 +6,8 @@ from sapl.base.models import Autor
from sapl.materia.models import MateriaLegislativa
from sapl.parlamentares.models import (CargoMesa, Legislatura, Parlamentar,
Partido, SessaoLegislativa)
from sapl.utils import YES_NO_CHOICES, restringe_tipos_de_arquivo_txt,\
SaplGenericRelation
from sapl.utils import (YES_NO_CHOICES, SaplGenericRelation,
restringe_tipos_de_arquivo_txt)
class CargoBancada(models.Model):

1
sapl/sessao/views.py

@ -45,7 +45,6 @@ from .models import (Bancada, Bloco, CargoBancada, CargoMesa,
SessaoPlenariaPresenca, TipoExpediente,
TipoResultadoVotacao, TipoSessaoPlenaria, VotoParlamentar)
TipoSessaoCrud = CrudAux.build(TipoSessaoPlenaria, 'tipo_sessao_plenaria')
TipoExpedienteCrud = CrudAux.build(TipoExpediente, 'tipo_expediente')
CargoBancadaCrud = CrudAux.build(CargoBancada, '')

3
sapl/settings.py

@ -23,7 +23,6 @@ from unipath import Path
from .temp_suppress_crispy_form_warnings import \
SUPRESS_CRISPY_FORM_WARNINGS_LOGGING
BASE_DIR = Path(__file__).ancestor(1)
PROJECT_DIR = Path(__file__).ancestor(2)
@ -98,7 +97,7 @@ MIDDLEWARE_CLASSES = (
REST_FRAMEWORK = {
"DEFAULT_RENDERER_CLASSES": (
"rest_framework.renderers.JSONRenderer",
#"rest_framework.renderers.BrowsableAPIRenderer",
# "rest_framework.renderers.BrowsableAPIRenderer",
),
"DEFAULT_PARSER_CLASSES": (
"rest_framework.parsers.JSONParser",

BIN
sapl/static/img/pdflogo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 KiB

2
sapl/templates/index.html

@ -156,7 +156,7 @@
Contém informações estatísticas sobre a produção legislativa dos parlamentares e da Casa, dispostas e agrupadas de diferentes formas de acordo com parâmetros fornecidos.
</p>
</div>
<a href="/relatorios"></a>
<a href="/sistema/relatorios/"></a>
</div>
</div>
</div>

6
sapl/templates/materia/em_lote/acessorio.html

@ -14,9 +14,6 @@
{% else %}
<h3 style="text-align: right;">{% blocktrans with object_list.count as total_materias %}Foram encontradas {{total_materias}} matérias.{% endblocktrans %}</h3>
{% endif %}
{% else %}
<tr><td><h3 style="text-align: right;">Nenhuma matéria encontrada.</h3></td></tr>
{% endif %}
<form method="POST">
{% csrf_token %}
<fieldset>
@ -96,5 +93,8 @@
</fieldset>
<input type="submit" value="Salvar" class="btn btn-primary"S>
</form>
{% else %}
<tr><td><h3 style="text-align: right;">Nenhuma matéria encontrada.</h3></td></tr>
{% endif %}
{% endif %}
{% endblock detail_content %}

6
sapl/templates/materia/em_lote/tramitacao.html

@ -14,9 +14,6 @@
{% else %}
<h3 style="text-align: right;">Foram encontradas {{object_list|length}} matérias.</h3>
{% endif %}
{% else %}
<tr><td><h3 style="text-align: right;">Nenhuma matéria encontrada.</h3></td></tr>
{% endif %}
<form method="POST">
{% csrf_token %}
<fieldset>
@ -113,5 +110,8 @@
</fieldset>
<input type="submit" value="Salvar" class="btn btn-primary"S>
</form>
{% else %}
<tr><td><h3 style="text-align: right;">Nenhuma matéria encontrada.</h3></td></tr>
{% endif %}
{% endif %}
{% endblock detail_content %}

6
sapl/templates/materia/relatoria_form.html

@ -12,3 +12,9 @@
{% crispy form %}
{% endif %}
{% endblock %}
{% block extra_js %}
<script language="Javascript">
$("#id_comissao").attr("disabled", true);
</script>
{% endblock extra_js %}

2
sapl/templates/sessao/pauta_sessao_filter.html

@ -24,7 +24,7 @@
{% for s in page_obj %}
<tr>
<td><a href="{% url 'sapl.sessao:pauta_sessao_detail' s.id %}"><strong>{{s}}</strong></br></a></td><td>
<a href="{% url 'sapl.relatorios:relatorio_sessao_plenaria' s.id %}"><img src="{% static 'img/file.png' %}"></a>
<a href="{% url 'sapl.relatorios:relatorio_sessao_plenaria' s.id %}"><img height="30" width="30" src="{% static 'img/pdflogo.png' %}"></a>
</td>
</tr>
{% endfor %}

3
sapl/test_urls.py

@ -5,13 +5,10 @@ from django.contrib.auth.management import _get_all_permissions
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.db import transaction
from django.utils.translation import string_concat
from django.utils.translation import string_concat
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import string_concat
from sapl.crud.base import PermissionRequiredForAppCrudMixin
from sapl.materia.views import recuperar_materia
from scripts.inicializa_grupos_autorizacoes import cria_grupos_permissoes
from scripts.lista_urls import lista_urls

14
sapl/utils.py

@ -1,10 +1,14 @@
import hashlib
import logging
from datetime import date
from functools import wraps
from unicodedata import normalize as unicodedata_normalize
import hashlib
import logging
import re
import magic
from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML, Button
from django import forms
@ -19,12 +23,12 @@ from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied, ValidationError
from django.utils.translation import ugettext_lazy as _
from floppyforms import ClearableFileInput
import magic
from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row
from sapl.settings import BASE_DIR
sapl_logger = logging.getLogger(BASE_DIR.name)
@ -131,8 +135,10 @@ class SaplGenericRelation(GenericRelation):
)
[ref_1]: https://docs.djangoproject.com/el/1.10/topics/db/queries/#field-lookups
[ref_2]: https://github.com/interlegis/sapl/blob/master/sapl/parlamentares/models.py
[ref_1]: https://docs.djangoproject.com/el/1.10/topics/db/queries/
#field-lookups
[ref_2]: https://github.com/interlegis/sapl/blob/master/sapl/
parlamentares/models.py
"""
def __init__(self, to, fields_search=(), **kwargs):
@ -146,7 +152,7 @@ class SaplGenericRelation(GenericRelation):
for field in fields_search:
# descomente para ver todas os campos que são elementos de busca
#print(kwargs['related_query_name'], field)
# print(kwargs['related_query_name'], field)
assert isinstance(field, (tuple, list)), _(
'fields_search deve ser um array de tuplas ou listas.')

1
scripts/inicializa_grupos_autorizacoes.py

@ -10,7 +10,6 @@ if True:
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.contrib.contenttypes.models import ContentType
from sapl.base.models import Autor
class InicializaGruposAutorizacoes():

Loading…
Cancel
Save