# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-25 20:16
from __future__ import unicode_literals

import ckeditor.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Catalog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Имя каталога')),
                ('slug', models.SlugField(max_length=150, verbose_name='Ссылка')),
                ('description', ckeditor.fields.RichTextField(blank=True, verbose_name='Описание каталога')),
            ],
            options={
                'verbose_name_plural': 'Каталоги',
                'verbose_name': 'Каталог',
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Имя категории')),
                ('slug', models.SlugField(max_length=255, verbose_name='Ссылка')),
                ('description', ckeditor.fields.RichTextField(blank=True, verbose_name='Описание категории')),
                ('catalog', models.ManyToManyField(to='catalog.Catalog', verbose_name='Каталог')),
            ],
            options={
                'verbose_name_plural': 'Категории товаров',
                'verbose_name': 'Категория товара',
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=300, verbose_name='Наименование')),
                ('slug', models.SlugField(max_length=150, verbose_name='Ссылка')),
                ('description', models.TextField(blank=True, verbose_name='Описание')),
                ('img1', models.ImageField(blank=True, upload_to='img/products/%Y/%m/%d', verbose_name='Изображение 1')),
                ('img2', models.ImageField(blank=True, upload_to='img/products/%Y/%m/%d', verbose_name='Изображение 2')),
                ('img3', models.ImageField(blank=True, upload_to='img/products/%Y/%m/%d', verbose_name='Изображение 3')),
                ('price', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='Цена')),
                ('available', models.BooleanField(default=True, verbose_name='В наличии')),
                ('sku', models.CharField(max_length=10, verbose_name='Артикул')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='products', to='catalog.Category')),
            ],
            options={
                'verbose_name_plural': 'Товары',
                'verbose_name': 'Товар',
                'ordering': ('name',),
            },
        ),
    ]
