Browse Source

Apaga Numeração se TipoMateriaLegislativa é apagado

pull/3689/head
Edward Ribeiro 1 year ago
parent
commit
c76136cb6d
  1. 19
      sapl/materia/migrations/0085_auto_20231028_1838.py
  2. 2
      sapl/materia/models.py

19
sapl/materia/migrations/0085_auto_20231028_1838.py

@ -0,0 +1,19 @@
# Generated by Django 2.2.28 on 2023-10-28 21:38
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('materia', '0084_auto_20231007_2149'),
]
operations = [
migrations.AlterField(
model_name='numeracao',
name='tipo_materia',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='materia.TipoMateriaLegislativa', verbose_name='Tipo de Matéria'),
),
]

2
sapl/materia/models.py

@ -624,7 +624,7 @@ class Numeracao(models.Model):
materia = models.ForeignKey(MateriaLegislativa, on_delete=models.CASCADE)
tipo_materia = models.ForeignKey(
TipoMateriaLegislativa,
on_delete=models.PROTECT,
on_delete=models.CASCADE,
verbose_name=_('Tipo de Matéria'))
numero_materia = models.CharField(max_length=5,
verbose_name=_('Número'))

Loading…
Cancel
Save