diff --git a/compilacao/migrations/0050_auto_20160503_0926.py b/compilacao/migrations/0050_auto_20160503_0926.py new file mode 100644 index 000000000..27c43be97 --- /dev/null +++ b/compilacao/migrations/0050_auto_20160503_0926.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.5 on 2016-05-03 12:26 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('compilacao', '0049_merge'), + ] + + operations = [ + migrations.AlterField( + model_name='dispositivo', + name='dispositivo_subsequente', + field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dispositivo_subsequente_set', to='compilacao.Dispositivo', verbose_name='Dispositivo Subsequente'), + ), + migrations.AlterField( + model_name='dispositivo', + name='dispositivo_substituido', + field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dispositivo_substituido_set', to='compilacao.Dispositivo', verbose_name='Dispositivo Substituido'), + ), + migrations.AlterField( + model_name='nota', + name='dispositivo', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dispositivo_nota_set', to='compilacao.Dispositivo', verbose_name='Dispositivo da Nota'), + ), + migrations.AlterField( + model_name='tipodispositivo', + name='relacoes_diretas_pai_filho', + field=models.ManyToManyField(related_name='relacaoes_pai_filho', through='compilacao.TipoDispositivoRelationship', to='compilacao.TipoDispositivo'), + ), + migrations.AlterField( + model_name='vide', + name='dispositivo_base', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dispositivo_base_set', to='compilacao.Dispositivo', verbose_name='Dispositivo Base'), + ), + migrations.AlterField( + model_name='vide', + name='dispositivo_ref', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dispositivo_citado_set', to='compilacao.Dispositivo', verbose_name='Dispositivo Referido'), + ), + ] diff --git a/compilacao/models.py b/compilacao/models.py index 90a3c5c35..a5f1b7bc0 100644 --- a/compilacao/models.py +++ b/compilacao/models.py @@ -1,4 +1,3 @@ - from django.contrib.auth.models import User from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType @@ -340,7 +339,7 @@ class TipoDispositivo(BaseModel): through='TipoDispositivoRelationship', through_fields=('pai', 'filho_permitido'), symmetrical=False, - related_name='+') + related_name='relacaoes_pai_filho') class Meta: verbose_name = _('Tipo de Dispositivo') @@ -608,13 +607,13 @@ class Dispositivo(BaseModel, TimestampedMixin): dispositivo_subsequente = models.ForeignKey( 'self', blank=True, null=True, default=None, - related_name='+', + related_name='dispositivo_subsequente_set', on_delete=models.SET_NULL, verbose_name=_('Dispositivo Subsequente')) dispositivo_substituido = models.ForeignKey( 'self', blank=True, null=True, default=None, - related_name='+', + related_name='dispositivo_substituido_set', on_delete=models.SET_NULL, verbose_name=_('Dispositivo Substituido')) dispositivo_pai = models.ForeignKey( @@ -1213,10 +1212,10 @@ class Vide(TimestampedMixin): dispositivo_base = models.ForeignKey( Dispositivo, verbose_name=_('Dispositivo Base'), - related_name='cita') + related_name='dispositivo_base_set') dispositivo_ref = models.ForeignKey( Dispositivo, - related_name='citado', + related_name='dispositivo_citado_set', verbose_name=_('Dispositivo Referido')) class Meta: @@ -1265,7 +1264,7 @@ class Nota(TimestampedMixin): dispositivo = models.ForeignKey( Dispositivo, verbose_name=_('Dispositivo da Nota'), - related_name='notas') + related_name='dispositivo_nota_set') owner = models.ForeignKey(User, verbose_name=_('Dono da Nota')) publicidade = models.PositiveSmallIntegerField( diff --git a/materia/migrations/0031_merge.py b/materia/migrations/0031_merge.py new file mode 100644 index 000000000..46b6d59a3 --- /dev/null +++ b/materia/migrations/0031_merge.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.5 on 2016-05-03 12:26 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('materia', '0030_auto_20160429_1349'), + ('materia', '0030_auto_20160502_1630'), + ] + + operations = [ + ] diff --git a/materia/migrations/0032_auto_20160503_0926.py b/materia/migrations/0032_auto_20160503_0926.py new file mode 100644 index 000000000..0ece4f329 --- /dev/null +++ b/materia/migrations/0032_auto_20160503_0926.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.5 on 2016-05-03 12:26 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('materia', '0031_merge'), + ] + + operations = [ + migrations.AlterField( + model_name='anexada', + name='materia_anexada', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='materia_anexada_set', to='materia.MateriaLegislativa'), + ), + migrations.AlterField( + model_name='anexada', + name='materia_principal', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='materia_principal_set', to='materia.MateriaLegislativa'), + ), + ] diff --git a/materia/models.py b/materia/models.py index 0eb2037c8..eb9c11d40 100644 --- a/materia/models.py +++ b/materia/models.py @@ -156,8 +156,10 @@ class AcompanhamentoMateria(models.Model): class Anexada(models.Model): - materia_principal = models.ForeignKey(MateriaLegislativa, related_name='+') - materia_anexada = models.ForeignKey(MateriaLegislativa, related_name='+') + materia_principal = models.ForeignKey( + MateriaLegislativa, related_name='materia_principal_set') + materia_anexada = models.ForeignKey( + MateriaLegislativa, related_name='materia_anexada_set') data_anexacao = models.DateField(verbose_name=_('Data Anexação')) data_desanexacao = models.DateField( blank=True, null=True, verbose_name=_('Data Desanexação')) diff --git a/norma/migrations/0013_auto_20160503_0926.py b/norma/migrations/0013_auto_20160503_0926.py new file mode 100644 index 000000000..8c15dae96 --- /dev/null +++ b/norma/migrations/0013_auto_20160503_0926.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.5 on 2016-05-03 12:26 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('norma', '0012_auto_20160309_1407'), + ] + + operations = [ + migrations.AlterField( + model_name='vinculonormajuridica', + name='norma_referente', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='norma_referente_set', to='norma.NormaJuridica'), + ), + migrations.AlterField( + model_name='vinculonormajuridica', + name='norma_referida', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='norma_referida_set', to='norma.NormaJuridica'), + ), + ] diff --git a/norma/models.py b/norma/models.py index 37d48d20b..06a4531d0 100644 --- a/norma/models.py +++ b/norma/models.py @@ -175,8 +175,10 @@ class VinculoNormaJuridica(models.Model): ) # TODO M2M ??? - norma_referente = models.ForeignKey(NormaJuridica, related_name='+') - norma_referida = models.ForeignKey(NormaJuridica, related_name='+') + norma_referente = models.ForeignKey( + NormaJuridica, related_name='norma_referente_set') + norma_referida = models.ForeignKey( + NormaJuridica, related_name='norma_referida_set') tipo_vinculo = models.CharField( max_length=1, blank=True, choices=TIPO_VINCULO_CHOICES) diff --git a/protocoloadm/migrations/0012_auto_20160503_0926.py b/protocoloadm/migrations/0012_auto_20160503_0926.py new file mode 100644 index 000000000..cc7da204c --- /dev/null +++ b/protocoloadm/migrations/0012_auto_20160503_0926.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.5 on 2016-05-03 12:26 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('protocoloadm', '0011_auto_20160318_1504'), + ] + + operations = [ + migrations.AlterField( + model_name='tramitacaoadministrativo', + name='unidade_tramitacao_destino', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='adm_tramitacoes_destino', to='materia.UnidadeTramitacao', verbose_name='Unidade Destino'), + ), + migrations.AlterField( + model_name='tramitacaoadministrativo', + name='unidade_tramitacao_local', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='adm_tramitacoes_origem', to='materia.UnidadeTramitacao', verbose_name='Unidade Local'), + ), + ] diff --git a/protocoloadm/models.py b/protocoloadm/models.py index bd58a9933..9d2f922cd 100644 --- a/protocoloadm/models.py +++ b/protocoloadm/models.py @@ -165,7 +165,7 @@ class TramitacaoAdministrativo(models.Model): UnidadeTramitacao, blank=True, null=True, - related_name='+', + related_name='adm_tramitacoes_origem', verbose_name=_('Unidade Local')) data_encaminhamento = models.DateField( blank=True, null=True, verbose_name=_('Data Encaminhamento')) @@ -173,7 +173,7 @@ class TramitacaoAdministrativo(models.Model): UnidadeTramitacao, blank=True, null=True, - related_name='+', + related_name='adm_tramitacoes_destino', verbose_name=_('Unidade Destino')) ultima = models.BooleanField() texto = models.TextField(