# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-17 19:48
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        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')),
                ('title', models.CharField(help_text=b'Maximum 250 characters.', max_length=250)),
                ('excerpt', models.TextField(blank=True, help_text=b'A short summary of the article. Optional.')),
                ('body', models.TextField()),
                ('pub_date', models.DateTimeField(default=datetime.datetime.now)),
                ('image', filebrowser.fields.FileBrowseField(blank=True, help_text=b'Valid file formats: .jpg, .png, .gif', max_length=200, null=True, verbose_name=b'Image')),
                ('image_size', models.CharField(choices=[(b'thumbnail', b'Thumb'), (b'small', b'Small'), (b'medium', b'Medium'), (b'large', b'Large')], default=b'small', max_length=50)),
                ('image_location', models.CharField(choices=[(b'right', b'Right'), (b'left', b'Left'), (b'top', b'Top'), (b'bottom', b'Bottom')], default=b'right', max_length=50)),
                ('file', filebrowser.fields.FileBrowseField(blank=True, help_text=b'Valid file formats: .pdf, .doc, .xls, .txt, .rtf', max_length=200, null=True, verbose_name=b'Document')),
                ('enable_comments', models.BooleanField(default=False)),
                ('slug', models.SlugField(help_text=b'Suggested value automatically \n\t\t\t\t\t\t\t             generated from title. Must be unique.', unique_for_date=b'pub_date')),
                ('status', models.IntegerField(choices=[(1, b'Live'), (2, b'Draft'), (3, b'Hidden')], default=1, help_text=b'Only entries with live status \n\t\t\t\t\t\t\t\t            will be publicly displayed.')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-pub_date'],
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text=b'Maximum 250 characters.', max_length=250)),
                ('description', models.TextField()),
                ('slug', models.SlugField(help_text=b'Suggested value automatically generated from name. Must be unique.', unique=True)),
                ('parent', models.ForeignKey(blank=True, help_text=b'Specify parent category if this is a sub-category. Otherwise, leave empty', null=True, on_delete=django.db.models.deletion.CASCADE, to='cms.Category')),
            ],
            options={
                'ordering': ['name'],
                'verbose_name_plural': 'Categories',
            },
        ),
        migrations.CreateModel(
            name='CategoryItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.PositiveIntegerField()),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='item_category', to='cms.Category')),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
            ],
            options={
                'ordering': ['content_type'],
                'verbose_name': 'category relation',
            },
        ),
        migrations.CreateModel(
            name='Link',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text=b'Maximum 250 characters.', max_length=250)),
                ('description', models.TextField()),
                ('slug', models.SlugField(help_text=b'Suggested value automatically generated from title. Must be unique.', unique=True)),
                ('parent', models.ForeignKey(blank=True, help_text=b'Specify parent section if this is a sub-section. Otherwise, leave empty', null=True, on_delete=django.db.models.deletion.CASCADE, to='cms.Section')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='SectionArticleRelation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', fields.PositionField(blank=True)),
                ('featured', models.BooleanField()),
                ('main', models.BooleanField(verbose_name=b'main section?')),
                ('display', models.IntegerField(choices=[(1, b'Full'), (2, b'Excerpt'), (3, b'Link')], default=1, verbose_name=b'article display')),
                ('main_section', models.CharField(editable=False, max_length=250)),
                ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cms.Article')),
                ('section', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='article_section', to='cms.Section')),
            ],
            options={
                'ordering': ['order', 'main', 'article', 'section', 'display'],
            },
        ),
        migrations.CreateModel(
            name='SectionItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', fields.PositionField(blank=True)),
                ('object_id', models.PositiveIntegerField()),
                ('name', models.CharField(editable=False, max_length=250)),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('section', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='item_section', to='cms.Section')),
            ],
            options={
                'ordering': ['order', 'content_type', 'object_id'],
                'verbose_name': 'section relation',
            },
        ),
        migrations.AlterUniqueTogether(
            name='section',
            unique_together=set([('parent', 'name')]),
        ),
        migrations.AlterUniqueTogether(
            name='category',
            unique_together=set([('parent', 'name')]),
        ),
    ]
