Browse Source

Fix QA Tests

pull/11/merge
Edward Ribeiro 9 years ago
parent
commit
1fa81a3a2d
  1. BIN
      barcode.gif
  2. 57
      barcode.pdf
  3. 10
      barcode.py
  4. 10
      comissoes/urls.py
  5. 4
      comissoes/views.py
  6. 1
      materia/urls.py
  7. 83
      materia/views.py
  8. 7
      painel/urls.py
  9. 9
      painel/views.py
  10. 1
      parlamentares/urls.py
  11. 15
      parlamentares/views.py
  12. 5
      protocoloadm/urls.py
  13. 8
      protocoloadm/views.py
  14. 2
      sapl/settings.py
  15. 2
      sapl/urls.py

BIN
barcode.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

57
barcode.pdf

@ -0,0 +1,57 @@
%PDF-1.4
%“Œ‹ž ReportLab Generated PDF document http://www.reportlab.com
1 0 obj
<< /F1 2 0 R /F2 3 0 R /F3 4 0 R >>
endobj
2 0 obj
<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >>
endobj
3 0 obj
<< /BaseFont /Times-Roman /Encoding /WinAnsiEncoding /Name /F2 /Subtype /Type1 /Type /Font >>
endobj
4 0 obj
<< /BaseFont /Courier /Encoding /WinAnsiEncoding /Name /F3 /Subtype /Type1 /Type /Font >>
endobj
5 0 obj
<< /Contents 9 0 R /MediaBox [ 0 0 120.24 38.82282 ] /Parent 8 0 R /Resources << /Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] >> /Rotate 0 /Trans << >>
/Type /Page >>
endobj
6 0 obj
<< /Outlines 10 0 R /PageMode /UseNone /Pages 8 0 R /Type /Catalog >>
endobj
7 0 obj
<< /Author (anonymous) /CreationDate (D:20151119124244+03'00') /Creator (ReportLab PDF Library - www.reportlab.com) /Keywords () /Producer (ReportLab PDF Library - www.reportlab.com) /Subject (unspecified)
/Title () >>
endobj
8 0 obj
<< /Count 1 /Kids [ 5 0 R ] /Type /Pages >>
endobj
9 0 obj
<< /Filter [ /ASCII85Decode /FlateDecode ] /Length 541 >>
stream
Gatn&btGr>&B4*hr"!kuK&b/EAj<G-<?tCE!Zo:D>+s;p^%h%Xfb-rX(A*lXP)l0#H*>!=YX1fD;LY7i6rtC7h?\t7DFrj@;qKI)X/l!+13?l)O&%h-V*A,5Q&Ma/W`318;l]4]CW_1Hm;TF\qfSja7sW[Zo&u5Rp+a)HrQa$QdVJ)eBUFc67=DK]D%0]F2R2ki#MQo?VQT%d`VY,Y^5IZ??@trj.4cirOiSND?K&p(?c5S*!Yo^F4m^2n%X9Ld,9BJ>PY_s)g#/P`a!&7#1n<K#>i^i2lP/%sU?MS\`!]'p'X,kefT0tI-=B25/aQ!$`M7:7>!/(imA;Y;d]a1j8n<DQ8"#hLV]-=TG_le80'jr6\+#Ol,)6hbU>Y%86t).o&j6W8ZG^AL:;p\!at;D*;N$<nKE_CFPLDkJ;"CNObUKj5n>FJG:F.O"3;hGa9PmgFnRut`hPs*r@SGY_kX^[!B(JkmUCDqS@HV[t`isO2c%%FE(Ptl>=*/4=]:67rN#lShpA1;j'm5^<1`q4HY!)kArHp*~>endstream
endobj
10 0 obj
<< /Count 0 /Type /Outlines >>
endobj
xref
0 11
0000000000 65535 f
0000000075 00000 n
0000000129 00000 n
0000000239 00000 n
0000000351 00000 n
0000000459 00000 n
0000000664 00000 n
0000000752 00000 n
0000000993 00000 n
0000001055 00000 n
0000001691 00000 n
trailer
<< /ID
% ReportLab generated PDF document -- digest (http://www.reportlab.com)
[(\014\3360\267W\316\\\362\367\200\213i0\214le) (\014\3360\267W\316\\\362\367\200\213i0\214le)]
/Info 7 0 R /Root 6 0 R /Size 11 >>
startxref
1741
%%EOF

10
barcode.py

@ -1,14 +1,16 @@
from reportlab.lib.units import mm
from reportlab.graphics.barcode import createBarcodeDrawing from reportlab.graphics.barcode import createBarcodeDrawing
from reportlab.graphics.shapes import Drawing, String from reportlab.graphics.shapes import Drawing
from reportlab.graphics.charts.barcharts import HorizontalBarChart from reportlab.lib.units import mm
class BarcodeDrawing(Drawing): class BarcodeDrawing(Drawing):
def __init__(self, text_value, *args, **kw): def __init__(self, text_value, *args, **kw):
barcode = createBarcodeDrawing( barcode = createBarcodeDrawing(
'Code128', value=text_value, barHeight=10 * mm, humanReadable=True) 'Code128',
value=text_value,
barHeight=10 * mm,
humanReadable=True)
Drawing.__init__(self, barcode.width, barcode.height, *args, **kw) Drawing.__init__(self, barcode.width, barcode.height, *args, **kw)
self.add(barcode, name='barcode') self.add(barcode, name='barcode')

10
comissoes/urls.py

@ -1,7 +1,7 @@
from django.conf.urls import include, url from django.conf.urls import include, url
from comissoes.views import (ComissaoParlamentarIncluirView, ComposicaoView, from comissoes.views import (ComissaoParlamentarEditView,
ComissaoParlamentarEditView, ComissaoParlamentarIncluirView, ComposicaoView,
MateriasView, ReunioesView, cargo_crud, MateriasView, ReunioesView, cargo_crud,
comissao_crud, periodo_composicao_crud, comissao_crud, periodo_composicao_crud,
tipo_comissao_crud) tipo_comissao_crud)
@ -10,9 +10,11 @@ comissao_url_patterns = comissao_crud.urlpatterns + [
url(r'^(?P<pk>\d+)/composicao$', url(r'^(?P<pk>\d+)/composicao$',
ComposicaoView.as_view(), name='composicao'), ComposicaoView.as_view(), name='composicao'),
url(r'^(?P<pk>\d+)/composicao/(?P<id>\d+)/parlamentar$', url(r'^(?P<pk>\d+)/composicao/(?P<id>\d+)/parlamentar$',
ComissaoParlamentarIncluirView.as_view(), name='comissao_parlamentar'), ComissaoParlamentarIncluirView.as_view(),
name='comissao_parlamentar'),
url(r'^(?P<pk>\d+)/composicao/parlamentar/(?P<id>\d+)/edit$', url(r'^(?P<pk>\d+)/composicao/parlamentar/(?P<id>\d+)/edit$',
ComissaoParlamentarEditView.as_view(), name='comissao_parlamentar_edit'), ComissaoParlamentarEditView.as_view(),
name='comissao_parlamentar_edit'),
url(r'^(?P<pk>\d+)/materias$', url(r'^(?P<pk>\d+)/materias$',
MateriasView.as_view(), name='materias'), MateriasView.as_view(), name='materias'),
url(r'^(?P<pk>\d+)/reunioes$', url(r'^(?P<pk>\d+)/reunioes$',

4
comissoes/views.py

@ -240,8 +240,8 @@ class ComissaoParlamentarEditView(FormMixin, GenericView):
participacao = Participacao.objects.get(id=participacao_id) participacao = Participacao.objects.get(id=participacao_id)
comissao = Comissao.objects.get(id=self.kwargs['pk']) comissao = Comissao.objects.get(id=self.kwargs['pk'])
form = ParticipacaoCadastroForm( form = ParticipacaoCadastroForm(
initial={'parlamentar_id': participacao.parlamentar.id}, instance=participacao) initial={'parlamentar_id': participacao.parlamentar.id},
print(form) instance=participacao)
return self.render_to_response({'form': form, return self.render_to_response({'form': form,
'comissao': comissao, 'comissao': comissao,
'composicao_id': self.kwargs['id']}) 'composicao_id': self.kwargs['id']})

1
materia/urls.py

@ -1,4 +1,5 @@
from django.conf.urls import include, url from django.conf.urls import include, url
from materia.views import (AutoriaEditView, AutoriaView, from materia.views import (AutoriaEditView, AutoriaView,
DespachoInicialEditView, DespachoInicialView, DespachoInicialEditView, DespachoInicialView,
DocumentoAcessorioEditView, DocumentoAcessorioView, DocumentoAcessorioEditView, DocumentoAcessorioView,

83
materia/views.py

@ -1,8 +1,6 @@
from datetime import date, datetime from datetime import date
from re import sub from re import sub
import sapl
from comissoes.models import Comissao, Composicao
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import (HTML, ButtonHolder, Column, Fieldset, Layout, from crispy_forms.layout import (HTML, ButtonHolder, Column, Fieldset, Layout,
Submit) Submit)
@ -14,11 +12,13 @@ from django.utils.html import strip_tags
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 _
from django.views.generic import ListView from django.views.generic import ListView
from django.views.generic.detail import SingleObjectMixin
from django.views.generic.edit import FormMixin from django.views.generic.edit import FormMixin
from vanilla import GenericView
import sapl
from comissoes.models import Comissao, Composicao
from norma.models import LegislacaoCitada, NormaJuridica, TipoNormaJuridica from norma.models import LegislacaoCitada, NormaJuridica, TipoNormaJuridica
from sapl.crud import build_crud from sapl.crud import build_crud
from vanilla import GenericView
from .models import (Anexada, Autor, Autoria, DespachoInicial, from .models import (Anexada, Autor, Autoria, DespachoInicial,
DocumentoAcessorio, MateriaLegislativa, Numeracao, Orgao, DocumentoAcessorio, MateriaLegislativa, Numeracao, Orgao,
@ -284,7 +284,8 @@ class FormularioSimplificadoForm(ModelForm):
Fieldset( Fieldset(
'Identificação Básica', 'Identificação Básica',
HTML( HTML(
"<ul class='small-block-grid-3 medium-block-grid-3 large-block-grid-3'>"), "<ul class='small-block-grid-3 " +
"medium-block-grid-3 large-block-grid-3'>"),
HTML("<li>"), HTML("<li>"),
'tipo', 'tipo',
HTML("</li>"), HTML("</li>"),
@ -296,7 +297,8 @@ class FormularioSimplificadoForm(ModelForm):
HTML("</li>"), HTML("</li>"),
HTML("</ul>"), HTML("</ul>"),
HTML( HTML(
"<ul class='small-block-grid-3 medium-block-grid-3 large-block-grid-3'>"), "<ul class='small-block-grid-3 " +
"medium-block-grid-3 large-block-grid-3'>"),
HTML("<li>"), HTML("<li>"),
'data_apresentacao', 'data_apresentacao',
HTML("</li>"), HTML("</li>"),
@ -308,19 +310,22 @@ class FormularioSimplificadoForm(ModelForm):
HTML("</li>"), HTML("</li>"),
HTML("</ul>"), HTML("</ul>"),
HTML( HTML(
"<ul class='small-block-grid-1 medium-block-grid-1 large-block-grid-1'>"), "<ul class='small-block-grid-1 " +
"medium-block-grid-1 large-block-grid-1'>"),
HTML("<li>"), HTML("<li>"),
'em_tramitacao', 'em_tramitacao',
HTML("</li>"), HTML("</li>"),
HTML("</ul>"), HTML("</ul>"),
HTML( HTML(
"<ul class='small-block-grid-1 medium-block-grid-1 large-block-grid-1'>"), "<ul class='small-block-grid-1 " +
"medium-block-grid-1 large-block-grid-1'>"),
HTML("<li>"), HTML("<li>"),
'ementa', 'ementa',
HTML("</li>"), HTML("</li>"),
HTML("</ul>"), HTML("</ul>"),
HTML( HTML(
"<ul class='small-block-grid-1 medium-block-grid-1 large-block-grid-1'>"), "<ul class='small-block-grid-1 " +
"medium-block-grid-1 large-block-grid-1'>"),
HTML("<li>"), HTML("<li>"),
'texto_original', 'texto_original',
HTML("</li>"), HTML("</li>"),
@ -458,12 +463,6 @@ class FormularioCadastroView(FormMixin, GenericView):
return reverse('formulario_cadastro') return reverse('formulario_cadastro')
def get_tipos_materia():
return [('', 'Selecione')] \
+ [(t.id, t.sigla + ' - ' + t.descricao)
for t in TipoMateriaLegislativa.objects.all()]
def get_tipos_documento(): def get_tipos_documento():
return [('', 'Selecione')] \ return [('', 'Selecione')] \
+ [(t.id, t.descricao) + [(t.id, t.descricao)
@ -533,10 +532,11 @@ class MateriaAnexadaView(FormMixin, GenericView):
error = 'A matéria a ser anexada não pode ser do mesmo \ error = 'A matéria a ser anexada não pode ser do mesmo \
tipo da matéria principal.' tipo da matéria principal.'
return self.render_to_response({'error': error, return self.render_to_response(
'form': form, {'error': error,
'materialegislativa': mat_principal, 'form': form,
'anexadas': anexadas}) 'materialegislativa': mat_principal,
'anexadas': anexadas})
anexada = Anexada() anexada = Anexada()
anexada.materia_principal = mat_principal anexada.materia_principal = mat_principal
@ -551,16 +551,18 @@ class MateriaAnexadaView(FormMixin, GenericView):
except ObjectDoesNotExist: except ObjectDoesNotExist:
error = 'A matéria a ser anexada não existe no cadastro \ error = 'A matéria a ser anexada não existe no cadastro \
de matérias legislativas.' de matérias legislativas.'
return self.render_to_response({'error': error, return self.render_to_response(
'form': form, {'error': error,
'materialegislativa': mat_principal, 'form': form,
'anexadas': anexadas}) 'materialegislativa': mat_principal,
'anexadas': anexadas})
return self.form_valid(form) return self.form_valid(form)
else: else:
return self.render_to_response({'form': form, return self.render_to_response(
'materialegislativa': mat_principal, {'form': form,
'anexadas': anexadas}) 'materialegislativa': mat_principal,
'anexadas': anexadas})
def get_success_url(self): def get_success_url(self):
pk = self.kwargs['pk'] pk = self.kwargs['pk']
@ -637,13 +639,15 @@ class MateriaAnexadaEditView(FormMixin, GenericView):
except ObjectDoesNotExist: except ObjectDoesNotExist:
error = 'A matéria a ser anexada não existe no cadastro \ error = 'A matéria a ser anexada não existe no cadastro \
de matérias legislativas.' de matérias legislativas.'
return self.render_to_response({'error': error, return self.render_to_response(
'form': form, {'error': error,
'materialegislativa': mat_principal}) 'form': form,
'materialegislativa': mat_principal})
else: else:
return self.render_to_response({'form': form, return self.render_to_response(
'materialegislativa': mat_principal}) {'form': form,
'materialegislativa': mat_principal})
def get_success_url(self): def get_success_url(self):
pk = self.kwargs['pk'] pk = self.kwargs['pk']
@ -1394,7 +1398,8 @@ class TramitacaoForm(ModelForm):
self.helper.layout = Layout( self.helper.layout = Layout(
Fieldset('Incluir Tramitação', Fieldset('Incluir Tramitação',
HTML( HTML(
"<ul class='small-block-grid-2 medium-block-grid-2 large-block-grid-2'>"), "<ul class='small-block-grid-2 " +
"medium-block-grid-2 large-block-grid-2'>"),
HTML("<li>"), HTML("<li>"),
'data_tramitacao', 'data_tramitacao',
HTML("</li>"), HTML("</li>"),
@ -1403,7 +1408,8 @@ class TramitacaoForm(ModelForm):
HTML("</li>"), HTML("</li>"),
HTML("</ul>"), HTML("</ul>"),
HTML( HTML(
"<ul class='small-block-grid-3 medium-block-grid-3 large-block-grid-3'>"), "<ul class='small-block-grid-3 " +
"medium-block-grid-3 large-block-grid-3'>"),
HTML("<li>"), HTML("<li>"),
'status', 'status',
HTML("</li>"), HTML("</li>"),
@ -1415,13 +1421,15 @@ class TramitacaoForm(ModelForm):
HTML("</li>"), HTML("</li>"),
HTML("</ul>"), HTML("</ul>"),
HTML( HTML(
"<ul class='small-block-grid-1 medium-block-grid-1 large-block-grid-1'>"), "<ul class='small-block-grid-1 " +
"medium-block-grid-1 large-block-grid-1'>"),
HTML("<li>"), HTML("<li>"),
'unidade_tramitacao_destino', 'unidade_tramitacao_destino',
HTML("</li>"), HTML("</li>"),
HTML("</ul>"), HTML("</ul>"),
HTML( HTML(
"<ul class='small-block-grid-3 medium-block-grid-3 large-block-grid-3'>"), "<ul class='small-block-grid-3 " +
"medium-block-grid-3 large-block-grid-3'>"),
HTML("<li>"), HTML("<li>"),
'data_encaminhamento', 'data_encaminhamento',
HTML("</li>"), HTML("</li>"),
@ -1433,7 +1441,8 @@ class TramitacaoForm(ModelForm):
HTML("</li>"), HTML("</li>"),
HTML("</ul>"), HTML("</ul>"),
HTML( HTML(
"<ul class='small-block-grid-1 medium-block-grid-1 large-block-grid-1'>"), "<ul class='small-block-grid-1 " +
"medium-block-grid-1 large-block-grid-1'>"),
HTML("<li>"), HTML("<li>"),
'texto', 'texto',
HTML("</li>"), HTML("</li>"),

7
painel/urls.py

@ -1,8 +1,7 @@
from django.conf.urls import include, url from django.conf.urls import url
from .views import (controlador_painel, #cronometro_painel_crud, from .views import controlador_painel # cronometro_painel_crud,
cronometro_painel, from .views import (cronometro_painel, get_dados_painel, painel_mensagem_view,
get_dados_painel, painel_mensagem_view,
painel_parlamentares_view, painel_view, painel_parlamentares_view, painel_view,
painel_votacao_view) painel_votacao_view)

9
painel/views.py

@ -45,6 +45,7 @@ def controlador_painel(request):
context = {'painel': painel, 'PAINEL_TYPES': Painel.PAINEL_TYPES} context = {'painel': painel, 'PAINEL_TYPES': Painel.PAINEL_TYPES}
return render(request, 'painel/controlador.html', context) return render(request, 'painel/controlador.html', context)
def painel_view(request, pk): def painel_view(request, pk):
context = {'head_title': 'Painel Plenário', 'sessao_id': pk} context = {'head_title': 'Painel Plenário', 'sessao_id': pk}
return render(request, 'painel/index.html', {'context': context}) return render(request, 'painel/index.html', {'context': context})
@ -61,12 +62,12 @@ def painel_parlamentares_view(request):
def painel_votacao_view(request): def painel_votacao_view(request):
return render(request, 'painel/votacao.html') return render(request, 'painel/votacao.html')
def cronometro_painel(request):
print(request.GET['tipo'] + ' ' + request.GET['action']);
request.session[request.GET['tipo']] = request.GET['action']; def cronometro_painel(request):
request.session[request.GET['tipo']] = request.GET['action']
return HttpResponse({}) return HttpResponse({})
def get_cronometro_status(request, name): def get_cronometro_status(request, name):
try: try:
cronometro = request.session[name] cronometro = request.session[name]
@ -176,7 +177,7 @@ def get_dados_painel(request, pk):
"tipo_resultado": tipo_resultado, "tipo_resultado": tipo_resultado,
"votos": votos, "votos": votos,
"cronometro_aparte": cronometro_aparte, "cronometro_aparte": cronometro_aparte,
"cronometro_discurso": cronometro_discurso, "cronometro_discurso": cronometro_discurso,
"cronometro_ordem": cronometro_ordem, "cronometro_ordem": cronometro_ordem,
} }

1
parlamentares/urls.py

@ -1,4 +1,5 @@
from django.conf.urls import include, url from django.conf.urls import include, url
from parlamentares.views import (ParlamentaresView, cargo_mesa_crud, from parlamentares.views import (ParlamentaresView, cargo_mesa_crud,
coligacao_crud, legislatura_crud, coligacao_crud, legislatura_crud,
nivel_instrucao_crud, parlamentar_crud, nivel_instrucao_crud, parlamentar_crud,

15
parlamentares/views.py

@ -1,15 +1,14 @@
from django import forms from django import forms
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from sapl.crud import build_crud
from vanilla import GenericView from vanilla import GenericView
from django import forms
from sapl.crud import build_crud
from .models import (CargoMesa, Coligacao, Dependente, Filiacao, Legislatura, from .models import (CargoMesa, Coligacao, Dependente, Filiacao, Legislatura,
Mandato, NivelInstrucao, Parlamentar, Partido, Mandato, NivelInstrucao, Parlamentar, Partido,
SessaoLegislativa, SituacaoMilitar, TipoAfastamento, SessaoLegislativa, SituacaoMilitar, TipoAfastamento,
TipoDependente) TipoDependente)
cargo_mesa_crud = build_crud( cargo_mesa_crud = build_crud(
CargoMesa, 'cargo_mesa', [ CargoMesa, 'cargo_mesa', [
@ -48,6 +47,7 @@ partido_crud = build_crud(
('data_extincao', 2)]], ('data_extincao', 2)]],
]) ])
dependente_crud = build_crud( dependente_crud = build_crud(
Dependente, '', [ Dependente, '', [
@ -57,6 +57,7 @@ dependente_crud = build_crud(
[('cpf', 4), ('rg', 4), ('titulo_eleitor', 4)]], [('cpf', 4), ('rg', 4), ('titulo_eleitor', 4)]],
]) ])
sessao_legislativa_crud = build_crud( sessao_legislativa_crud = build_crud(
SessaoLegislativa, 'sessao_legislativa', [ SessaoLegislativa, 'sessao_legislativa', [
@ -69,6 +70,7 @@ sessao_legislativa_crud = build_crud(
('data_fim_intervalo', 2)]], ('data_fim_intervalo', 2)]],
]) ])
parlamentar_crud = build_crud( parlamentar_crud = build_crud(
Parlamentar, '', [ Parlamentar, '', [
@ -136,6 +138,7 @@ tipo_militar_crud = build_crud(
[('descricao', 12)]], [('descricao', 12)]],
]) ])
class ParlamentaresForm(forms.Form): class ParlamentaresForm(forms.Form):
periodo = forms.CharField() periodo = forms.CharField()
@ -145,7 +148,8 @@ class ParlamentaresView(GenericView):
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
form = ParlamentaresForm() form = ParlamentaresForm()
legislaturas = Legislatura.objects.all().order_by('-data_inicio','-data_fim') legislaturas = Legislatura.objects.all().order_by(
'-data_inicio', '-data_fim')
return self.render_to_response( return self.render_to_response(
{'legislaturas': legislaturas, {'legislaturas': legislaturas,
'legislatura_id': legislaturas.first().id, 'legislatura_id': legislaturas.first().id,
@ -156,7 +160,8 @@ class ParlamentaresView(GenericView):
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
form = ParlamentaresForm(request.POST) form = ParlamentaresForm(request.POST)
return self.render_to_response( return self.render_to_response(
{'legislaturas': Legislatura.objects.all().order_by('-data_inicio','-data_fim'), {'legislaturas': Legislatura.objects.all().order_by(
'-data_inicio', '-data_fim'),
'legislatura_id': int(form.data['periodo']), 'legislatura_id': int(form.data['periodo']),
'mandatos': Mandato.objects.all(), 'mandatos': Mandato.objects.all(),
'form': form, 'form': form,

5
protocoloadm/urls.py

@ -4,9 +4,8 @@ from protocoloadm.views import (AnularProtocoloAdmView,
DetailDocumentoAdministrativo, DetailDocumentoAdministrativo,
DocumentoAcessorioAdministrativoView, DocumentoAcessorioAdministrativoView,
PesquisarDocumentoAdministrativo, PesquisarDocumentoAdministrativo,
ProposicaoReceberView, ProposicaoView, ProposicaoDetailView, ProposicaoReceberView,
ProposicaoDetailView, ProposicaoView, ProposicoesIncorporadasView,
ProposicoesIncorporadasView,
ProposicoesNaoIncorporadasView, ProposicoesNaoIncorporadasView,
ProposicoesNaoRecebidasView, ProposicoesNaoRecebidasView,
ProtocoloDocumentoView, ProtocoloListView, ProtocoloDocumentoView, ProtocoloListView,

8
protocoloadm/views.py

@ -1,7 +1,6 @@
from datetime import date, datetime from datetime import date, datetime
from re import sub from re import sub
import sapl
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import ButtonHolder, Field, Fieldset, Layout, Submit from crispy_forms.layout import ButtonHolder, Field, Fieldset, Layout, Submit
from django import forms from django import forms
@ -17,9 +16,11 @@ from django.utils.translation import ugettext_lazy as _
from django.views.generic import DetailView, ListView from django.views.generic import DetailView, ListView
from django.views.generic.base import TemplateView from django.views.generic.base import TemplateView
from django.views.generic.edit import FormMixin from django.views.generic.edit import FormMixin
from vanilla import GenericView
import sapl
from materia.models import Proposicao, TipoMateriaLegislativa from materia.models import Proposicao, TipoMateriaLegislativa
from sapl.crud import build_crud from sapl.crud import build_crud
from vanilla import GenericView
from .models import (Autor, DocumentoAcessorioAdministrativo, from .models import (Autor, DocumentoAcessorioAdministrativo,
DocumentoAdministrativo, Protocolo, DocumentoAdministrativo, Protocolo,
@ -428,7 +429,7 @@ class ProtocoloDocumentoView(FormMixin, GenericView):
protocolo.numero_paginas = request.POST['num_paginas'] protocolo.numero_paginas = request.POST['num_paginas']
protocolo.observacao = sub( protocolo.observacao = sub(
'&nbsp;', ' ', strip_tags(request.POST['observacao'])) '&nbsp;', ' ', strip_tags(request.POST['observacao']))
return self.form_valid(form) return self.form_valid(form)
else: else:
return self.form_invalid(form) return self.form_invalid(form)
@ -589,6 +590,7 @@ class ProposicaoSimpleForm(forms.Form):
class ProposicaoView(TemplateView): class ProposicaoView(TemplateView):
template_name = "protocoloadm/proposicoes.html" template_name = "protocoloadm/proposicoes.html"
class ProposicaoDetailView(DetailView): class ProposicaoDetailView(DetailView):
template_name = "protocoloadm/proposicao_view.html" template_name = "protocoloadm/proposicao_view.html"
model = Proposicao model = Proposicao

2
sapl/settings.py

@ -119,7 +119,7 @@ USE_L10N = False
USE_TZ = True USE_TZ = True
# DATE_FORMAT = 'N j, Y' # DATE_FORMAT = 'N j, Y'
DATE_FORMAT = 'd/m/Y' DATE_FORMAT = 'd/m/Y'
SHORT_DATE_FORMAT='d/m/Y' SHORT_DATE_FORMAT = 'd/m/Y'
DATE_INPUT_FORMATS = ('%d/%m/%Y', '%m-%d-%Y', '%Y-%m-%d') DATE_INPUT_FORMATS = ('%d/%m/%Y', '%m-%d-%Y', '%Y-%m-%d')
LOCALE_PATHS = ( LOCALE_PATHS = (

2
sapl/urls.py

@ -21,7 +21,7 @@ urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='index.html')), url(r'^$', TemplateView.as_view(template_name='index.html')),
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),
url(r'', include('comissoes.urls')), url(r'', include('comissoes.urls')),
url(r'', include('sessao.urls')), url(r'', include('sessao.urls')),
url(r'', include('parlamentares.urls')), url(r'', include('parlamentares.urls')),
url(r'', include('materia.urls')), url(r'', include('materia.urls')),

Loading…
Cancel
Save