# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-09-20 03:11
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_resized.forms


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AbsPerm',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True, verbose_name='Ativo na plataforma')),
                ('is_banned', models.BooleanField(default=False, verbose_name='Banido da plataforma')),
                ('data_create', models.DateTimeField(default=django.utils.timezone.now)),
                ('data_published', models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='Ingredient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('word', models.CharField(max_length=35)),
                ('created_at', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='ProductSize',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sizes', models.CharField(max_length=18)),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('absperm_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.AbsPerm')),
                ('title', models.CharField(max_length=30, unique=True)),
                ('category_photo', django_resized.forms.ResizedImageField(upload_to='category')),
                ('description', models.TextField(max_length=144)),
                ('slug', models.SlugField(blank=True, null=True)),
            ],
            bases=('core.absperm', models.Model),
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('absperm_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.AbsPerm')),
                ('comment_text', models.TextField(max_length=144)),
            ],
            bases=('core.absperm', models.Model),
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('absperm_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.AbsPerm')),
                ('amount', models.IntegerField(default=1)),
                ('value', models.IntegerField(default=0)),
                ('payment', models.IntegerField(choices=[(0, 'Dinheiro'), (1, 'Cartão de debito'), (2, 'Cartão de crédito')], default=0)),
                ('delivered', models.BooleanField(default=0)),
                ('status', models.IntegerField(choices=[(0, 'Predido realizado'), (1, 'Pedido visualizado'), (2, 'Em Andamento'), (3, 'Saiu para entrega'), (4, 'Entregue'), (5, 'Cancelado')], default=0)),
                ('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cliente', to=settings.AUTH_USER_MODEL)),
            ],
            bases=('core.absperm', models.Model),
        ),
        migrations.CreateModel(
            name='Produto',
            fields=[
                ('absperm_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='core.AbsPerm')),
                ('title', models.CharField(default='', max_length=30)),
                ('description', models.TextField(default='', max_length=300)),
                ('amount', models.IntegerField(default=1)),
                ('price', models.FloatField(default=0)),
                ('preparation_time', models.IntegerField(default=0)),
                ('photo_thumb', django_resized.forms.ResizedImageField(blank=True, upload_to='products_photos/thumb')),
                ('photo_medium', django_resized.forms.ResizedImageField(upload_to='products_photos/medium')),
                ('category_product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='categorias', to='core.Category')),
                ('ingredients', models.ManyToManyField(related_name='ingredients', to='core.Ingredient')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='owner', to=settings.AUTH_USER_MODEL)),
                ('sizes', models.ManyToManyField(to='core.ProductSize')),
            ],
            bases=('core.absperm', models.Model),
        ),
        migrations.AddField(
            model_name='order',
            name='product',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='produto', to='core.Produto'),
        ),
        migrations.AddField(
            model_name='comment',
            name='product',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='product_comment', to='core.Produto'),
        ),
        migrations.AddField(
            model_name='comment',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='usuario', to=settings.AUTH_USER_MODEL),
        ),
    ]
