# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-06-08 19:26
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='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='название статьи')),
                ('image', models.ImageField(blank=True, null=True, upload_to='article_images/', verbose_name='прикрепленная картинка')),
                ('author', models.CharField(max_length=40, verbose_name='автор')),
                ('content', ckeditor_uploader.fields.RichTextUploadingField(blank=True, default='', verbose_name='Контент')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='дата добавления')),
                ('likes', models.IntegerField(default=0, editable=False, verbose_name='лайки')),
            ],
            options={
                'verbose_name': 'Статья',
                'verbose_name_plural': 'Статьи',
                'ordering': ['-created'],
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('short_name', models.CharField(max_length=50, verbose_name='Короткое название')),
                ('name', models.CharField(max_length=255, verbose_name='Название')),
                ('description', models.CharField(max_length=45, verbose_name='описание')),
            ],
            options={
                'verbose_name': 'Категория',
                'verbose_name_plural': 'Категории',
            },
        ),
        migrations.CreateModel(
            name='Comments',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comments_text', models.CharField(max_length=400, verbose_name='комментарий')),
                ('comments_date', models.DateTimeField(auto_now_add=True, verbose_name='дата добавления')),
                ('comments_aricle', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='article', to='post.Article')),
                ('comments_user', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Комментарий',
                'verbose_name_plural': 'Комментарии',
            },
        ),
        migrations.AddField(
            model_name='article',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='categores', to='post.Category', verbose_name='категория'),
        ),
    ]
