From 0d4e3fec3bff80cc0c4ef595454922e662cfb6d0 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 5 Apr 2022 13:27:57 -0300 Subject: [PATCH] Adicionado campo publicar pauta na sessao --- .../migrations/0060_auto_20220224_1245.py | 18 ++++++++++++++++++ .../0061_sessaoplenaria_publicar_pauta.py | 18 ++++++++++++++++++ .../migrations/0062_auto_20220405_1307.py | 17 +++++++++++++++++ sapl/sessao/models.py | 6 ++++++ 4 files changed, 59 insertions(+) create mode 100644 sapl/sessao/migrations/0060_auto_20220224_1245.py create mode 100644 sapl/sessao/migrations/0061_sessaoplenaria_publicar_pauta.py create mode 100644 sapl/sessao/migrations/0062_auto_20220405_1307.py diff --git a/sapl/sessao/migrations/0060_auto_20220224_1245.py b/sapl/sessao/migrations/0060_auto_20220224_1245.py new file mode 100644 index 000000000..bc00e6ec5 --- /dev/null +++ b/sapl/sessao/migrations/0060_auto_20220224_1245.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.24 on 2022-02-24 15:45 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('sessao', '0059_sessaoplenaria_data_ultima_atualizacao'), + ] + + operations = [ + migrations.AlterField( + model_name='tiposessaoplenaria', + name='tipo_numeracao', + field=models.PositiveIntegerField(choices=[(1, 'Quinzenal'), (2, 'Mensal'), (5, 'Semestral'), (10, 'Anual'), (11, 'Sessão Legislativa'), (12, 'Legislatura'), (99, 'Numeração Única')], default=11, verbose_name='Tipo de Numeração'), + ), + ] diff --git a/sapl/sessao/migrations/0061_sessaoplenaria_publicar_pauta.py b/sapl/sessao/migrations/0061_sessaoplenaria_publicar_pauta.py new file mode 100644 index 000000000..c247df415 --- /dev/null +++ b/sapl/sessao/migrations/0061_sessaoplenaria_publicar_pauta.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.24 on 2022-04-05 16:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('sessao', '0060_auto_20220224_1245'), + ] + + operations = [ + migrations.AddField( + model_name='sessaoplenaria', + name='publicar_pauta', + field=models.BooleanField(blank=True, default=False, null=True, verbose_name='Publicar Pauta?'), + ), + ] diff --git a/sapl/sessao/migrations/0062_auto_20220405_1307.py b/sapl/sessao/migrations/0062_auto_20220405_1307.py new file mode 100644 index 000000000..65d4e0253 --- /dev/null +++ b/sapl/sessao/migrations/0062_auto_20220405_1307.py @@ -0,0 +1,17 @@ +# Generated by Django 2.2.24 on 2022-04-05 16:07 + +from django.db import migrations + +def publicar_pauta_true_sessoes_existentes(apps, schema_editor): + SessaoPlenaria = apps.get_model('sessao', 'SessaoPlenaria') + SessaoPlenaria.objects.filter(publicar_pauta=False).update(publicar_pauta=True) + +class Migration(migrations.Migration): + + dependencies = [ + ('sessao', '0061_sessaoplenaria_publicar_pauta'), + ] + + operations = [ + migrations.RunPython(publicar_pauta_true_sessoes_existentes), + ] diff --git a/sapl/sessao/models.py b/sapl/sessao/models.py index 536ff6cb9..f56dc5e46 100644 --- a/sapl/sessao/models.py +++ b/sapl/sessao/models.py @@ -240,6 +240,12 @@ class SessaoPlenaria(models.Model): data_ultima_atualizacao = models.DateTimeField( blank=True, null=True, auto_now=True, verbose_name=_('Data')) + publicar_pauta = models.BooleanField( + null=True, + blank=True, + default=False, + verbose_name=_('Publicar Pauta?')) + class Meta: verbose_name = _('Sessão Plenária') verbose_name_plural = _('Sessões Plenárias')