# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-26 21:21
from __future__ import unicode_literals

from django.db import migrations, models


def get_status(apps, schema_editor):
    Episode = apps.get_model('podcast', 'Episode')
    for episode in Episode.objects.all():
        episode.status = 'public'
        episode.save(update_fields=['status'])


class Migration(migrations.Migration):

    dependencies = [
        ('podcast', '0019_auto_20170924_1839'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='episode',
            options={'ordering': ['-pub_date', '-id'], 'verbose_name': 'episode', 'verbose_name_plural': 'episodes'},
        ),
        migrations.AddField(
            model_name='episode',
            name='status',
            field=models.CharField(choices=[('public', 'Public'), ('secret', 'Secret'), ('private', 'Private')], default='public', help_text='Public is openly visible; secret is visibile but unlisted; private is not visible', max_length=255, verbose_name='status'),
        ),
        migrations.AlterField(
            model_name='episode',
            name='pub_date',
            field=models.DateTimeField(help_text='If in future, episode hidden until date arrives (unless status is secret)', verbose_name='pub date'),
        ),
        migrations.RunPython(get_status, reverse_code=migrations.RunPython.noop),
    ]
