From e3667cabd8d1ec44c0fcb55fc8549cb0bc67e810 Mon Sep 17 00:00:00 2001 From: Eduardo Calil Date: Mon, 11 Apr 2016 12:14:03 -0300 Subject: [PATCH] Arruma problema nas Choices do Ano da Materia --- materia/forms.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/materia/forms.py b/materia/forms.py index 504dc1363..5ca5aa385 100644 --- a/materia/forms.py +++ b/materia/forms.py @@ -13,6 +13,7 @@ import sapl from crispy_layout_mixin import form_actions from norma.models import LegislacaoCitada, TipoNormaJuridica from sapl.settings import MAX_DOC_UPLOAD_SIZE +from sapl.utils import RANGE_ANOS from .models import (AcompanhamentoMateria, Anexada, Autor, Autoria, DespachoInicial, DocumentoAcessorio, MateriaLegislativa, @@ -20,6 +21,9 @@ from .models import (AcompanhamentoMateria, Anexada, Autor, Autoria, Tramitacao) +ANO_VAZIO = [('', '---------')] + RANGE_ANOS + + def em_tramitacao(): return [('', 'Tanto Faz'), (True, 'Sim'), @@ -622,6 +626,11 @@ class MateriaLegislativaFilterSet(django_filters.FilterSet): ementa = django_filters.CharFilter(lookup_expr='icontains') + ano = django_filters.ChoiceFilter(required=False, + label=u'Ano da Matéria', + choices=ANO_VAZIO, + help_text="") + class Meta: model = MateriaLegislativa fields = ['numero',