mirror of https://github.com/interlegis/sapl.git
12 changed files with 62 additions and 225 deletions
@ -1,15 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-03-13 13:21 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0025_auto_20180924_1724'), |
|||
] |
|||
|
|||
operations = [ |
|||
] |
|||
@ -1,39 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
from django.db import migrations |
|||
import json |
|||
import os |
|||
|
|||
|
|||
from django.core.management import call_command |
|||
|
|||
|
|||
def gera_partidos_tse(apps, schema_editor): |
|||
Partido = apps.get_model("parlamentares", "Partido") |
|||
db_alias = schema_editor.connection.alias |
|||
partidos = Partido.objects.all().exists() |
|||
|
|||
if partidos: |
|||
# Caso haja algum partido cadastrado na base de dados, |
|||
# a migração não deve ser carregada para evitar duplicações de dados. |
|||
print("Carga de Partido não efetuada. Já Existem partidos cadastrados...") |
|||
else: |
|||
fixture_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '../fixtures')) |
|||
# pega partidos listados em fixtures/pre_popula_partidos.json |
|||
fixture_filename = 'pre_popula_partidos.json' |
|||
fixture_file = os.path.join(fixture_dir, fixture_filename) |
|||
call_command('loaddata', fixture_file, ignorenonexistent=True) |
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
# A dependencia real desse script é o arquivo 0001_initial.py, mas |
|||
# isso gera um erro (Conflicting migrations detected; multiple leaf |
|||
# nodes in the migration graph). para não ocasionar problemas de migração, |
|||
# vamos manter a ordem padrão do django. |
|||
('parlamentares', '0026_partido_historico'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RunPython(gera_partidos_tse), |
|||
] |
|||
@ -1,19 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-04-30 11:39 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0026_bloco'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterModelTable( |
|||
name='bloco', |
|||
table=None, |
|||
), |
|||
] |
|||
@ -0,0 +1,34 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-05-17 13:50 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
import sapl.parlamentares.models |
|||
import sapl.utils |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0026_bloco'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='HistoricoPartido', |
|||
fields=[ |
|||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|||
('sigla', models.CharField(max_length=9, verbose_name='Sigla')), |
|||
('nome', models.CharField(max_length=50, verbose_name='Nome')), |
|||
('inicio_historico', models.DateField(verbose_name='Data Alteração')), |
|||
('fim_historico', models.DateField(verbose_name='Data Alteração')), |
|||
('logo_partido', models.ImageField(blank=True, null=True, upload_to=sapl.parlamentares.models.logo_upload_path, validators=[sapl.utils.restringe_tipos_de_arquivo_img], verbose_name='Logo Partido')), |
|||
('partido', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Partido')), |
|||
], |
|||
), |
|||
migrations.AlterModelTable( |
|||
name='bloco', |
|||
table=None, |
|||
), |
|||
] |
|||
@ -1,31 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-04-03 11:03 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
import django.utils.timezone |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0027_auto_20190313_1448'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='HistoricoPartido', |
|||
fields=[ |
|||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|||
('sigla', models.CharField(max_length=9, verbose_name='Sigla')), |
|||
('nome', models.CharField(max_length=50, verbose_name='Nome')), |
|||
('data_alteracao', models.DateField(default=django.utils.timezone.now, verbose_name='Data Alteração')), |
|||
], |
|||
), |
|||
migrations.AddField( |
|||
model_name='historicopartido', |
|||
name='partido', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='parlamentares.Partido'), |
|||
), |
|||
] |
|||
@ -1,21 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-04-09 11:23 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0028_auto_20190403_0803'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AddField( |
|||
model_name='historicopartido', |
|||
name='proximo', |
|||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='parlamentares.HistoricoPartido'), |
|||
), |
|||
] |
|||
@ -1,33 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-04-09 13:30 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.utils.timezone |
|||
import sapl.parlamentares.models |
|||
import sapl.utils |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0029_historicopartido_proximo'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RenameField( |
|||
model_name='historicopartido', |
|||
old_name='data_alteracao', |
|||
new_name='fim_historico', |
|||
), |
|||
migrations.AddField( |
|||
model_name='historicopartido', |
|||
name='inicio_historico', |
|||
field=models.DateField(default=django.utils.timezone.now, verbose_name='Data Alteração'), |
|||
), |
|||
migrations.AddField( |
|||
model_name='historicopartido', |
|||
name='logo_partido', |
|||
field=models.ImageField(blank=True, null=True, upload_to=sapl.parlamentares.models.logo_upload_path, validators=[sapl.utils.restringe_tipos_de_arquivo_img], verbose_name='Logo Partido'), |
|||
), |
|||
] |
|||
@ -1,25 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-04-11 12:19 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0030_auto_20190409_1030'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RemoveField( |
|||
model_name='historicopartido', |
|||
name='proximo', |
|||
), |
|||
migrations.AlterField( |
|||
model_name='composicaocoligacao', |
|||
name='partido', |
|||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='parlamentares.Partido', verbose_name='Partidos da Coligação'), |
|||
), |
|||
] |
|||
@ -1,16 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-05-07 11:57 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0031_auto_20190411_0919'), |
|||
('parlamentares', '0027_auto_20190430_0839'), |
|||
] |
|||
|
|||
operations = [ |
|||
] |
|||
@ -1,25 +0,0 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.11.20 on 2019-05-16 11:43 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('parlamentares', '0032_merge_20190507_0857'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='historicopartido', |
|||
name='fim_historico', |
|||
field=models.DateField(verbose_name='Data Alteração'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='historicopartido', |
|||
name='inicio_historico', |
|||
field=models.DateField(verbose_name='Data Alteração'), |
|||
), |
|||
] |
|||
Loading…
Reference in new issue