Browse Source

Fixes #3535

pull/3540/head
Edward Ribeiro 3 years ago
parent
commit
d53e0d9571
  1. 9
      sapl/base/forms.py
  2. 6
      sapl/utils.py

9
sapl/base/forms.py

@ -39,7 +39,7 @@ from sapl.utils import (autor_label, autor_modal, ChoiceWithoutValidationField,
choice_anos_com_normas, choice_anos_com_materias,
FilterOverridesMetaMixin, FileFieldCheckMixin,
ImageThumbnailFileInput, qs_override_django_filter,
RANGE_ANOS, YES_NO_CHOICES,
RANGE_ANOS, YES_NO_CHOICES, choice_tipos_normas,
GoogleRecapthaMixin, parlamentares_ativos)
from .models import AppConfig, CasaLegislativa
@ -971,6 +971,11 @@ class RelatorioNormasVigenciaFilterSet(django_filters.FilterSet):
choices=choice_anos_com_normas,
initial=ultimo_ano_com_norma)
tipo = django_filters.ChoiceFilter(required=False,
label='Tipo Norma',
choices=choice_tipos_normas,
initial=0)
vigencia = forms.ChoiceField(
label=_('Vigência'),
choices=[(True, "Vigente"), (False, "Não vigente")],
@ -986,7 +991,7 @@ class RelatorioNormasVigenciaFilterSet(django_filters.FilterSet):
self.form.fields['ano'].required = True
self.form.fields['vigencia'] = self.vigencia
row1 = to_row([('ano', 12)])
row1 = to_row([('ano', 6), ('tipo', 6)])
row2 = to_row([('vigencia', 12)])
buttons = FormActions(

6
sapl/utils.py

@ -494,6 +494,12 @@ def choice_anos_com_normas():
return choice_anos(NormaJuridica)
def choice_tipos_normas():
from sapl.norma.models import TipoNormaJuridica
return [(id, descricao) for (id, descricao) in
TipoNormaJuridica.objects.all().values_list('id', 'descricao')]
def choice_anos_com_protocolo():
from sapl.protocoloadm.models import Protocolo
return choice_anos(Protocolo)

Loading…
Cancel
Save