# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-27 13:00
from __future__ import unicode_literals

import autoslug.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import resources.models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Feedback',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('anonymous', models.CharField(blank=True, max_length=50, null=True)),
                ('title', models.CharField(max_length=150)),
                ('description', models.TextField(max_length=255)),
                ('is_pro', models.BooleanField(default=True)),
                ('created_date', models.DateTimeField(auto_now_add=True, null=True)),
                ('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Language',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('language', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Photo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_main', models.BooleanField(default=False)),
                ('image', models.ImageField(blank=True, null=True, upload_to=resources.models.image_location)),
            ],
        ),
        migrations.CreateModel(
            name='Resource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=150)),
                ('description', models.TextField(max_length=255)),
                ('difficult_education', models.CharField(choices=[('in', 'Iniciantes'), ('me', 'Intermediários'), ('av', 'Avançados'), ('id', 'Indefinido')], default='id', max_length=2)),
                ('difficult_student', models.CharField(choices=[('in', 'Iniciantes'), ('me', 'Intermediários'), ('av', 'Avançados'), ('id', 'Indefinido')], default='id', max_length=2)),
                ('value', models.FloatField(blank=True, null=True)),
                ('url', models.CharField(blank=True, max_length=150, null=True)),
                ('slug', autoslug.fields.AutoSlugField(editable=False, null=True, populate_from='title')),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('last_modified_date', models.DateTimeField(auto_now=True)),
                ('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('languages', models.ManyToManyField(blank=True, to='resources.Language')),
                ('resources', models.ManyToManyField(blank=True, related_name='_resource_resources_+', to='resources.Resource')),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
            ],
        ),
        migrations.AddField(
            model_name='resource',
            name='tags',
            field=models.ManyToManyField(blank=True, to='resources.Tag'),
        ),
        migrations.AddField(
            model_name='photo',
            name='resource',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resources.Resource'),
        ),
        migrations.AddField(
            model_name='feedback',
            name='resource',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resources.Resource'),
        ),
    ]
