diff --git a/sapl/comissoes/migrations/0030_auto_20231007_2149.py b/sapl/comissoes/migrations/0030_auto_20231007_2149.py new file mode 100644 index 000000000..42989b299 --- /dev/null +++ b/sapl/comissoes/migrations/0030_auto_20231007_2149.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.28 on 2023-10-08 00:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('comissoes', '0029_auto_20221019_2041'), + ] + + operations = [ + migrations.AlterField( + model_name='cargocomissao', + name='unico', + field=models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=True, verbose_name='Cargo Único'), + ), + ] diff --git a/sapl/comissoes/models.py b/sapl/comissoes/models.py index 75381e3a2..2d9a323d3 100644 --- a/sapl/comissoes/models.py +++ b/sapl/comissoes/models.py @@ -122,7 +122,7 @@ class CargoComissao(models.Model): ) nome = models.CharField(max_length=50, verbose_name=_('Nome do Cargo')) unico = models.BooleanField( - choices=YES_NO_CHOICES, verbose_name=_('Único'), default=True + choices=YES_NO_CHOICES, verbose_name=_('Cargo Único'), default=True ) class Meta: diff --git a/sapl/materia/migrations/0084_auto_20231007_2149.py b/sapl/materia/migrations/0084_auto_20231007_2149.py new file mode 100644 index 000000000..088e48257 --- /dev/null +++ b/sapl/materia/migrations/0084_auto_20231007_2149.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.28 on 2023-10-08 00:49 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('materia', '0083_auto_20230731_1845'), + ] + + operations = [ + migrations.AlterField( + model_name='relatoria', + name='materia', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='materia.MateriaLegislativa', verbose_name='Matéria'), + ), + ] diff --git a/sapl/parlamentares/migrations/0043_auto_20231007_2149.py b/sapl/parlamentares/migrations/0043_auto_20231007_2149.py new file mode 100644 index 000000000..2bca0922a --- /dev/null +++ b/sapl/parlamentares/migrations/0043_auto_20231007_2149.py @@ -0,0 +1,22 @@ +# Generated by Django 2.2.28 on 2023-10-08 00:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('parlamentares', '0042_auto_20230529_1641'), + ] + + operations = [ + migrations.AlterModelOptions( + name='cargomesa', + options={'ordering': ['id_ordenacao', 'unico', 'descricao'], 'verbose_name': 'Cargo na Mesa', 'verbose_name_plural': 'Cargos na Mesa'}, + ), + migrations.AddField( + model_name='cargomesa', + name='id_ordenacao', + field=models.PositiveIntegerField(blank=True, null=True, verbose_name='Posição na Ordenação'), + ), + ] diff --git a/sapl/parlamentares/models.py b/sapl/parlamentares/models.py index 8c6515d68..42b314ac2 100644 --- a/sapl/parlamentares/models.py +++ b/sapl/parlamentares/models.py @@ -478,11 +478,14 @@ class CargoMesa(models.Model): max_length=50, verbose_name=_('Cargo na Mesa')) unico = models.BooleanField( choices=YES_NO_CHOICES, verbose_name=_('Cargo Único'), default=True) + id_ordenacao = models.PositiveIntegerField( + blank=True, null=True, verbose_name=_('Posição na Ordenação'), + ) class Meta: verbose_name = _('Cargo na Mesa') verbose_name_plural = _('Cargos na Mesa') - ordering = ('unico', 'descricao') + ordering = ['id_ordenacao', 'unico', 'descricao'] def __str__(self): return self.descricao diff --git a/sapl/parlamentares/views.py b/sapl/parlamentares/views.py index 95df777bc..fca027f01 100644 --- a/sapl/parlamentares/views.py +++ b/sapl/parlamentares/views.py @@ -1038,7 +1038,7 @@ class MesaDiretoraView(FormView): '-data_inicio').first() if sessao_atual else None composicao_mesa = ComposicaoMesa.objects.select_related('cargo', 'parlamentar').filter( - mesa_diretora=mesa_diretora).order_by('cargo_id') + mesa_diretora=mesa_diretora).order_by('cargo__id_ordenacao', 'cargo_id') cargos_ocupados = [m.cargo for m in composicao_mesa] cargos = CargoMesa.objects.all() diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index 7657489d1..f11efbc06 100755 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -1753,7 +1753,7 @@ def atualizar_mesa(request): # Atualiza os componentes da view após a mudança composicao_mesa = IntegranteMesa.objects.filter( - sessao_plenaria=sessao.id).order_by('cargo_id') + sessao_plenaria=sessao.id).order_by('cargo__id_ordenacao', 'cargo_id') cargos_ocupados = [m.cargo for m in composicao_mesa] cargos = CargoMesa.objects.all() diff --git a/sapl/templates/parlamentares/layouts.yaml b/sapl/templates/parlamentares/layouts.yaml index d4527f9d9..9d2037477 100644 --- a/sapl/templates/parlamentares/layouts.yaml +++ b/sapl/templates/parlamentares/layouts.yaml @@ -1,7 +1,7 @@ {% load i18n %} CargoMesa: {% trans 'Cargo na Mesa'%}: - - descricao:10 unico + - descricao:7 id_ordenacao:3 unico:2 Legislatura: {% trans 'Legislatura' %}: