|
|
@ -1,14 +1,14 @@ |
|
|
from .exceptions import UnknownUrlNameError |
|
|
from .exceptions import UnknownUrlNameError |
|
|
from django.core.urlresolvers import NoReverseMatch, reverse |
|
|
from django.core.urlresolvers import NoReverseMatch, reverse |
|
|
from django.views.generic import RedirectView |
|
|
from django.views.generic import RedirectView |
|
|
|
|
|
from sapl.base.apps import AppConfig as atasConfig |
|
|
|
|
|
from sapl.base.apps import AppConfig as presenca_sessaoConfig |
|
|
from sapl.base.apps import AppConfig as relatoriosConfig |
|
|
from sapl.base.apps import AppConfig as relatoriosConfig |
|
|
from sapl.comissoes.apps import AppConfig as comissoesConfig |
|
|
from sapl.comissoes.apps import AppConfig as comissoesConfig |
|
|
from sapl.materia.apps import AppConfig as materiaConfig |
|
|
from sapl.materia.apps import AppConfig as materiaConfig |
|
|
from sapl.norma.apps import AppConfig as normaConfig |
|
|
from sapl.norma.apps import AppConfig as normaConfig |
|
|
from sapl.parlamentares.apps import AppConfig as parlamentaresConfig |
|
|
from sapl.parlamentares.apps import AppConfig as parlamentaresConfig |
|
|
from sapl.sessao.apps import AppConfig as sessaoConfig |
|
|
from sapl.sessao.apps import AppConfig as sessaoConfig |
|
|
from sapl.base.apps import AppConfig as atasConfig |
|
|
|
|
|
from sapl.base.apps import AppConfig as presenca_sessaoConfig |
|
|
|
|
|
|
|
|
|
|
|
EMPTY_STRING = '' |
|
|
EMPTY_STRING = '' |
|
|
|
|
|
|
|
|
@ -64,7 +64,9 @@ class RedirecionaParlamentar(RedirectView): |
|
|
|
|
|
|
|
|
def get_redirect_url(self): |
|
|
def get_redirect_url(self): |
|
|
url = EMPTY_STRING |
|
|
url = EMPTY_STRING |
|
|
pk_parlamentar = self.request.GET.get('cod_parlamentar', EMPTY_STRING) |
|
|
pk_parlamentar = self.request.GET.get( |
|
|
|
|
|
'cod_parlamentar', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
|
|
|
if pk_parlamentar: |
|
|
if pk_parlamentar: |
|
|
try: |
|
|
try: |
|
|
@ -78,7 +80,9 @@ class RedirecionaParlamentar(RedirectView): |
|
|
except NoReverseMatch: |
|
|
except NoReverseMatch: |
|
|
raise UnknownUrlNameError(parlamentar_list) |
|
|
raise UnknownUrlNameError(parlamentar_list) |
|
|
|
|
|
|
|
|
numero_legislatura = self.request.GET.get('hdn_num_legislatura', EMPTY_STRING) |
|
|
numero_legislatura = self.request.GET.get( |
|
|
|
|
|
'hdn_num_legislatura', |
|
|
|
|
|
EMPTY_STRING) |
|
|
if numero_legislatura: |
|
|
if numero_legislatura: |
|
|
args = '?pk=' + numero_legislatura |
|
|
args = '?pk=' + numero_legislatura |
|
|
url = "%s%s" % (url, args) |
|
|
url = "%s%s" % (url, args) |
|
|
@ -112,7 +116,9 @@ class RedirecionaPautaSessao(RedirectView): |
|
|
permanent = True |
|
|
permanent = True |
|
|
|
|
|
|
|
|
def get_redirect_url(self): |
|
|
def get_redirect_url(self): |
|
|
pk_sessao_plenaria = self.request.GET.get('cod_sessao_plen', EMPTY_STRING) |
|
|
pk_sessao_plenaria = self.request.GET.get( |
|
|
|
|
|
'cod_sessao_plen', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
|
|
|
if pk_sessao_plenaria: |
|
|
if pk_sessao_plenaria: |
|
|
kwargs = {'pk': pk_sessao_plenaria} |
|
|
kwargs = {'pk': pk_sessao_plenaria} |
|
|
@ -126,8 +132,9 @@ class RedirecionaPautaSessao(RedirectView): |
|
|
except NoReverseMatch: |
|
|
except NoReverseMatch: |
|
|
raise UnknownUrlNameError(pauta_sessao_list) |
|
|
raise UnknownUrlNameError(pauta_sessao_list) |
|
|
|
|
|
|
|
|
|
|
|
data_sessao_plenaria = self.request.GET.get( |
|
|
data_sessao_plenaria = self.request.GET.get('dat_sessao_sel', EMPTY_STRING) |
|
|
'dat_sessao_sel', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
|
|
|
if data_sessao_plenaria: |
|
|
if data_sessao_plenaria: |
|
|
dia_s_p, mes_s_p, ano_s_p = data_sessao_plenaria.split('/') |
|
|
dia_s_p, mes_s_p, ano_s_p = data_sessao_plenaria.split('/') |
|
|
@ -148,7 +155,9 @@ class RedirecionaSessaoPlenaria(RedirectView): |
|
|
permanent = True |
|
|
permanent = True |
|
|
|
|
|
|
|
|
def get_redirect_url(self): |
|
|
def get_redirect_url(self): |
|
|
pk_sessao_plenaria = self.request.GET.get('cod_sessao_plen', EMPTY_STRING) |
|
|
pk_sessao_plenaria = self.request.GET.get( |
|
|
|
|
|
'cod_sessao_plen', |
|
|
|
|
|
EMPTY_STRING) |
|
|
url = EMPTY_STRING |
|
|
url = EMPTY_STRING |
|
|
if pk_sessao_plenaria: |
|
|
if pk_sessao_plenaria: |
|
|
kwargs = {'pk': pk_sessao_plenaria} |
|
|
kwargs = {'pk': pk_sessao_plenaria} |
|
|
@ -163,10 +172,18 @@ class RedirecionaSessaoPlenaria(RedirectView): |
|
|
except NoReverseMatch: |
|
|
except NoReverseMatch: |
|
|
raise UnknownUrlNameError(sessao_plenaria_list) |
|
|
raise UnknownUrlNameError(sessao_plenaria_list) |
|
|
|
|
|
|
|
|
year = self.request.GET.get('ano_sessao_sel', EMPTY_STRING) |
|
|
year = self.request.GET.get( |
|
|
month = self.request.GET.get('mes_sessao_sel', EMPTY_STRING) |
|
|
'ano_sessao_sel', |
|
|
day = self.request.GET.get('dia_sessao_sel', EMPTY_STRING) |
|
|
EMPTY_STRING) |
|
|
tipo_sessao = self.request.GET.get('tip_sessao_sel', EMPTY_STRING) |
|
|
month = self.request.GET.get( |
|
|
|
|
|
'mes_sessao_sel', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
day = self.request.GET.get( |
|
|
|
|
|
'dia_sessao_sel', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
tipo_sessao = self.request.GET.get( |
|
|
|
|
|
'tip_sessao_sel', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
|
|
|
# Remove zeros à esquerda |
|
|
# Remove zeros à esquerda |
|
|
day = day.lstrip("0") |
|
|
day = day.lstrip("0") |
|
|
@ -203,12 +220,22 @@ class RedirecionaRelatoriosMateriasEmTramitacaoList(RedirectView): |
|
|
except NoReverseMatch: |
|
|
except NoReverseMatch: |
|
|
raise UnknownUrlNameError(relatorio_materia_por_tramitacao) |
|
|
raise UnknownUrlNameError(relatorio_materia_por_tramitacao) |
|
|
|
|
|
|
|
|
year = self.request.GET.get('selAno', EMPTY_STRING) |
|
|
year = self.request.GET.get( |
|
|
|
|
|
'selAno', |
|
|
|
|
|
EMPTY_STRING) |
|
|
if year: |
|
|
if year: |
|
|
tramitacao_tipo = self.request.GET.get('lst_tip_materia', EMPTY_STRING) |
|
|
tramitacao_tipo = self.request.GET.get( |
|
|
tramitacao_unidade_local = self.request.GET.get('lst_cod_unid_tram_dest', EMPTY_STRING) |
|
|
'lst_tip_materia', |
|
|
tramitacao_status = self.request.GET.get('lst_status', EMPTY_STRING) |
|
|
EMPTY_STRING) |
|
|
salvar = self.request.GET.get('btn_materia_pesquisar', 'Pesquisar') |
|
|
tramitacao_unidade_local = self.request.GET.get( |
|
|
|
|
|
'lst_cod_unid_tram_dest', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
tramitacao_status = self.request.GET.get( |
|
|
|
|
|
'lst_status', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
salvar = self.request.GET.get( |
|
|
|
|
|
'btn_materia_pesquisar', |
|
|
|
|
|
'Pesquisar') |
|
|
|
|
|
|
|
|
tramitacao_tipo = tramitacao_tipo.lstrip("0") |
|
|
tramitacao_tipo = tramitacao_tipo.lstrip("0") |
|
|
tramitacao_unidade_local = tramitacao_unidade_local.lstrip("0") |
|
|
tramitacao_unidade_local = tramitacao_unidade_local.lstrip("0") |
|
|
@ -217,7 +244,8 @@ class RedirecionaRelatoriosMateriasEmTramitacaoList(RedirectView): |
|
|
args = EMPTY_STRING |
|
|
args = EMPTY_STRING |
|
|
args += "?ano=%s" % (year) |
|
|
args += "?ano=%s" % (year) |
|
|
args += "&tipo=%s" % (tramitacao_tipo) |
|
|
args += "&tipo=%s" % (tramitacao_tipo) |
|
|
args += "&tramitacao__unidade_tramitacao_local=%s" % (tramitacao_unidade_local) |
|
|
args += "&tramitacao__unidade_tramitacao_local=%s" % ( |
|
|
|
|
|
tramitacao_unidade_local) |
|
|
args += "&tramitacao__status=%s" % (tramitacao_status) |
|
|
args += "&tramitacao__status=%s" % (tramitacao_status) |
|
|
args += "&salvar=%s" % (salvar) |
|
|
args += "&salvar=%s" % (salvar) |
|
|
url = "%s%s" % (url, args) |
|
|
url = "%s%s" % (url, args) |
|
|
@ -249,20 +277,42 @@ class RedirecionaMateriaLegislativaList(RedirectView): |
|
|
except NoReverseMatch: |
|
|
except NoReverseMatch: |
|
|
raise UnknownUrlNameError(materialegislativa_list) |
|
|
raise UnknownUrlNameError(materialegislativa_list) |
|
|
|
|
|
|
|
|
tipo_materia = self.request.GET.get('lst_tip_materia', EMPTY_STRING) |
|
|
tipo_materia = self.request.GET.get( |
|
|
numero_materia = self.request.GET.get('txt_numero', EMPTY_STRING) |
|
|
'lst_tip_materia', |
|
|
ano_materia = self.request.GET.get('txt_ano', EMPTY_STRING) |
|
|
EMPTY_STRING) |
|
|
numero_processo = self.request.GET.get('txt_npc', EMPTY_STRING) |
|
|
numero_materia = self.request.GET.get( |
|
|
num_protocolo_materia = self.request.GET.get('txt_num_protocolo', EMPTY_STRING) |
|
|
'txt_numero', |
|
|
periodo_inicial_apresentacao = self.request.GET.get('dt_apres', EMPTY_STRING) |
|
|
EMPTY_STRING) |
|
|
periodo_final_apresentacao = self.request.GET.get('dt_apres2', EMPTY_STRING) |
|
|
ano_materia = self.request.GET.get( |
|
|
periodo_inicial_publicacao = self.request.GET.get('dt_public', EMPTY_STRING) |
|
|
'txt_ano', |
|
|
periodo_final_publicacao = self.request.GET.get('dt_public2', EMPTY_STRING) |
|
|
EMPTY_STRING) |
|
|
hdn_cod_autor = self.request.GET.get('hdn_cod_autor', EMPTY_STRING) |
|
|
num_protocolo_materia = self.request.GET.get( |
|
|
tipo_autor = self.request.GET.get('lst_tip_autor', EMPTY_STRING) |
|
|
'txt_num_protocolo', |
|
|
ementa_materia = self.request.GET.get('txt_assunto', EMPTY_STRING) |
|
|
EMPTY_STRING) |
|
|
tramitando = self.request.GET.get('rad_tramitando', EMPTY_STRING) |
|
|
periodo_inicial_apresentacao = self.request.GET.get( |
|
|
status_tramitacao = self.request.GET.get('lst_status', EMPTY_STRING) |
|
|
'dt_apres', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
periodo_final_apresentacao = self.request.GET.get( |
|
|
|
|
|
'dt_apres2', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
periodo_inicial_publicacao = self.request.GET.get( |
|
|
|
|
|
'dt_public', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
periodo_final_publicacao = self.request.GET.get( |
|
|
|
|
|
'dt_public2', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
tipo_autor = self.request.GET.get( |
|
|
|
|
|
'lst_tip_autor', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
ementa_materia = self.request.GET.get( |
|
|
|
|
|
'txt_assunto', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
tramitando = self.request.GET.get( |
|
|
|
|
|
'rad_tramitando', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
status_tramitacao = self.request.GET.get( |
|
|
|
|
|
'lst_status', |
|
|
|
|
|
EMPTY_STRING) |
|
|
|
|
|
|
|
|
args += "?tipo=%s" % (tipo_materia) |
|
|
args += "?tipo=%s" % (tipo_materia) |
|
|
args += "&numero=%s" % (numero_materia) |
|
|
args += "&numero=%s" % (numero_materia) |
|
|
@ -313,6 +363,7 @@ class RedirecionaNormasJuridicasDetail(RedirectView): |
|
|
else: |
|
|
else: |
|
|
return reverse(norma_juridica_pesquisa) |
|
|
return reverse(norma_juridica_pesquisa) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RedirecionaNormasJuridicasList(RedirectView): |
|
|
class RedirecionaNormasJuridicasList(RedirectView): |
|
|
|
|
|
|
|
|
permanent = True |
|
|
permanent = True |
|
|
@ -402,12 +453,12 @@ class RedirecionaHistoricoTramitacoesList(RedirectView): |
|
|
EMPTY_STRING |
|
|
EMPTY_STRING |
|
|
).lstrip("0") |
|
|
).lstrip("0") |
|
|
|
|
|
|
|
|
if ((inicio_intervalo_data_tramitacao != EMPTY_STRING) or |
|
|
if ( |
|
|
|
|
|
(inicio_intervalo_data_tramitacao != EMPTY_STRING) or |
|
|
(fim_intervalo_data_tramitacao != EMPTY_STRING) or |
|
|
(fim_intervalo_data_tramitacao != EMPTY_STRING) or |
|
|
(tipo_materia != EMPTY_STRING) or |
|
|
(tipo_materia != EMPTY_STRING) or |
|
|
(unidade_local_tramitacao != EMPTY_STRING) or |
|
|
(unidade_local_tramitacao != EMPTY_STRING) or |
|
|
(status_tramitacao != EMPTY_STRING) |
|
|
(status_tramitacao != EMPTY_STRING)): |
|
|
): |
|
|
|
|
|
|
|
|
|
|
|
args += "?tramitacao__data_tramitacao_0=%s" % ( |
|
|
args += "?tramitacao__data_tramitacao_0=%s" % ( |
|
|
inicio_intervalo_data_tramitacao) |
|
|
inicio_intervalo_data_tramitacao) |
|
|
|