From c5bd462b0766621cf485252229ac9002e6d4f32a Mon Sep 17 00:00:00 2001 From: VictorFabreF Date: Mon, 24 Sep 2018 17:30:09 -0300 Subject: [PATCH] Define valor default para todos os campos booleanos nos models --- .../migrations/0018_auto_20180924_1724.py | 25 +++++++++++++++++++ sapl/comissoes/models.py | 5 ++-- .../migrations/0008_auto_20180924_1724.py | 20 +++++++++++++++ sapl/compilacao/models.py | 2 +- .../migrations/0031_auto_20180924_1724.py | 25 +++++++++++++++++++ sapl/materia/models.py | 6 +++-- .../migrations/0025_auto_20180924_1724.py | 20 +++++++++++++++ sapl/parlamentares/models.py | 2 +- .../migrations/0007_auto_20180924_1724.py | 25 +++++++++++++++++++ sapl/protocoloadm/models.py | 5 ++-- 10 files changed, 127 insertions(+), 8 deletions(-) create mode 100644 sapl/comissoes/migrations/0018_auto_20180924_1724.py create mode 100644 sapl/compilacao/migrations/0008_auto_20180924_1724.py create mode 100644 sapl/materia/migrations/0031_auto_20180924_1724.py create mode 100644 sapl/parlamentares/migrations/0025_auto_20180924_1724.py create mode 100644 sapl/protocoloadm/migrations/0007_auto_20180924_1724.py diff --git a/sapl/comissoes/migrations/0018_auto_20180924_1724.py b/sapl/comissoes/migrations/0018_auto_20180924_1724.py new file mode 100644 index 000000000..5f0a81fd5 --- /dev/null +++ b/sapl/comissoes/migrations/0018_auto_20180924_1724.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.8 on 2018-09-24 20:24 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('comissoes', '0017_auto_20180717_0827'), + ] + + operations = [ + migrations.AlterField( + model_name='cargocomissao', + name='unico', + field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=True, verbose_name='Único'), + ), + migrations.AlterField( + model_name='comissao', + name='unidade_deliberativa', + field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Unidade Deliberativa'), + ), + ] diff --git a/sapl/comissoes/models.py b/sapl/comissoes/models.py index 232f777b1..f9ffa97fa 100644 --- a/sapl/comissoes/models.py +++ b/sapl/comissoes/models.py @@ -75,7 +75,8 @@ class Comissao(models.Model): verbose_name=_('E-mail')) unidade_deliberativa = models.BooleanField( choices=YES_NO_CHOICES, - verbose_name=_('Unidade Deliberativa')) + verbose_name=_('Unidade Deliberativa'), + default=False) ativa = models.BooleanField( default=False, choices=YES_NO_CHOICES, @@ -121,7 +122,7 @@ class Periodo(models.Model): # PeriodoCompComissao class CargoComissao(models.Model): nome = models.CharField(max_length=50, verbose_name=_('Cargo')) unico = models.BooleanField( - choices=YES_NO_CHOICES, verbose_name=_('Único')) + choices=YES_NO_CHOICES, verbose_name=_('Único'), default=True) class Meta: verbose_name = _('Cargo de Comissão') diff --git a/sapl/compilacao/migrations/0008_auto_20180924_1724.py b/sapl/compilacao/migrations/0008_auto_20180924_1724.py new file mode 100644 index 000000000..ab2befec6 --- /dev/null +++ b/sapl/compilacao/migrations/0008_auto_20180924_1724.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.8 on 2018-09-24 20:24 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('compilacao', '0007_auto_20180911_1600'), + ] + + operations = [ + migrations.AlterField( + model_name='tipodispositivo', + name='contagem_continua', + field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Contagem contínua'), + ), + ] diff --git a/sapl/compilacao/models.py b/sapl/compilacao/models.py index 812e48e27..d165976e6 100644 --- a/sapl/compilacao/models.py +++ b/sapl/compilacao/models.py @@ -657,7 +657,7 @@ class TipoDispositivo(BaseModel): blank=True, verbose_name=_('Sufixo html da nota automática')) contagem_continua = models.BooleanField( - choices=YES_NO_CHOICES, verbose_name=_('Contagem contínua')) + choices=YES_NO_CHOICES, verbose_name=_('Contagem contínua'), default=False) dispositivo_de_articulacao = models.BooleanField( choices=YES_NO_CHOICES, default=False, diff --git a/sapl/materia/migrations/0031_auto_20180924_1724.py b/sapl/materia/migrations/0031_auto_20180924_1724.py new file mode 100644 index 000000000..12d541002 --- /dev/null +++ b/sapl/materia/migrations/0031_auto_20180924_1724.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.8 on 2018-09-24 20:24 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('materia', '0030_tramitacao_timestamp'), + ] + + operations = [ + migrations.AlterField( + model_name='orgao', + name='unidade_deliberativa', + field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Unidade Deliberativa'), + ), + migrations.AlterField( + model_name='tramitacao', + name='urgente', + field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Urgente ?'), + ), + ] diff --git a/sapl/materia/models.py b/sapl/materia/models.py index 6bcb6f8c0..dd9f8ddab 100644 --- a/sapl/materia/models.py +++ b/sapl/materia/models.py @@ -557,7 +557,8 @@ class Orgao(models.Model): sigla = models.CharField(max_length=10, verbose_name=_('Sigla')) unidade_deliberativa = models.BooleanField( choices=YES_NO_CHOICES, - verbose_name=(_('Unidade Deliberativa'))) + verbose_name=(_('Unidade Deliberativa')), + default=False) endereco = models.CharField( max_length=100, blank=True, verbose_name=_('Endereço')) telefone = models.CharField( @@ -929,7 +930,8 @@ class Tramitacao(models.Model): on_delete=models.PROTECT, verbose_name=_('Unidade Destino')) urgente = models.BooleanField(verbose_name=_('Urgente ?'), - choices=YES_NO_CHOICES) + choices=YES_NO_CHOICES, + default=False) turno = models.CharField( max_length=1, blank=True, verbose_name=_('Turno'), choices=TURNO_CHOICES) diff --git a/sapl/parlamentares/migrations/0025_auto_20180924_1724.py b/sapl/parlamentares/migrations/0025_auto_20180924_1724.py new file mode 100644 index 000000000..958a36b82 --- /dev/null +++ b/sapl/parlamentares/migrations/0025_auto_20180924_1724.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.8 on 2018-09-24 20:24 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('parlamentares', '0024_auto_20180814_1237'), + ] + + operations = [ + migrations.AlterField( + model_name='cargomesa', + name='unico', + field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=True, verbose_name='Cargo Único'), + ), + ] diff --git a/sapl/parlamentares/models.py b/sapl/parlamentares/models.py index 43c4e2215..60df66462 100644 --- a/sapl/parlamentares/models.py +++ b/sapl/parlamentares/models.py @@ -475,7 +475,7 @@ class CargoMesa(models.Model): descricao = models.CharField( max_length=50, verbose_name=_('Cargo na Mesa')) unico = models.BooleanField( - choices=YES_NO_CHOICES, verbose_name=_('Cargo Único')) + choices=YES_NO_CHOICES, verbose_name=_('Cargo Único'), default=True) class Meta: verbose_name = _('Cargo na Mesa') diff --git a/sapl/protocoloadm/migrations/0007_auto_20180924_1724.py b/sapl/protocoloadm/migrations/0007_auto_20180924_1724.py new file mode 100644 index 000000000..d0f8f3b3b --- /dev/null +++ b/sapl/protocoloadm/migrations/0007_auto_20180924_1724.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.8 on 2018-09-24 20:24 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('protocoloadm', '0006_documentoadministrativo_restrito'), + ] + + operations = [ + migrations.AlterField( + model_name='documentoadministrativo', + name='tramitacao', + field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='Em Tramitação?'), + ), + migrations.AlterField( + model_name='protocolo', + name='anulado', + field=models.BooleanField(default=False), + ), + ] diff --git a/sapl/protocoloadm/models.py b/sapl/protocoloadm/models.py index 347b8545e..52bd9ad22 100644 --- a/sapl/protocoloadm/models.py +++ b/sapl/protocoloadm/models.py @@ -89,7 +89,7 @@ class Protocolo(models.Model): blank=True, null=True, verbose_name=_('Número de Páginas')) observacao = models.TextField( blank=True, verbose_name=_('Observação')) - anulado = models.BooleanField() + anulado = models.BooleanField(default=False) user_anulacao = models.CharField(max_length=20, blank=True) ip_anulacao = models.CharField(max_length=15, blank=True) justificativa_anulacao = models.CharField( @@ -135,7 +135,8 @@ class DocumentoAdministrativo(models.Model): blank=True, null=True, verbose_name=_('Data Fim Prazo')) tramitacao = models.BooleanField( verbose_name=_('Em Tramitação?'), - choices=YES_NO_CHOICES) + choices=YES_NO_CHOICES, + default=False) assunto = models.TextField(verbose_name=_('Assunto')) numero_externo = models.PositiveIntegerField( blank=True,