|
|
@ -1,7 +1,13 @@ |
|
|
# -*- coding: utf-8 -*- |
|
|
# -*- coding: utf-8 -*- |
|
|
from __future__ import unicode_literals |
|
|
from __future__ import unicode_literals |
|
|
|
|
|
|
|
|
from django.db import migrations |
|
|
from django.db import migrations |
|
|
|
|
|
import json |
|
|
|
|
|
import os |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from django.core.management import call_command |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def gera_partidos_tse(apps, schema_editor): |
|
|
def gera_partidos_tse(apps, schema_editor): |
|
|
# We get the model from the versioned app registry; |
|
|
# We get the model from the versioned app registry; |
|
|
@ -13,78 +19,10 @@ def gera_partidos_tse(apps, schema_editor): |
|
|
if partidos: |
|
|
if partidos: |
|
|
print("Carga de Partido não efetuada. Já Existem partidos cadastrados...") |
|
|
print("Carga de Partido não efetuada. Já Existem partidos cadastrados...") |
|
|
else: |
|
|
else: |
|
|
Partido.objects.using(db_alias).bulk_create([ |
|
|
fixture_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '../fixtures')) |
|
|
Partido(sigla="PMDB", |
|
|
fixture_filename = 'pre_popula_partidos.json' |
|
|
nome="PARTIDO DO MOVIMENTO DEMOCRÁTICO BRASILEIRO"), |
|
|
fixture_file = os.path.join(fixture_dir, fixture_filename) |
|
|
Partido(sigla="PTB", |
|
|
call_command('loaddata', fixture_file) |
|
|
nome="PARTIDO TRABALHISTA BRASILEIRO"), |
|
|
|
|
|
Partido(sigla="PDT", |
|
|
|
|
|
nome="PARTIDO DEMOCRÁTICO TRABALHISTA"), |
|
|
|
|
|
Partido(sigla="PT", |
|
|
|
|
|
nome="PARTIDO DOS TRABALHADORES"), |
|
|
|
|
|
Partido(sigla="DEM", |
|
|
|
|
|
nome="DEMOCRATAS"), |
|
|
|
|
|
Partido(sigla="PCdoB", |
|
|
|
|
|
nome="PARTIDO COMUNISTA DO BRASIL"), |
|
|
|
|
|
Partido(sigla="PSB", |
|
|
|
|
|
nome="PARTIDO SOCIALISTA BRASILEIRO"), |
|
|
|
|
|
Partido(sigla="PSDB", |
|
|
|
|
|
nome="PARTIDO DA SOCIAL DEMOCRACIA BRASILEIRA"), |
|
|
|
|
|
Partido(sigla="PTC", |
|
|
|
|
|
nome="PARTIDO TRABALHISTA CRISTÃO"), |
|
|
|
|
|
Partido(sigla="PSC", |
|
|
|
|
|
nome="PARTIDO SOCIAL CRISTÃO"), |
|
|
|
|
|
Partido(sigla="PMN", |
|
|
|
|
|
nome="PARTIDO DA MOBILIZAÇÃO NACIONAL"), |
|
|
|
|
|
Partido(sigla="PRP", |
|
|
|
|
|
nome="PARTIDO REPUBLICANO PROGRESSISTA"), |
|
|
|
|
|
Partido(sigla="PPS", |
|
|
|
|
|
nome="PARTIDO POPULAR SOCIALISTA"), |
|
|
|
|
|
Partido(sigla="PV", |
|
|
|
|
|
nome="PARTIDO VERDE"), |
|
|
|
|
|
Partido(sigla="PTdoB", |
|
|
|
|
|
nome="PARTIDO TRABALHISTA DO BRASIL"), |
|
|
|
|
|
Partido(sigla="PP", |
|
|
|
|
|
nome="PARTIDO PROGRESSISTA"), |
|
|
|
|
|
Partido(sigla="PSTU", |
|
|
|
|
|
nome="PARTIDO SOCIALISTA DOS TRABALHADORES UNIFICADO"), |
|
|
|
|
|
Partido(sigla="PCB", |
|
|
|
|
|
nome="PARTIDO COMUNISTA BRASILEIRO"), |
|
|
|
|
|
Partido(sigla="PRTB", |
|
|
|
|
|
nome="PARTIDO RENOVADOR TRABALHISTA BRASILEIRO"), |
|
|
|
|
|
Partido(sigla="PHS", |
|
|
|
|
|
nome="PARTIDO HUMANISTA DA SOLIDARIEDADE"), |
|
|
|
|
|
Partido(sigla="PSDC", |
|
|
|
|
|
nome="PARTIDO SOCIAL DEMOCRATA CRISTÃO"), |
|
|
|
|
|
Partido(sigla="PCO", |
|
|
|
|
|
nome="PARTIDO DA CAUSA OPERÁRIA"), |
|
|
|
|
|
Partido(sigla="PODE", |
|
|
|
|
|
nome="PODEMOS"), |
|
|
|
|
|
Partido(sigla="PSL", |
|
|
|
|
|
nome="PARTIDO SOCIAL LIBERAL"), |
|
|
|
|
|
Partido(sigla="PRB", |
|
|
|
|
|
nome="PARTIDO REPUBLICANO BRASILEIRO"), |
|
|
|
|
|
Partido(sigla="PSOL", |
|
|
|
|
|
nome="PARTIDO SOCIALISMO E LIBERDADE"), |
|
|
|
|
|
Partido(sigla="PR", |
|
|
|
|
|
nome="PARTIDO DA REPÚBLICA"), |
|
|
|
|
|
Partido(sigla="PSD", |
|
|
|
|
|
nome="PARTIDO SOCIAL DEMOCRÁTICO"), |
|
|
|
|
|
Partido(sigla="PPL", |
|
|
|
|
|
nome="PARTIDO PÁTRIA LIVRE"), |
|
|
|
|
|
Partido(sigla="PEN", |
|
|
|
|
|
nome="PARTIDO ECOLÓGICO NACIONAL"), |
|
|
|
|
|
Partido(sigla="PROS", |
|
|
|
|
|
nome="PARTIDO REPUBLICANO DA ORDEM SOCIAL"), |
|
|
|
|
|
Partido(sigla="SD", |
|
|
|
|
|
nome="SOLIDARIEDADE"), |
|
|
|
|
|
Partido(sigla="NOVO", |
|
|
|
|
|
nome="PARTIDO NOVO"), |
|
|
|
|
|
Partido(sigla="REDE", |
|
|
|
|
|
nome="REDE SUSTENTABILIDADE"), |
|
|
|
|
|
Partido(sigla="PMB", |
|
|
|
|
|
nome="PARTIDO DA MULHER BRASILEIRA"), |
|
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration): |
|
|
class Migration(migrations.Migration): |
|
|
|
|
|
|
|
|
|