|
@ -1,7 +1,7 @@ |
|
|
from datetime import date |
|
|
from datetime import date |
|
|
|
|
|
|
|
|
from crispy_forms.helper import FormHelper |
|
|
from crispy_forms.helper import FormHelper |
|
|
from crispy_forms.layout import Column, Fieldset, Layout, Submit |
|
|
from crispy_forms.layout import Column, Fieldset, Layout |
|
|
from django import forms |
|
|
from django import forms |
|
|
from django.forms import ModelForm |
|
|
from django.forms import ModelForm |
|
|
from django.utils.safestring import mark_safe |
|
|
from django.utils.safestring import mark_safe |
|
@ -54,9 +54,6 @@ class HorizontalRadioRenderer(forms.RadioSelect.renderer): |
|
|
|
|
|
|
|
|
class ProposicaoForm(ModelForm): |
|
|
class ProposicaoForm(ModelForm): |
|
|
|
|
|
|
|
|
descricao = forms.CharField( |
|
|
|
|
|
label='Descrição', required=True, |
|
|
|
|
|
widget=forms.Textarea()) |
|
|
|
|
|
|
|
|
|
|
|
tipo_materia = forms.ModelChoiceField( |
|
|
tipo_materia = forms.ModelChoiceField( |
|
|
label=_('Matéria Vinculada'), |
|
|
label=_('Matéria Vinculada'), |
|
@ -143,12 +140,6 @@ class DocumentoAcessorioForm(ModelForm): |
|
|
empty_label='Selecione', |
|
|
empty_label='Selecione', |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
data = forms.DateField(label='Data', |
|
|
|
|
|
required=False, |
|
|
|
|
|
input_formats=['%d/%m/%Y'], |
|
|
|
|
|
widget=forms.TextInput( |
|
|
|
|
|
attrs={'class': 'dateinput'})) |
|
|
|
|
|
|
|
|
|
|
|
nome = forms.CharField( |
|
|
nome = forms.CharField( |
|
|
label='Nome', required=True) |
|
|
label='Nome', required=True) |
|
|
|
|
|
|
|
@ -165,6 +156,12 @@ class DocumentoAcessorioForm(ModelForm): |
|
|
'data', |
|
|
'data', |
|
|
'autor', |
|
|
'autor', |
|
|
'ementa'] |
|
|
'ementa'] |
|
|
|
|
|
widgets = { |
|
|
|
|
|
'data': forms.DateInput(attrs={'class': 'dateinput'}) |
|
|
|
|
|
} |
|
|
|
|
|
input_formats = { |
|
|
|
|
|
'data': ['%d/%m/%Y'], |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
def __init__(self, *args, **kwargs): |
|
|
|
|
|
|
|
@ -191,21 +188,6 @@ class DocumentoAcessorioForm(ModelForm): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RelatoriaForm(ModelForm): |
|
|
class RelatoriaForm(ModelForm): |
|
|
data_designacao_relator = forms.DateField( |
|
|
|
|
|
label=u'Data Designação', |
|
|
|
|
|
input_formats=['%d/%m/%Y'], |
|
|
|
|
|
required=False, |
|
|
|
|
|
widget=forms.DateInput( |
|
|
|
|
|
format='%d/%m/%Y', |
|
|
|
|
|
attrs={'class': 'dateinput'})) |
|
|
|
|
|
|
|
|
|
|
|
data_destituicao_relator = forms.DateField( |
|
|
|
|
|
label=u'Data Destituição', |
|
|
|
|
|
input_formats=['%d/%m/%Y'], |
|
|
|
|
|
required=False, |
|
|
|
|
|
widget=forms.DateInput( |
|
|
|
|
|
format='%d/%m/%Y', |
|
|
|
|
|
attrs={'class': 'dateinput'})) |
|
|
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
class Meta: |
|
|
model = Relatoria |
|
|
model = Relatoria |
|
@ -215,31 +197,20 @@ class RelatoriaForm(ModelForm): |
|
|
'data_destituicao_relator', |
|
|
'data_destituicao_relator', |
|
|
'tipo_fim_relatoria' |
|
|
'tipo_fim_relatoria' |
|
|
] |
|
|
] |
|
|
|
|
|
widgets = { |
|
|
|
|
|
'data_designacao_relator': forms.DateInput(attrs={ |
|
|
|
|
|
'class': 'dateinput'}), |
|
|
|
|
|
'data_destituicao_relator': forms.DateInput(attrs={ |
|
|
|
|
|
'class': 'dateinput'}), |
|
|
|
|
|
} |
|
|
|
|
|
input_formats = { |
|
|
|
|
|
'data_designacao_relator': ['%d/%m/%Y'], |
|
|
|
|
|
'data_destituicao_relator': ['%d/%m/%Y'], |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TramitacaoForm(ModelForm): |
|
|
class TramitacaoForm(ModelForm): |
|
|
|
|
|
|
|
|
data_tramitacao = forms.DateField(label=u'Data Tramitação', |
|
|
|
|
|
input_formats=['%d/%m/%Y'], |
|
|
|
|
|
required=False, |
|
|
|
|
|
widget=forms.DateInput( |
|
|
|
|
|
format='%d/%m/%Y', |
|
|
|
|
|
attrs={'class': 'dateinput'})) |
|
|
|
|
|
|
|
|
|
|
|
data_encaminhamento = forms.DateField(label=u'Data Encaminhamento', |
|
|
|
|
|
input_formats=['%d/%m/%Y'], |
|
|
|
|
|
required=False, |
|
|
|
|
|
widget=forms.DateInput( |
|
|
|
|
|
format='%d/%m/%Y', |
|
|
|
|
|
attrs={'class': 'dateinput'})) |
|
|
|
|
|
|
|
|
|
|
|
data_fim_prazo = forms.DateField(label=u'Data Fim Prazo', |
|
|
|
|
|
input_formats=['%d/%m/%Y'], |
|
|
|
|
|
required=False, |
|
|
|
|
|
widget=forms.DateInput( |
|
|
|
|
|
format='%d/%m/%Y', |
|
|
|
|
|
attrs={'class': 'dateinput'})) |
|
|
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
class Meta: |
|
|
model = Tramitacao |
|
|
model = Tramitacao |
|
|
fields = ['data_tramitacao', |
|
|
fields = ['data_tramitacao', |
|
@ -252,6 +223,26 @@ class TramitacaoForm(ModelForm): |
|
|
'data_fim_prazo', |
|
|
'data_fim_prazo', |
|
|
'texto'] |
|
|
'texto'] |
|
|
|
|
|
|
|
|
|
|
|
widgets = { |
|
|
|
|
|
'data_tramitacao': forms.DateInput(attrs={ |
|
|
|
|
|
'class': 'dateinput'}), |
|
|
|
|
|
'data_encaminhamento': forms.DateInput(attrs={ |
|
|
|
|
|
'class': 'dateinput'}), |
|
|
|
|
|
'data_fim_prazo': forms.DateInput(attrs={ |
|
|
|
|
|
'class': 'dateinput'}), |
|
|
|
|
|
} |
|
|
|
|
|
input_formats = { |
|
|
|
|
|
'data_tramitacao': ['%d/%m/%Y'], |
|
|
|
|
|
'data_encaminhamento': ['%d/%m/%Y'], |
|
|
|
|
|
'data_fim_prazo': ['%d/%m/%Y'], |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
formats = { |
|
|
|
|
|
'data_tramitacao': '%d/%m/%Y', |
|
|
|
|
|
'data_encaminhamento': '%d/%m/%Y', |
|
|
|
|
|
'data_fim_prazo': '%d/%m/%Y', |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
def __init__(self, *args, **kwargs): |
|
|
row1 = crispy_layout_mixin.to_row( |
|
|
row1 = crispy_layout_mixin.to_row( |
|
|
[('data_tramitacao', 6), |
|
|
[('data_tramitacao', 6), |
|
@ -384,21 +375,6 @@ class NumeracaoForm(ModelForm): |
|
|
empty_label='Selecione', |
|
|
empty_label='Selecione', |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
data_materia = forms.DateField(label='Data', |
|
|
|
|
|
required=True, |
|
|
|
|
|
input_formats=['%d/%m/%Y'], |
|
|
|
|
|
widget=forms.TextInput( |
|
|
|
|
|
attrs={'class': 'dateinput'})) |
|
|
|
|
|
|
|
|
|
|
|
ano_materia = forms.ChoiceField(required=True, |
|
|
|
|
|
label='Ano', |
|
|
|
|
|
choices=get_range_anos(), |
|
|
|
|
|
widget=forms.Select( |
|
|
|
|
|
attrs={'class': 'selector'})) |
|
|
|
|
|
|
|
|
|
|
|
numero_materia = forms.CharField( |
|
|
|
|
|
label='Número', required=True) |
|
|
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
class Meta: |
|
|
model = Numeracao |
|
|
model = Numeracao |
|
|
fields = ['tipo_materia', |
|
|
fields = ['tipo_materia', |
|
@ -406,6 +382,14 @@ class NumeracaoForm(ModelForm): |
|
|
'ano_materia', |
|
|
'ano_materia', |
|
|
'data_materia'] |
|
|
'data_materia'] |
|
|
|
|
|
|
|
|
|
|
|
widgets = { |
|
|
|
|
|
'data_materia': forms.DateInput(attrs={'class': 'dateinput'}), |
|
|
|
|
|
'ano_materia': forms.Select(attrs={'class': 'selector'}), |
|
|
|
|
|
} |
|
|
|
|
|
input_formats = { |
|
|
|
|
|
'data_materia': ['%d/%m/%Y'], |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
def __init__(self, *args, **kwargs): |
|
|
|
|
|
|
|
|
row1 = crispy_layout_mixin.to_row( |
|
|
row1 = crispy_layout_mixin.to_row( |
|
@ -437,7 +421,6 @@ class DespachoInicialForm(ModelForm): |
|
|
more = [] |
|
|
more = [] |
|
|
if excluir: |
|
|
if excluir: |
|
|
more = [Submit('Excluir', 'Excluir')] |
|
|
more = [Submit('Excluir', 'Excluir')] |
|
|
|
|
|
|
|
|
self.helper = FormHelper() |
|
|
self.helper = FormHelper() |
|
|
self.helper.layout = Layout( |
|
|
self.helper.layout = Layout( |
|
|
Fieldset( |
|
|
Fieldset( |
|
@ -466,6 +449,14 @@ class MateriaAnexadaForm(ModelForm): |
|
|
model = Anexada |
|
|
model = Anexada |
|
|
fields = ['tipo', 'numero', 'ano', |
|
|
fields = ['tipo', 'numero', 'ano', |
|
|
'data_anexacao', 'data_desanexacao'] |
|
|
'data_anexacao', 'data_desanexacao'] |
|
|
|
|
|
widgets = { |
|
|
|
|
|
'data_anexacao': forms.DateInput(attrs={'class': 'dateinput'}), |
|
|
|
|
|
'data_desanexacao': forms.DateInput(attrs={'class': 'dateinput'}), |
|
|
|
|
|
} |
|
|
|
|
|
input_formats = { |
|
|
|
|
|
'data_anexacao': ['%d/%m/%Y'], |
|
|
|
|
|
'data_desanexacao': ['%d/%m/%Y'], |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
def __init__(self, excluir=False, *args, **kwargs): |
|
|
def __init__(self, excluir=False, *args, **kwargs): |
|
|
|
|
|
|
|
@ -492,12 +483,6 @@ class MateriaAnexadaForm(ModelForm): |
|
|
|
|
|
|
|
|
class FormularioSimplificadoForm(ModelForm): |
|
|
class FormularioSimplificadoForm(ModelForm): |
|
|
|
|
|
|
|
|
data_apresentacao = forms.DateField(label=u'Data Apresentação', |
|
|
|
|
|
input_formats=['%d/%m/%Y'], |
|
|
|
|
|
required=False, |
|
|
|
|
|
widget=forms.DateInput( |
|
|
|
|
|
format='%d/%m/%Y')) |
|
|
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
class Meta: |
|
|
model = MateriaLegislativa |
|
|
model = MateriaLegislativa |
|
|
fields = ['tipo', |
|
|
fields = ['tipo', |
|
@ -510,6 +495,15 @@ class FormularioSimplificadoForm(ModelForm): |
|
|
'ementa', |
|
|
'ementa', |
|
|
'texto_original'] |
|
|
'texto_original'] |
|
|
exclude = ['anexadas'] |
|
|
exclude = ['anexadas'] |
|
|
|
|
|
widgets = { |
|
|
|
|
|
'data_apresentacao': forms.DateInput(attrs={'class': 'dateinput'}), |
|
|
|
|
|
} |
|
|
|
|
|
input_formats = { |
|
|
|
|
|
'data_apresentacao': ['%d/%m/%Y'], |
|
|
|
|
|
} |
|
|
|
|
|
formats = { |
|
|
|
|
|
'data_apresentacao': '%d/%m/%Y' |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
def __init__(self, *args, **kwargs): |
|
|
|
|
|
|
|
|