# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-10-08 22:35
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import smart_selects.db_fields


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('slug', models.SlugField(blank=True, editable=False)),
                ('logo', models.ImageField(blank=True, null=True, upload_to='images/')),
                ('section', models.CharField(max_length=200)),
                ('description', models.TextField()),
                ('wiki', models.URLField(blank=True)),
                ('url', models.URLField(blank=True)),
                ('published', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Companies',
            },
        ),
        migrations.CreateModel(
            name='Tool',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('slug', models.SlugField(blank=True, editable=False)),
                ('published', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ToolCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('slug', models.SlugField(blank=True, editable=False)),
                ('order', models.IntegerField(default=1)),
            ],
            options={
                'verbose_name': 'Tool Category',
                'verbose_name_plural': 'Tool Categories',
            },
        ),
        migrations.CreateModel(
            name='ToolEntry',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='business.ToolCategory')),
            ],
            options={
                'verbose_name': 'Tool Entry',
                'verbose_name_plural': 'Tool Entries',
            },
        ),
        migrations.CreateModel(
            name='ToolField',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('icon', models.ImageField(blank=True, null=True, upload_to='images/')),
                ('hint', models.TextField()),
                ('order', models.IntegerField(default=1)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='business.ToolCategory')),
            ],
            options={
                'verbose_name': 'Tool Field',
                'verbose_name_plural': 'Tool Fields',
            },
        ),
        migrations.AddField(
            model_name='toolentry',
            name='field',
            field=smart_selects.db_fields.ChainedForeignKey(auto_choose=True, chained_field='category', chained_model_field='category', on_delete=django.db.models.deletion.CASCADE, to='business.ToolField'),
        ),
        migrations.AddField(
            model_name='toolentry',
            name='tool',
            field=smart_selects.db_fields.ChainedForeignKey(auto_choose=True, chained_field='category', chained_model_field='category', on_delete=django.db.models.deletion.CASCADE, to='business.Tool'),
        ),
        migrations.AddField(
            model_name='tool',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='business.ToolCategory'),
        ),
        migrations.AddField(
            model_name='tool',
            name='company',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='business.Company'),
        ),
    ]
