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',