Browse Source

Fix QA issues

pull/11/merge
Edward Ribeiro 9 years ago
parent
commit
c7a2923726
  1. 1
      materia/urls.py
  2. 13
      materia/views.py
  3. 20
      protocoloadm/urls.py
  4. 4
      protocoloadm/views.py

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 (FormularioCadastroView, FormularioSimplificadoView, from materia.views import (FormularioCadastroView, FormularioSimplificadoView,
autor_crud, materia_legislativa_crud, orgao_crud, autor_crud, materia_legislativa_crud, orgao_crud,
origem_crud, regime_tramitacao_crud, origem_crud, regime_tramitacao_crud,

13
materia/views.py

@ -1,16 +1,18 @@
from datetime import date, datetime from datetime import date
from crispy_forms.helper import FormHelper from crispy_forms.helper import FormHelper
from crispy_forms.layout import ButtonHolder, Fieldset, Layout, Submit from crispy_forms.layout import ButtonHolder, Fieldset, Layout, Submit
from django import forms from django import forms
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.shortcuts import render
from django.forms import ModelForm from django.forms import ModelForm
from django.shortcuts import render
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.edit import FormMixin from django.views.generic.edit import FormMixin
from sapl.crud import build_crud
from vanilla import GenericView from vanilla import GenericView
from sapl.crud import build_crud
from .models import (Anexada, Autor, Autoria, DocumentoAcessorio, from .models import (Anexada, Autor, Autoria, DocumentoAcessorio,
MateriaLegislativa, Numeracao, Orgao, Origem, Proposicao, MateriaLegislativa, Numeracao, Orgao, Origem, Proposicao,
RegimeTramitacao, Relatoria, StatusTramitacao, TipoAutor, RegimeTramitacao, Relatoria, StatusTramitacao, TipoAutor,
@ -295,6 +297,7 @@ class FormularioSimplificadoForm(forms.Form):
# form.fields['otherFields'].widget.attrs['enabled'] = True # form.fields['otherFields'].widget.attrs['enabled'] = True
class FormularioCadastroForm(ModelForm): class FormularioCadastroForm(ModelForm):
class Meta: class Meta:
@ -437,9 +440,11 @@ class FormularioSimplificadoView(FormMixin, GenericView):
# tipo_origem_externa_id integer, # tipo_origem_externa_id integer,
# texto_original character varying(100), # texto_original character varying(100),
# duplicate key value violates unique constraint "materia_materialegislativa_tipo_id_2646a902479b4205_uniq" # duplicate key value violates unique constraint
# "materia_materialegislativa_tipo_id_2646a902479b4205_uniq"
# DETAIL: Key (tipo_id, numero, ano)=(2, 1, 2015) already exists. # DETAIL: Key (tipo_id, numero, ano)=(2, 1, 2015) already exists.
class FormularioCadastroView(FormMixin, GenericView): class FormularioCadastroView(FormMixin, GenericView):
template_name = "materia/formulario_cadastro.html" template_name = "materia/formulario_cadastro.html"

20
protocoloadm/urls.py

@ -1,10 +1,11 @@
from django.conf.urls import include, url from django.conf.urls import include, url
from protocoloadm.views import (AnularProtocoloAdmView, ProtocoloDocumentoView, from protocoloadm.views import (AnularProtocoloAdmView, ProposicaoReceberView,
ProtocoloListView, ProtocoloMateriaView, ProposicoesIncorporadasView,
ProtocoloPesquisaView, ProposicoesNaoIncorporadasView,
ProposicaoReceberView, ProposicoesIncorporadasView, ProposicoesNaoRecebidasView,
ProposicoesNaoIncorporadasView, ProposicoesNaoRecebidasView, ProtocoloDocumentoView, ProtocoloListView,
ProtocoloMateriaView, ProtocoloPesquisaView,
documento_acessorio_administrativo_crud, documento_acessorio_administrativo_crud,
documento_administrativo_crud, documento_administrativo_crud,
protocolo_documento_crud, protocolo_documento_crud,
@ -45,9 +46,12 @@ urlpatterns = [
url(r'^protocoloadm/proposicao-receber', url(r'^protocoloadm/proposicao-receber',
ProposicaoReceberView.as_view(), name='proposicao_receber'), ProposicaoReceberView.as_view(), name='proposicao_receber'),
url(r'^protocoloadm/proposicoes-naorecebidas', url(r'^protocoloadm/proposicoes-naorecebidas',
ProposicoesNaoRecebidasView.as_view(), name='proposicoes_naorecebidas'), ProposicoesNaoRecebidasView.as_view(),
name='proposicoes_naorecebidas'),
url(r'^protocoloadm/proposicoes-naoincorporadas', url(r'^protocoloadm/proposicoes-naoincorporadas',
ProposicoesNaoIncorporadasView.as_view(), name='proposicoes_naoincorporadas'), ProposicoesNaoIncorporadasView.as_view(),
name='proposicoes_naoincorporadas'),
url(r'^protocoloadm/proposicoes-incorporadas', url(r'^protocoloadm/proposicoes-incorporadas',
ProposicoesIncorporadasView.as_view(), name='proposicoes_incorporadas'), ProposicoesIncorporadasView.as_view(),
name='proposicoes_incorporadas'),
] ]

4
protocoloadm/views.py

@ -12,7 +12,6 @@ from django.utils.translation import ugettext_lazy as _
from django.views.generic import ListView from django.views.generic import 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 from vanilla import GenericView
from materia.models import TipoMateriaLegislativa from materia.models import TipoMateriaLegislativa
@ -502,12 +501,15 @@ class ProtocoloMateriaView(FormMixin, GenericView):
# TODO: move to Proposicao app # TODO: move to Proposicao app
class ProposicaoReceberView(TemplateView): class ProposicaoReceberView(TemplateView):
template_name = "protocoloadm/proposicao_receber.html" template_name = "protocoloadm/proposicao_receber.html"
class ProposicoesNaoRecebidasView(TemplateView): class ProposicoesNaoRecebidasView(TemplateView):
template_name = "protocoloadm/proposicoes_naorecebidas.html" template_name = "protocoloadm/proposicoes_naorecebidas.html"
class ProposicoesNaoIncorporadasView(TemplateView): class ProposicoesNaoIncorporadasView(TemplateView):
template_name = "protocoloadm/proposicoes_naoincorporadas.html" template_name = "protocoloadm/proposicoes_naoincorporadas.html"

Loading…
Cancel
Save