# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-07-26 19:28
from __future__ import unicode_literals

from django.db import migrations, models


def preset_gray_status_name(apps, schema_editor):
    status_arr = {'preparation': "准备中", 'testing': "测试中", 'finished': "已结束"}
    type_model = apps.get_model('task_manager', 'graystatus')
    for k, v in status_arr.items():
        type_model.objects.filter(name=k).update(description=v)


class Migration(migrations.Migration):

    dependencies = [
        ('task_manager', '0009_auto_20170725_2009'),
    ]

    operations = [
        migrations.AddField(
            model_name='graystatus',
            name='description',
            field=models.CharField(default='', max_length=256, verbose_name='状态中文名称'),
        ),
        migrations.AlterUniqueTogether(
            name='grayappversion',
            unique_together=set([('gray_task', 'current_step')]),
        ),
        migrations.RunPython(preset_gray_status_name)
    ]
