# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import ckeditor.fields
import django.db.models.deletion
import easy_thumbnails.fields
from django.conf import settings
from django.db import models, migrations

import events.models
import utils


class Migration(migrations.Migration):
    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('events', '0003_auto_20150823_2232'),
    ]

    operations = [
        migrations.CreateModel(
            name='Photo',
            fields=[
                ('id', models.AutoField(verbose_name='ID',
                                        serialize=False, auto_created=True,
                                        primary_key=True)),
                ('name', models.CharField(max_length=100,
                                          verbose_name='Name', blank=True)),
                ('image', easy_thumbnails.fields.ThumbnailerImageField(
                    upload_to=events.models.get_upload_path,
                    storage=utils.OverwriteStorage(), verbose_name='Bild')),
                ('description', models.TextField(max_length=300,
                                                 verbose_name='Beschreibung',
                                                 blank=True)),
                ('on_startpage', models.BooleanField(default=False,
                                                     help_text='Display this Photo on the Startpage Teaser',
                                                     verbose_name='Startpage')),
                ('created_date',
                 models.DateTimeField(verbose_name='Published on')),
                ('views', models.PositiveIntegerField(default=0,
                                                      verbose_name='Number of views',
                                                      editable=False)),
            ],
            options={
                'ordering': ['created_date'],
                'db_table': 'events_photo',
                'verbose_name': 'Veranstaltungsbild',
                'verbose_name_plural': 'Event Images',
                'get_latest_by': 'created_date',
            },
        ),
        migrations.AlterModelOptions(
            name='event',
            options={'ordering': (
                'start', 'end'), 'verbose_name': 'Termin',
                'verbose_name_plural': 'Termine'},
        ),
        migrations.AlterField(
            model_name='event',
            name='description',
            field=ckeditor.fields.RichTextField(
                verbose_name='Beschreibung', blank=True),
        ),
        migrations.AlterField(
            model_name='event',
            name='event_series',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.SET_NULL, blank=True,
                to='events.Event',
                help_text='Wenn dieser Termin zu einer Veranstaltungsreihe geh\xf6rt werden Ort, Beschreibung, Bild und Homepage von dem hier angegebenen Event \xfcbernommen.',
                null=True, verbose_name='Veranstaltungsreihen'),
        ),
        migrations.AlterField(
            model_name='event',
            name='image',
            field=easy_thumbnails.fields.ThumbnailerImageField(
                storage=utils.OverwriteStorage(
                ), upload_to=events.models.get_upload_path, null=True,
                verbose_name='Bild', blank=True),
        ),
        migrations.AlterField(
            model_name='location',
            name='description',
            field=ckeditor.fields.RichTextField(
                verbose_name='Beschreibung', blank=True),
        ),
        migrations.AlterField(
            model_name='location',
            name='image',
            field=easy_thumbnails.fields.ThumbnailerImageField(
                storage=utils.OverwriteStorage(
                ), upload_to=events.models.get_upload_path, null=True,
                verbose_name='Bild', blank=True),
        ),
        migrations.AddField(
            model_name='photo',
            name='event',
            field=models.ForeignKey(
                to='events.Event', on_delete=models.CASCADE),
        ),
        migrations.AddField(
            model_name='photo',
            name='photographer',
            field=models.ForeignKey(
                to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
        ),
    ]
