Browse Source

Fix obrigatory fields of SessaoPlenaria from TabelasAuxiliares

pull/98/head
Eduardo Calil 9 years ago
parent
commit
cc998bc470
  1. 39
      base/migrations/0005_auto_20160107_1244.py
  2. 20
      base/migrations/0006_auto_20160107_1257.py
  3. 10
      base/models.py
  4. 7
      base/views.py

39
base/migrations/0005_auto_20160107_1244.py

@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0004_auto_20160107_1158'),
]
operations = [
migrations.AlterField(
model_name='casalegislativa',
name='email',
field=models.CharField(max_length=100, null=True, verbose_name='E-mail', blank=True),
),
migrations.AlterField(
model_name='casalegislativa',
name='endereco_web',
field=models.CharField(max_length=100, null=True, verbose_name='HomePage', blank=True),
),
migrations.AlterField(
model_name='casalegislativa',
name='fax',
field=models.CharField(max_length=100, null=True, verbose_name='Fax', blank=True),
),
migrations.AlterField(
model_name='casalegislativa',
name='informacao_geral',
field=models.CharField(max_length=100, null=True, verbose_name='Informação Geral', blank=True),
),
migrations.AlterField(
model_name='casalegislativa',
name='telefone',
field=models.CharField(max_length=100, null=True, verbose_name='Telefone', blank=True),
),
]

20
base/migrations/0006_auto_20160107_1257.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0005_auto_20160107_1244'),
]
operations = [
migrations.AlterField(
model_name='casalegislativa',
name='informacao_geral',
field=models.CharField(verbose_name='Informação Geral', max_length=100, default=1),
preserve_default=False,
),
]

10
base/models.py

@ -20,17 +20,17 @@ class CasaLegislativa(models.Model):
cep = models.CharField(max_length=100, verbose_name=_('CEP'))
municipio = models.CharField(max_length=100, verbose_name=_('Município'))
uf = models.CharField(max_length=100, verbose_name=_('UF'))
telefone = models.CharField(max_length=100, verbose_name=_('Telefone'))
fax = models.CharField(max_length=100, verbose_name=_('Fax'))
telefone = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('Telefone'))
fax = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('Fax'))
logotipo = models.FileField(
blank=True,
null=True,
upload_to=get_casa_media_path,
verbose_name=_('Logotipo'))
endereco_web = models.CharField(max_length=100, verbose_name=_('HomePage'))
email = models.CharField(max_length=100, verbose_name=_('E-mail'))
endereco_web = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('HomePage'))
email = models.CharField(max_length=100, blank=True, null=True, verbose_name=_('E-mail'))
informacao_geral = models.CharField(
max_length=100, verbose_name=_('Informação Geral'))
max_length=100, blank=True, null=True, verbose_name=_('Informação Geral'))
class Meta:
verbose_name = _('Casa Legislativa')

7
base/views.py

@ -51,15 +51,16 @@ ESTADOS = ["AC",
class CasaLegislativaTabelaAuxForm(ModelForm):
uf = forms.ChoiceField(required=False,
uf = forms.ChoiceField(required=True,
label='UF',
choices=[(a, a) for a in ESTADOS],
widget=forms.Select(
attrs={'class': 'selector'}))
informacao_geral = forms.CharField(widget=forms.Textarea,
label='informacao_geral',
required=True)
label='Informação Geral',
required=False)
telefone = forms.CharField(label='Telefone',
required=True,

Loading…
Cancel
Save