Browse Source

HOT-FIX: remover comissão referenciada

Remover comissão referenciada por Composição e Participação.
pull/3065/merge
eribeiro 5 years ago
parent
commit
00e8f112c1
  1. 26
      sapl/comissoes/migrations/0024_auto_20200602_0915.py
  2. 4
      sapl/comissoes/models.py

26
sapl/comissoes/migrations/0024_auto_20200602_0915.py

@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-06-02 12:15
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('comissoes', '0023_auto_20191211_1752'),
]
operations = [
migrations.AlterField(
model_name='composicao',
name='comissao',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='comissoes.Comissao', verbose_name='Comissão'),
),
migrations.AlterField(
model_name='participacao',
name='composicao',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='participacao_set', to='comissoes.Composicao', verbose_name='Composição'),
),
]

4
sapl/comissoes/models.py

@ -141,7 +141,7 @@ class CargoComissao(models.Model):
@reversion.register() @reversion.register()
class Composicao(models.Model): # IGNORE class Composicao(models.Model): # IGNORE
comissao = models.ForeignKey(Comissao, comissao = models.ForeignKey(Comissao,
on_delete=models.PROTECT, on_delete=models.CASCADE,
verbose_name=_('Comissão')) verbose_name=_('Comissão'))
periodo = models.ForeignKey(Periodo, periodo = models.ForeignKey(Periodo,
on_delete=models.PROTECT, on_delete=models.PROTECT,
@ -160,7 +160,7 @@ class Composicao(models.Model): # IGNORE
class Participacao(models.Model): # ComposicaoComissao class Participacao(models.Model): # ComposicaoComissao
composicao = models.ForeignKey(Composicao, composicao = models.ForeignKey(Composicao,
related_name='participacao_set', related_name='participacao_set',
on_delete=models.PROTECT, on_delete=models.CASCADE,
verbose_name=_('Composição')) verbose_name=_('Composição'))
parlamentar = models.ForeignKey(Parlamentar, parlamentar = models.ForeignKey(Parlamentar,
on_delete=models.PROTECT, on_delete=models.PROTECT,

Loading…
Cancel
Save