# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-08-27 22:21
from __future__ import unicode_literals

from django.db import migrations


def _get_seasons():
    return '2012 2013 2014 2015 2016 2017'.split()


def add_seasons(apps, schema_editor):
    Season = apps.get_model('cpm_data.Season')

    Season.objects.bulk_create(
        [Season(name_en=s, name_be=s, name_ru=s) for s in _get_seasons()]
    )


def remove_seasons(apps, schema_editor):
    Season = apps.get_model('cpm_data.Season')

    Season.objects.delete(name_en__in=_get_seasons())


class Migration(migrations.Migration):

    dependencies = [
        ('cpm_data', '0003_seasonrelatedjurymember_seasonrelatedpartner'),
    ]

    operations = [
        migrations.RunPython(add_seasons, remove_seasons),
    ]

Add migrations for adding seasons
Add migrations for adding seasons
