# Generated by Django 3.2.16 on 2022-12-04 01:55

import django.db.models.deletion
import django_quill.fields
import filer.fields.image
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('cms', '0022_auto_20180620_1551'),
        migrations.swappable_dependency(settings.FILER_IMAGE_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Calendar',
            fields=[
                (
                    'id',
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID'
                    )
                ),
                ('slug', models.SlugField(unique=True, verbose_name='slug')),
                ('name', models.CharField(max_length=50, verbose_name='name')),
                (
                    'url',
                    models.URLField(
                        blank=True,
                        help_text=
                        'Calendar to be imported, leave empty if you edit events only here in the admin section.',
                        verbose_name='URL of ics file'
                    )
                ),
                (
                    'ics',
                    models.TextField(
                        blank=True, verbose_name='imported ics file'
                    )
                ),
                (
                    'colour',
                    models.CharField(
                        blank=True, max_length=20, verbose_name='colour'
                    )
                ),
                (
                    'publish',
                    models.BooleanField(default=True, verbose_name='publish')
                ),
            ],
            options={
                'verbose_name': 'calendar',
                'verbose_name_plural': 'calendars',
            },
        ),
        migrations.CreateModel(
            name='EventListPlugin',
            fields=[
                (
                    'cmsplugin_ptr',
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        related_name='djangocms_events_eventlistplugin',
                        serialize=False,
                        to='cms.cmsplugin'
                    )
                ),
                (
                    'number',
                    models.PositiveSmallIntegerField(
                        blank=True,
                        default=5,
                        help_text=
                        'Number of events to be displayed, unlimited if empty',
                        null=True,
                        verbose_name='number of events'
                    )
                ),
                (
                    'also_past_events',
                    models.BooleanField(
                        default=False,
                        help_text=
                        'If the number of future events is smaller than the chosen number, also show past events.',
                        verbose_name='also past events'
                    )
                ),
                (
                    'calendars',
                    models.ManyToManyField(
                        to='djangocms_events.Calendar',
                        verbose_name='calendars'
                    )
                ),
            ],
            options={
                'abstract': False,
            },
            bases=('cms.cmsplugin', ),
        ),
        migrations.CreateModel(
            name='CalendarPlugin',
            fields=[
                (
                    'cmsplugin_ptr',
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        related_name='djangocms_events_calendarplugin',
                        serialize=False,
                        to='cms.cmsplugin'
                    )
                ),
                (
                    'height',
                    models.PositiveSmallIntegerField(
                        default=800, verbose_name='height in px'
                    )
                ),
                (
                    'default_view',
                    models.CharField(
                        choices=[
                            ('month', 'month'), ('week', 'week'),
                            ('day', 'day')
                        ],
                        default='month',
                        max_length=5,
                        verbose_name='default view'
                    )
                ),
                (
                    'calendars',
                    models.ManyToManyField(
                        to='djangocms_events.Calendar',
                        verbose_name='calendars'
                    )
                ),
            ],
            options={
                'abstract': False,
            },
            bases=('cms.cmsplugin', ),
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                (
                    'id',
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID'
                    )
                ),
                (
                    'name',
                    models.CharField(
                        blank=True, max_length=255, verbose_name='name'
                    )
                ),
                (
                    'begin',
                    models.DateTimeField(
                        blank=True, null=True, verbose_name='begin'
                    )
                ),
                (
                    'end',
                    models.DateTimeField(
                        blank=True, null=True, verbose_name='end'
                    )
                ),
                (
                    'duration',
                    models.CharField(
                        blank=True,
                        max_length=64,
                        null=True,
                        verbose_name='duration'
                    )
                ),
                (
                    'uid',
                    models.CharField(
                        blank=True,
                        max_length=255,
                        null=True,
                        verbose_name='uid'
                    )
                ),
                (
                    'description',
                    django_quill.fields.QuillField(
                        blank=True, verbose_name='description'
                    )
                ),
                (
                    'created',
                    models.DateTimeField(
                        blank=True, null=True, verbose_name='created'
                    )
                ),
                (
                    'last_modified',
                    models.DateTimeField(
                        blank=True, null=True, verbose_name='last_modified'
                    )
                ),
                (
                    'location',
                    models.CharField(
                        blank=True,
                        max_length=255,
                        null=True,
                        verbose_name='location'
                    )
                ),
                (
                    'url',
                    models.URLField(blank=True, null=True, verbose_name='url')
                ),
                (
                    'transparent',
                    models.BooleanField(
                        blank=True, null=True, verbose_name='transparent'
                    )
                ),
                (
                    'status',
                    models.CharField(
                        blank=True,
                        max_length=64,
                        null=True,
                        verbose_name='status'
                    )
                ),
                (
                    'organizer',
                    models.CharField(
                        blank=True,
                        max_length=255,
                        null=True,
                        verbose_name='organizer'
                    )
                ),
                (
                    'classification',
                    models.CharField(
                        blank=True,
                        max_length=64,
                        null=True,
                        verbose_name='classification'
                    )
                ),
                (
                    'calendar',
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to='djangocms_events.calendar',
                        verbose_name='calendar'
                    )
                ),
                (
                    'picture',
                    filer.fields.image.FilerImageField(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name='event_picture',
                        to=settings.FILER_IMAGE_MODEL,
                        verbose_name='picture'
                    )
                ),
            ],
            options={
                'verbose_name': 'event',
                'verbose_name_plural': 'events',
                'ordering': ['-begin', '-end'],
                'unique_together': {('calendar', 'uid')},
            },
        ),
    ]
