Browse Source

Fix QA issues

pull/11/merge
Edward Ribeiro 9 years ago
parent
commit
c7a2923726
  1. 1
      materia/urls.py
  2. 69
      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,

69
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:
@ -410,35 +413,37 @@ class FormularioSimplificadoView(FormMixin, GenericView):
return self.render_to_response({'form': form}) return self.render_to_response({'form': form})
# id serial NOT NULL, # id serial NOT NULL,
# numero integer NOT NULL, # numero integer NOT NULL,
# ano smallint NOT NULL, # ano smallint NOT NULL,
# numero_protocolo integer, # numero_protocolo integer,
# data_apresentacao date, # data_apresentacao date,
# tipo_apresentacao character varying(1), # tipo_apresentacao character varying(1),
# data_publicacao date, # data_publicacao date,
# numero_origem_externa character varying(5), # numero_origem_externa character varying(5),
# ano_origem_externa smallint, # ano_origem_externa smallint,
# data_origem_externa date, # data_origem_externa date,
# apelido character varying(50), # apelido character varying(50),
# dias_prazo integer, # dias_prazo integer,
# data_fim_prazo date, # data_fim_prazo date,
# em_tramitacao boolean NOT NULL, # em_tramitacao boolean NOT NULL,
# polemica boolean, # polemica boolean,
# objeto character varying(150), # objeto character varying(150),
# complementar boolean, # complementar boolean,
# ementa text NOT NULL, # ementa text NOT NULL,
# indexacao text, # indexacao text,
# observacao text, # observacao text,
# resultado text, # resultado text,
# local_origem_externa_id integer, # local_origem_externa_id integer,
# regime_tramitacao_id integer NOT NULL, # regime_tramitacao_id integer NOT NULL,
# tipo_id integer NOT NULL, # tipo_id integer NOT NULL,
# 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
# DETAIL: Key (tipo_id, numero, ano)=(2, 1, 2015) already exists. # "materia_materialegislativa_tipo_id_2646a902479b4205_uniq"
# 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