# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-23 19:01
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('img', models.ImageField(upload_to='images/%Y/%m')),
                ('alt', models.CharField(help_text='Цей текст буде вставлений до атрибуту alt', max_length=30, verbose_name='Опис')),
            ],
            options={
                'verbose_name_plural': 'Зображення',
                'verbose_name': 'Зображення',
            },
        ),
        migrations.CreateModel(
            name='News',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slug', models.SlugField(max_length=150, unique=True)),
                ('title', models.CharField(db_index=True, max_length=150, unique=True, verbose_name='Заголовок')),
                ('content', ckeditor_uploader.fields.RichTextUploadingField(verbose_name='Наповнення')),
                ('description', models.CharField(max_length=255, verbose_name='Опис')),
                ('created', models.DateField(auto_now_add=True, verbose_name='Дата створення')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('blog_news_img', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='news', to='news.Image')),
            ],
            options={
                'verbose_name_plural': 'Новини',
                'verbose_name': 'Новина',
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=25)),
            ],
            options={
                'verbose_name_plural': 'Теги',
                'verbose_name': 'Тег',
            },
        ),
        migrations.AddField(
            model_name='news',
            name='tags',
            field=models.ManyToManyField(blank=True, to='news.Tag', verbose_name='Теги'),
        ),
    ]
