# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-30 09:24
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import photologue.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('photologue', '0010_auto_20160105_1307'),
        ('sites', '0002_alter_domain_unique'),
        ('category', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to=photologue.models.get_storage_path, verbose_name='image')),
                ('date_taken', models.DateTimeField(blank=True, help_text='Date image was taken; is obtained from the image EXIF data.', null=True, verbose_name='date taken')),
                ('view_count', models.PositiveIntegerField(default=0, editable=False, verbose_name='view count')),
                ('crop_from', models.CharField(blank=True, choices=[(b'top', 'Top'), (b'right', 'Right'), (b'bottom', 'Bottom'), (b'left', 'Left'), (b'center', 'Center (Default)')], default=b'center', max_length=10, verbose_name='crop from')),
                ('title', models.CharField(db_index=True, help_text='A short descriptive title.', max_length=200, verbose_name='Title')),
                ('subtitle', models.CharField(blank=True, default=b'', help_text='Some titles may be the same and cause confusion in admin UI. A subtitle makes a distinction.', max_length=200, null=True)),
                ('attribution', models.CharField(blank=True, help_text='Attribution for the image, eg. Shutterstock.', max_length=256, null=True)),
                ('effect', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='image_related', to='photologue.PhotoEffect', verbose_name='effect')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ModelBase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(blank=True, null=True, upload_to=photologue.models.get_storage_path, verbose_name='image')),
                ('date_taken', models.DateTimeField(blank=True, help_text='Date image was taken; is obtained from the image EXIF data.', null=True, verbose_name='date taken')),
                ('view_count', models.PositiveIntegerField(default=0, editable=False, verbose_name='view count')),
                ('crop_from', models.CharField(blank=True, choices=[(b'top', 'Top'), (b'right', 'Right'), (b'bottom', 'Bottom'), (b'left', 'Left'), (b'center', 'Center (Default)')], default=b'center', max_length=10, verbose_name='crop from')),
                ('state', models.CharField(blank=True, choices=[(b'unpublished', b'Unpublished'), (b'published', b'Published')], db_index=True, default=b'unpublished', editable=False, max_length=32, null=True)),
                ('publish_on', models.DateTimeField(blank=True, db_index=True, help_text='Date and time on which to publish this item (the state will change to "published").', null=True)),
                ('retract_on', models.DateTimeField(blank=True, db_index=True, help_text='Date and time on which to retract this item (the state will change to "unpublished").', null=True)),
                ('slug', models.SlugField(max_length=255)),
                ('title', models.CharField(db_index=True, help_text='A short descriptive title.', max_length=200, verbose_name='Title')),
                ('subtitle', models.CharField(blank=True, default=b'', help_text='Some titles may be the same and cause confusion in admin UI. A subtitle makes a distinction.', max_length=200, null=True)),
                ('description', models.TextField(blank=True, help_text='A short description. More verbose than the title but limited to one or two sentences. It may not contain any markup.', null=True)),
                ('created', models.DateTimeField(blank=True, db_index=True, help_text='Date and time on which this item was created. This is automatically set on creation but can be changed subsequently.', verbose_name='Created Date & Time')),
                ('modified', models.DateTimeField(db_index=True, editable=False, help_text='Date and time on which this item was last modified. This is automatically set each time the item is saved.', verbose_name='Modified Date & Time')),
                ('owner_override', models.CharField(blank=True, help_text='If the author is not a registered user then set it here, eg. Reuters.', max_length=256, null=True)),
                ('class_name', models.CharField(editable=False, max_length=32, null=True)),
                ('comments_enabled', models.BooleanField(default=True, help_text='Enable commenting for this item. Comments will not display when disabled.', verbose_name='Commenting enabled')),
                ('anonymous_comments', models.BooleanField(default=True, help_text='Enable anonymous commenting for this item.', verbose_name='Anonymous Commenting Enabled')),
                ('comments_closed', models.BooleanField(default=False, help_text="Close commenting for this item. Comments will still display, but users won't be able to add new comments.", verbose_name='Commenting Closed')),
                ('likes_enabled', models.BooleanField(default=True, help_text='Enable liking for this item. Likes will not display when disabled.', verbose_name='Liking Enabled')),
                ('anonymous_likes', models.BooleanField(default=True, help_text='Enable anonymous liking for this item.', verbose_name='Anonymous Liking Enabled')),
                ('likes_closed', models.BooleanField(default=False, help_text="Close liking for this item. Likes will still display, but users won't be able to add new likes.", verbose_name='Liking Closed')),
                ('comment_count', models.PositiveIntegerField(default=0, editable=False)),
                ('vote_total', models.PositiveIntegerField(default=0, editable=False)),
                ('categories', models.ManyToManyField(blank=True, help_text='Categorize this item.', null=True, to='category.Category')),
                ('content_type', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('effect', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='modelbase_related', to='photologue.PhotoEffect', verbose_name='effect')),
            ],
            options={
                'ordering': ('-publish_on', '-created'),
            },
        ),
        migrations.CreateModel(
            name='ModelBaseImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('position', models.PositiveIntegerField(default=0)),
                ('image', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='image_link_to_modelbase', to='jmbo.Image')),
                ('modelbase', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='jmbo.ModelBase')),
            ],
        ),
        migrations.CreateModel(
            name='Relation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('source_object_id', models.PositiveIntegerField()),
                ('target_object_id', models.PositiveIntegerField()),
                ('name', models.CharField(db_index=True, help_text=b'A name used to identify the relation. It must follow the naming convention a-underscore-b, eg. blog_galleries. Once set it is typically never changed.', max_length=32)),
                ('source_content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='relation_source_content_type', to='contenttypes.ContentType')),
                ('target_content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='relation_target_content_type', to='contenttypes.ContentType')),
            ],
        ),
        migrations.AddField(
            model_name='modelbase',
            name='images',
            field=models.ManyToManyField(blank=True, null=True, through='jmbo.ModelBaseImage', to='jmbo.Image'),
        ),
        migrations.AddField(
            model_name='modelbase',
            name='owner',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='modelbase',
            name='primary_category',
            field=models.ForeignKey(blank=True, help_text="Primary category for this item. Used to determine the             object's absolute / default URL.", null=True, on_delete=django.db.models.deletion.CASCADE, related_name='primary_modelbase_set', to='category.Category'),
        ),
        migrations.AddField(
            model_name='modelbase',
            name='sites',
            field=models.ManyToManyField(blank=True, help_text='Makes item eligible to be published on selected sites.', null=True, to='sites.Site'),
        ),
        migrations.AddField(
            model_name='modelbase',
            name='tags',
            field=models.ManyToManyField(blank=True, help_text='Tag this item.', null=True, to='category.Tag'),
        ),
        migrations.AlterUniqueTogether(
            name='relation',
            unique_together=set([('source_content_type', 'source_object_id', 'target_content_type', 'target_object_id', 'name')]),
        ),
    ]
