|
|
@ -17,7 +17,8 @@ from sapl.crispy_layout_mixin import form_actions, to_row |
|
|
|
from sapl.norma.models import (LegislacaoCitada, NormaJuridica, |
|
|
|
TipoNormaJuridica) |
|
|
|
from sapl.settings import MAX_DOC_UPLOAD_SIZE |
|
|
|
from sapl.utils import RANGE_ANOS, autor_label, autor_modal |
|
|
|
from sapl.utils import (RANGE_ANOS, RangeWidgetOverride, autor_label, |
|
|
|
autor_modal) |
|
|
|
|
|
|
|
from .models import (AcompanhamentoMateria, Anexada, Autor, Autoria, |
|
|
|
DespachoInicial, DocumentoAcessorio, MateriaLegislativa, |
|
|
@ -34,6 +35,7 @@ def em_tramitacao(): |
|
|
|
|
|
|
|
|
|
|
|
class ConfirmarProposicaoForm(ModelForm): |
|
|
|
|
|
|
|
class Meta: |
|
|
|
model = Proposicao |
|
|
|
exclude = ['texto_original', 'descricao', 'tipo'] |
|
|
@ -445,26 +447,6 @@ class AnexadaForm(ModelForm): |
|
|
|
fields = ['tipo', 'numero', 'ano', 'data_anexacao', 'data_desanexacao'] |
|
|
|
|
|
|
|
|
|
|
|
class RangeWidgetOverride(forms.MultiWidget): |
|
|
|
|
|
|
|
def __init__(self, attrs=None): |
|
|
|
widgets = (forms.DateInput(format='%d/%m/%Y', |
|
|
|
attrs={'class': 'dateinput', |
|
|
|
'placeholder': 'Inicial'}), |
|
|
|
forms.DateInput(format='%d/%m/%Y', |
|
|
|
attrs={'class': 'dateinput', |
|
|
|
'placeholder': 'Final'})) |
|
|
|
super(RangeWidgetOverride, self).__init__(widgets, attrs) |
|
|
|
|
|
|
|
def decompress(self, value): |
|
|
|
if value: |
|
|
|
return [value.start, value.stop] |
|
|
|
return [None, None] |
|
|
|
|
|
|
|
def format_output(self, rendered_widgets): |
|
|
|
return ''.join(rendered_widgets) |
|
|
|
|
|
|
|
|
|
|
|
class MateriaLegislativaFilterSet(django_filters.FilterSet): |
|
|
|
|
|
|
|
filter_overrides = {models.DateField: { |
|
|
|