# Generated by Django 2.2 on 2019-04-19 08:28

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Categories',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=254, verbose_name='name')),
                ('slug', models.SlugField(blank=True, max_length=254, unique=True)),
                ('sort_order', models.PositiveSmallIntegerField(default=10, verbose_name='Sort order')),
                ('status', models.BooleanField(default=0, verbose_name='Status')),
                ('parent_category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.Categories', verbose_name='Parent category')),
            ],
            options={
                'verbose_name': 'Category',
                'verbose_name_plural': 'Categories',
                'db_table': 'your_collection_name',
                'ordering': ['sort_order'],
            },
        ),
        migrations.CreateModel(
            name='News',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=254, verbose_name='name')),
                ('slug', models.SlugField(blank=True, max_length=254, unique=True)),
                ('short_description', models.TextField(verbose_name='Short description')),
                ('description', models.TextField(verbose_name='Description')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('publish_at', models.DateTimeField(verbose_name='Publish at')),
                ('feature_img', models.ImageField(blank=True, max_length=254, null=True, upload_to='img/news/2019/4', verbose_name='Feature Image')),
                ('status', models.BooleanField(default=0, verbose_name='Status')),
                ('views_count', models.IntegerField(default=0, verbose_name='Views count')),
                ('categories', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app.Categories', verbose_name='Category')),
            ],
            options={
                'verbose_name': 'News',
                'verbose_name_plural': 'News',
                'ordering': ['-publish_at'],
                'get_latest_by': 'created_at',
            },
        ),
    ]
