# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-07 19:54
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import pcart_import.models
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('pcart_catalog', '0019_auto_20170505_1202'),
    ]

    operations = [
        migrations.CreateModel(
            name='XLSColumn',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('column_index', models.CharField(max_length=100, verbose_name='Column index')),
                ('use_column_label', models.BooleanField(default=True, help_text='If checked "Column index" is related to column label, otherwise it is a column number.', verbose_name='Use column label')),
                ('destination', models.CharField(choices=[('product_type', 'Product type'), ('collection', 'Collection'), ('extra_collection', 'Extra collection'), ('vendor', 'Vendor'), ('product', 'Product'), ('external_id', 'External ID'), ('product_image', 'Product image'), ('product_property', 'Product property')], help_text='See documentation for supported values.', max_length=100, verbose_name='Destination')),
                ('sub_destination', models.CharField(blank=True, default='', max_length=100, verbose_name='Sub-destination')),
                ('function', models.TextField(blank=True, default='', help_text='Use P-Cart Script for implementing complex logic.', verbose_name='Function')),
            ],
            options={
                'verbose_name': 'XLS column',
                'ordering': ['column_index'],
                'verbose_name_plural': 'XLS columns',
            },
        ),
        migrations.CreateModel(
            name='XLSImportProfile',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=255, unique=True, verbose_name='Title')),
                ('first_row_as_labels', models.BooleanField(default=True, help_text='Get column labels from the first row.', verbose_name='First row as labels')),
                ('added', models.DateTimeField(auto_now_add=True, verbose_name='Added')),
                ('changed', models.DateTimeField(auto_now=True, verbose_name='Changed')),
                ('default_collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pcart_catalog.Collection', verbose_name='Default collection')),
                ('default_product_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pcart_catalog.ProductType', verbose_name='Default product type')),
            ],
            options={
                'verbose_name': 'XLS Import profile',
                'ordering': ['title'],
                'verbose_name_plural': 'XLS Import profiles',
            },
        ),
        migrations.CreateModel(
            name='XLSPriceList',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('file', models.FileField(help_text='Price list file.', upload_to=pcart_import.models.generate_price_list_filename, verbose_name='Price list')),
                ('status', models.CharField(default='new', max_length=70, verbose_name='Status')),
                ('added', models.DateTimeField(auto_now_add=True, verbose_name='Added')),
                ('changed', models.DateTimeField(auto_now=True, verbose_name='Changed')),
                ('profile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='price_lists', to='pcart_import.XLSImportProfile', verbose_name='Import profile')),
            ],
            options={
                'verbose_name': 'XLS Price-list',
                'ordering': ['added'],
                'verbose_name_plural': 'XLS Price-lists',
            },
        ),
        migrations.AddField(
            model_name='xlscolumn',
            name='profile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='columns', to='pcart_import.XLSImportProfile', verbose_name='Import profile'),
        ),
    ]
