From 461d20d49ade89f8cddbbf043ca91b15749bb02b Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Thu, 1 Sep 2016 17:07:32 -0300 Subject: [PATCH] =?UTF-8?q?Filtra=20somente=20mat=C3=A9rias=20em=20tramita?= =?UTF-8?q?=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/base/forms.py | 1 - sapl/base/views.py | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sapl/base/forms.py b/sapl/base/forms.py index d7f1f3a4c..4aa02c21b 100644 --- a/sapl/base/forms.py +++ b/sapl/base/forms.py @@ -48,7 +48,6 @@ class RelatorioMateriasTramitacaoilterSet(django_filters.FilterSet): fields = ['ano', 'tipo', 'tramitacao__unidade_tramitacao_local', 'tramitacao__status'] - def __init__(self, *args, **kwargs): super(RelatorioMateriasTramitacaoilterSet, self).__init__( *args, **kwargs) diff --git a/sapl/base/views.py b/sapl/base/views.py index 2f44fe039..db3ab016f 100644 --- a/sapl/base/views.py +++ b/sapl/base/views.py @@ -32,9 +32,13 @@ class RelatorioMateriasTramitacaoView(FilterView): context['title'] = _('Matérias por Ano, Autor e Tipo') + qs = context['object_list'] + qs = qs.filter(em_tramitacao=True) + context['object_list'] = qs + qtdes = {} for tipo in TipoMateriaLegislativa.objects.all(): - qs = kwargs['object_list'] + qs = context['object_list'] qtde = len(qs.filter(tipo_id=tipo.id)) if qtde > 0: qtdes[tipo] = qtde