# Generated by Django 1.11.9 on 2018-01-30 19:18

import django.db.models.deletion
import django.db.models.manager
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [("fluent_pages", "0001_initial")]

    operations = [
        migrations.CreateModel(
            name="Product",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("title", models.CharField(max_length=200, verbose_name="Title")),
                ("slug", models.SlugField(verbose_name="Slug")),
                ("description", models.TextField(verbose_name="Description")),
                (
                    "price",
                    models.DecimalField(decimal_places=2, max_digits=10, verbose_name="Price"),
                ),
            ],
            options={
                "verbose_name": "Product",
                "verbose_name_plural": "Products",
                "ordering": ("title",),
            },
        ),
        migrations.CreateModel(
            name="ProductCategory",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("title", models.CharField(max_length=200, verbose_name="Title")),
                ("slug", models.SlugField(verbose_name="Slug")),
            ],
            options={
                "verbose_name": "Productcategory",
                "verbose_name_plural": "Productcategories",
                "ordering": ("title",),
            },
        ),
        migrations.CreateModel(
            name="ProductCategoryPage",
            fields=[
                (
                    "urlnode_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="fluent_pages.UrlNode",
                    ),
                ),
                (
                    "product_category",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="simpleshop.ProductCategory",
                    ),
                ),
            ],
            options={
                "verbose_name": "Product category page",
                "verbose_name_plural": "Product category pages",
                "db_table": "pagetype_simpleshop_productcategorypage",
            },
            bases=("fluent_pages.page",),
        ),
        migrations.AddField(
            model_name="product",
            name="category",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="products",
                to="simpleshop.ProductCategory",
                verbose_name="Category",
            ),
        ),
    ]
