# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-19 22:39
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import feincms.extensions
import utilities.content_types


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='CaptionedImageContent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(height_field=b'height', upload_to=b'ct/image', width_field=b'width')),
                ('width', models.PositiveIntegerField(blank=True, editable=False, null=True)),
                ('height', models.PositiveIntegerField(blank=True, editable=False, null=True)),
                ('caption', models.TextField(blank=True, null=True)),
                ('region', models.CharField(max_length=255)),
                ('ordering', models.IntegerField(default=0, verbose_name='ordering')),
            ],
            options={
                'ordering': ['ordering'],
                'abstract': False,
                'verbose_name_plural': 'captioned image contents',
                'db_table': 'news_newsitem_captionedimagecontent',
                'verbose_name': 'captioned image content',
                'permissions': [],
            },
            bases=(utilities.content_types.ModelRenderMixin, models.Model),
        ),
        migrations.CreateModel(
            name='ImageContent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(height_field=b'height', upload_to=b'ct/image', width_field=b'width')),
                ('width', models.PositiveIntegerField(blank=True, editable=False, null=True)),
                ('height', models.PositiveIntegerField(blank=True, editable=False, null=True)),
                ('region', models.CharField(max_length=255)),
                ('ordering', models.IntegerField(default=0, verbose_name='ordering')),
            ],
            options={
                'ordering': ['ordering'],
                'abstract': False,
                'verbose_name_plural': 'image contents',
                'db_table': 'news_newsitem_imagecontent',
                'verbose_name': 'image content',
                'permissions': [],
            },
            bases=(utilities.content_types.ModelRenderMixin, models.Model),
        ),
        migrations.CreateModel(
            name='MarkdownContent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('region', models.CharField(max_length=255)),
                ('ordering', models.IntegerField(default=0, verbose_name='ordering')),
            ],
            options={
                'ordering': ['ordering'],
                'abstract': False,
                'verbose_name_plural': 'markdown contents',
                'db_table': 'news_newsitem_markdowncontent',
                'verbose_name': 'markdown content',
                'permissions': [],
            },
            bases=(utilities.content_types.ModelRenderMixin, models.Model),
        ),
        migrations.CreateModel(
            name='NewsItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slug', models.SlugField(unique=True, validators=[django.core.validators.RegexValidator(b'^[-a-z0-9]+\\Z', "Enter a valid 'slug' consisting of lowercase letters, numbers or hyphens.", b'invalid')])),
                ('title', models.CharField(max_length=255)),
                ('teaser', models.TextField()),
                ('image', models.ImageField(height_field=b'height', upload_to=b'news/image', width_field=b'width')),
                ('width', models.PositiveIntegerField(blank=True, editable=False, null=True)),
                ('height', models.PositiveIntegerField(blank=True, editable=False, null=True)),
                ('published', models.BooleanField(default=False)),
                ('published_on', models.DateTimeField(blank=True, null=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ('-published_on',),
                'get_latest_by': 'published_on',
            },
            bases=(models.Model, feincms.extensions.ExtensionsMixin),
        ),
        migrations.AddField(
            model_name='markdowncontent',
            name='parent',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='markdowncontent_set', to='news.NewsItem'),
        ),
        migrations.AddField(
            model_name='imagecontent',
            name='parent',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='imagecontent_set', to='news.NewsItem'),
        ),
        migrations.AddField(
            model_name='captionedimagecontent',
            name='parent',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='captionedimagecontent_set', to='news.NewsItem'),
        ),
    ]
