# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-15 19:20
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import wagtail.wagtailcore.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('wagtailcore', '0030_index_on_pagerevision_created_at'),
        ('wagtailimages', '0015_fill_filter_spec_field'),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
                ('intro', models.CharField(max_length=250)),
                ('main_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
            ],
            options={
                'verbose_name': 'Categoria',
                'verbose_name_plural': 'Categorias',
            },
            bases=('wagtailcore.page',),
        ),
        migrations.CreateModel(
            name='Feature',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=15, verbose_name=b'Nombre')),
            ],
            options={
                'verbose_name': 'Caracter\xedstica',
                'verbose_name_plural': 'Caracter\xedsticas',
            },
        ),
        migrations.CreateModel(
            name='Picture',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
                ('description', wagtail.wagtailcore.fields.RichTextField(help_text=b'Describe tu producto al p\xc3\xbablico', verbose_name=b'Descripcion')),
                ('main_image', models.ForeignKey(blank=True, help_text=b'Imagen principal de tu producto', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')),
            ],
            options={
                'verbose_name': 'Producto',
                'verbose_name_plural': 'Productos',
            },
            bases=('wagtailcore.page',),
        ),
        migrations.CreateModel(
            name='Variant',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.CharField(blank=True, help_text=b"Ejemplo: Si tu caracter\xc3\xadstica es 'Color', valor podr\xc3\xada ser 'Verde'", max_length=200, null=True, verbose_name=b'Valor de caracter\xc3\xadstica')),
                ('price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name=b'Precio')),
                ('discount_percentage', models.PositiveIntegerField(blank=True, help_text=b'Si esta referencia est\xc3\xa1 en oferta, ingresa el porcentaje de descuento', null=True, verbose_name=b'Porcentaje de descuento')),
                ('stock_quantity', models.IntegerField(verbose_name=b'Cantidad de stock')),
                ('feature', models.ForeignKey(blank=True, help_text=b'Caracter\xc3\xadsticas para esta referencia. Ejemplo: Color', null=True, on_delete=django.db.models.deletion.CASCADE, to='products.Feature')),
                ('product', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='variants', to='products.Product')),
            ],
            options={
                'verbose_name': 'Referencia',
                'verbose_name_plural': 'Referencias',
            },
        ),
        migrations.CreateModel(
            name='ProductPicture',
            fields=[
                ('picture_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='products.Picture')),
                ('sort_order', models.IntegerField(blank=True, editable=False, null=True)),
                ('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='pictures', to='products.Product')),
            ],
            options={
                'ordering': ['sort_order'],
                'abstract': False,
            },
            bases=('products.picture', models.Model),
        ),
        migrations.AddField(
            model_name='picture',
            name='image',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image'),
        ),
    ]
