# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-11-17 09:29
from __future__ import unicode_literals

from datetime import date

from django.db import migrations, models

ALTERBOYS = [
    {
        "name": "Jag Sancee",
        "start_date": date(2013, 8, 22),
        "slug": "juggi",
    },
    {
        "name": "Nnamdi Awodu",
        "start_date": date(2015, 1, 8),
        "slug": "ndannamdi",
    },
    {
        "name": "Jude Nnadozie",
        "start_date": date(2012, 7, 4),
        "slug": "judez",
    },
]

def add_alterboy_data(apps, schema_editor):
    AlterBoy = apps.get_model('churchadmin', 'AlterBoy')
    for alterboy in ALTERBOYS:
        alterboy_object = AlterBoy.objects.create(
            name=alterboy['name'],
            start_date=alterboy['start_date'],
            slug=alterboy['slug'])

def remove_alterboy_data(apps, schema_editor):
    AlterBoy = apps.get_model('churchadmin', 'AlterBoy')
    for alterboy in ALTERBOYS:
        alterboy_object = AlterBoy.objects.get(slug=alterboy['slug'])
        alterboy_object.delete()

class Migration(migrations.Migration):

    dependencies = [
        ('churchadmin', '0005_cathecist_data'),
    ]

    operations = [
        migrations.RunPython(
            add_alterboy_data,
            remove_alterboy_data)
    ]
