text: # -*- coding: utf-8 -*-
  # Generated by Django 1.9.5 on 2016-04-22 14:21
  from __future__ import unicode_literals
  
  from django.conf import settings
  from django.db import migrations, models
  import django.db.models.deletion
  import modelcluster.fields
  import taggit.managers
  import wagtail.core.models
  import wagtail.search.index
  
  from wagtail.core import fields
  
  
  class Migration(migrations.Migration):
  
      initial = True
  
      dependencies = [
          ('wagtailmedia', '0001_initial'),
          ('wagtailcore', '0028_merge'),
      ]
  
      operations = [
          migrations.CreateModel(
              name='EventPage',
              fields=[
                  ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')),
                  ('date_from', models.DateField(null=True, verbose_name='Start date')),
                  ('date_to', models.DateField(blank=True, help_text='Not required if event is on a single day', null=True, verbose_name='End date')),
                  ('time_from', models.TimeField(blank=True, null=True, verbose_name='Start time')),
                  ('time_to', models.TimeField(blank=True, null=True, verbose_name='End time')),
                  ('location', models.CharField(max_length=255)),
                  ('body', fields.RichTextField(blank=True)),
                  ('cost', models.CharField(max_length=255)),
                  ('signup_link', models.URLField(blank=True)),
              ],
              options={
                  'abstract': False,
              },
              bases=('wagtailcore.page',),
          ),
          migrations.CreateModel(
              name='EventPageRelatedMedia',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('sort_order', models.IntegerField(blank=True, editable=False, null=True)),
                  ('title', models.CharField(help_text='Link title', max_length=255)),
                  ('link_media', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='wagtailmedia.Media')),
                  ('page', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='related_media', to='wagtailmedia_tests.EventPage')),
              ],
              options={
                  'ordering': ['sort_order'],
                  'abstract': False,
              },
          ),
          migrations.CreateModel(
              name='CustomMedia',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('title', models.CharField(max_length=255, verbose_name='title')),
                  ('file', models.FileField(upload_to='media', verbose_name='file')),
                  ('type', models.CharField(choices=[('audio', 'Audio file'), ('video', 'Video file')], max_length=255)),
                  ('duration', models.PositiveIntegerField(help_text='Duration in seconds', verbose_name='duration')),
                  ('width', models.PositiveIntegerField(blank=True, null=True, verbose_name='width')),
                  ('height', models.PositiveIntegerField(blank=True, null=True, verbose_name='height')),
                  ('thumbnail', models.FileField(blank=True, upload_to='media_thumbnails', verbose_name='thumbnail')),
                  ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                  ('collection', models.ForeignKey(default=wagtail.core.models.get_root_collection_id,
                                                   on_delete=django.db.models.deletion.CASCADE, related_name='+',
                                                   to='wagtailcore.Collection', verbose_name='collection')),
                  ('tags', taggit.managers.TaggableManager(blank=True, help_text=None, through='taggit.TaggedItem',
                                                           to='taggit.Tag', verbose_name='tags')),
                  ('uploaded_by_user',
                   models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL,
                                     to=settings.AUTH_USER_MODEL, verbose_name='uploaded by user')),
              ],
              options={
                  'verbose_name': 'media',
                  'abstract': False,
              },
              bases=(wagtail.search.index.Indexed, models.Model),
          ),
      ]
  