mirror of https://github.com/interlegis/sapl.git
6 changed files with 190 additions and 36 deletions
@ -0,0 +1,14 @@ |
|||
kind: pipeline |
|||
name: default |
|||
steps: |
|||
- name: sapl |
|||
image: interlegis/sapl |
|||
settings: |
|||
repo: porto.interlegis.leg.br/spdt/sapl |
|||
registry: porto.interlegis.leg.br |
|||
dockerfile: docker/Dockerfile |
|||
auto_tag: true |
|||
username: |
|||
from_secret: porto_user |
|||
password: |
|||
from_secret: porto_pw |
|||
@ -0,0 +1,38 @@ |
|||
# Generated by Django 2.2.20 on 2021-07-05 13:41 |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0035_auto_20210315_1522'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterModelOptions( |
|||
name='composicaomesa', |
|||
options={'ordering': ('cargo', 'parlamentar'), 'verbose_name': 'Ocupação de cargo na Mesa', 'verbose_name_plural': 'Ocupações de cargo na Mesa'}, |
|||
), |
|||
migrations.CreateModel( |
|||
name='MesaDiretora', |
|||
fields=[ |
|||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|||
('data_inicio', models.DateField(null=True, verbose_name='Data Início')), |
|||
('data_fim', models.DateField(null=True, verbose_name='Data Fim')), |
|||
('descricao', models.TextField(blank=True, verbose_name='Descrição')), |
|||
('sessao_legislativa', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.SessaoLegislativa')), |
|||
], |
|||
options={ |
|||
'verbose_name': 'Mesa Diretora', |
|||
'verbose_name_plural': 'Mesas Diretoras', |
|||
'ordering': ('-data_inicio', '-sessao_legislativa'), |
|||
}, |
|||
), |
|||
migrations.AddField( |
|||
model_name='composicaomesa', |
|||
name='mesa_diretora', |
|||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.MesaDiretora'), |
|||
), |
|||
] |
|||
@ -0,0 +1,27 @@ |
|||
# Generated by Django 2.2.20 on 2021-07-05 13:43 |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
def atribuiMesaDiretora(apps, schema_editor): |
|||
sl_anterior = None |
|||
ComposicaoMesa = apps.get_model('parlamentares', 'ComposicaoMesa') |
|||
for c in ComposicaoMesa.objects.all().order_by('sessao_legislativa_id'): |
|||
if sl_anterior is None or c.sessao_legislativa_id != sl_anterior: |
|||
sl_anterior = c.sessao_legislativa_id |
|||
MesaDiretora = apps.get_model('parlamentares', 'MesaDiretora') |
|||
mesa_diretora = MesaDiretora(data_inicio=c.sessao_legislativa.data_inicio, |
|||
data_fim=c.sessao_legislativa.data_fim, |
|||
sessao_legislativa=c.sessao_legislativa) |
|||
mesa_diretora.save() |
|||
c.mesa_diretora = mesa_diretora |
|||
c.save() |
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0036_refatoraMesaDiretora'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RunPython(atribuiMesaDiretora), |
|||
] |
|||
@ -0,0 +1,17 @@ |
|||
# Generated by Django 2.2.20 on 2021-07-05 13:49 |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0037_atribuiMesaDiretora'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RemoveField( |
|||
model_name='composicaomesa', |
|||
name='sessao_legislativa', |
|||
), |
|||
] |
|||
Loading…
Reference in new issue