Browse Source

Add mask to some forms

Fix #91
pull/98/head
Eduardo Edson Batista Cordeiro Alves 9 years ago
parent
commit
28817c7f6b
  1. 40
      parlamentares/views.py
  2. 10
      sessao/views.py

40
parlamentares/views.py

@ -232,6 +232,46 @@ class ParlamentaresForm (ModelForm):
)
)
cpf = forms.CharField(label='C.P.F',
required=False,
widget=forms.TextInput(
attrs={'class': 'cpf'}))
rg = forms.CharField(label='R.G.',
required=False,
widget=forms.TextInput(
attrs={'class': 'rg'}))
titulo_eleitor = forms.CharField(label='Título de Eleitor',
required=False,
widget=forms.TextInput(
attrs={'class': 'titulo_eleitor'}))
telefone = forms.CharField(label='Telefone',
required=True,
widget=forms.TextInput(
attrs={'class': 'telefone'}))
fax = forms.CharField(label='Fax',
required=True,
widget=forms.TextInput(
attrs={'class': 'telefone'}))
cep_residencia = forms.CharField(label='CEP',
required=True,
widget=forms.TextInput(
attrs={'class': 'cep'}))
telefone_residencia = forms.CharField(label='Telefone',
required=True,
widget=forms.TextInput(
attrs={'class': 'telefone'}))
fax_residencia = forms.CharField(label='Fax',
required=True,
widget=forms.TextInput(
attrs={'class': 'telefone'}))
class Meta:
model = Parlamentar
fields = ['nome_parlamentar',

10
sessao/views.py

@ -2334,6 +2334,16 @@ class PautaSessaoDetailView(sessao_crud.CrudDetailView):
class SessaoForm(ModelForm):
hora_inicio = forms.CharField(label='Horário Inicio',
required=True,
widget=forms.TextInput(
attrs={'class': 'hora'}))
hora_fim = forms.CharField(label='Horário Fim',
required=True,
widget=forms.TextInput(
attrs={'class': 'hora'}))
class Meta:
model = SessaoPlenaria
fields = ['numero',

Loading…
Cancel
Save