# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-10-21 18:17
from __future__ import unicode_literals

from django.db import migrations, models

from real_estate.models.property import BasePropertyModel


def create_decoration_objects(apps, schema_editor):
    """ It creates Decoration objects based on
    BasePropertyModel.INTERIOR_DECORATION_CHOICES"""
    Decoration = apps.get_model("real_estate", "decoration")
    choices = BasePropertyModel.INTERIOR_DECORATION_CHOICES
    for choice in choices:
        abbr, name = choice
        Decoration.objects.create(name=name)


class Migration(migrations.Migration):

    dependencies = [
        ('real_estate', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Decoration',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=127, unique=True, verbose_name='тип отделки/ремонта')),
            ],
            options={
                'verbose_name': 'тип отделки/ремонта',
                'verbose_name_plural': 'типы отделки/ремонта',
            },
        ),
        migrations.RunPython(
            create_decoration_objects,
            reverse_code=migrations.RunPython.noop
        ),
    ]

# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-10-21 18:17
from __future__ import unicode_literals

from django.db import migrations, models

from real_estate.models.property import BasePropertyModel


def create_decoration_objects(apps, schema_editor):
    """ It creates Decoration objects based on
    BasePropertyModel.INTERIOR_DECORATION_CHOICES"""
    Decoration = apps.get_model("real_estate", "decoration")
    choices = BasePropertyModel.INTERIOR_DECORATION_CHOICES
    for choice in choices:
        abbr, name = choice
        Decoration.objects.create(name=name)


class Migration(migrations.Migration):

    dependencies = [
        ('real_estate', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Decoration',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=127, unique=True, verbose_name='тип отделки/ремонта')),
            ],
            options={
                'verbose_name': 'тип отделки/ремонта',
                'verbose_name_plural': 'типы отделки/ремонта',
            },
        ),
        migrations.RunPython(
            create_decoration_objects,
            reverse_code=migrations.RunPython.noop
        ),
    ]

# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-10-21 18:17 It creates Decoration objects based on     BasePropertyModel.INTERIOR_DECORATION_CHOICES