text: # -*- coding: utf-8 -*-
  # Generated by Django 1.10.4 on 2017-06-25 16:48
  from __future__ import unicode_literals
  
  import autoslug.fields
  import core.models
  from django.conf import settings
  from django.db import migrations, models
  import django.db.models.deletion
  import django.utils.timezone
  
  
  class Migration(migrations.Migration):
  
      initial = True
  
      dependencies = [
          ('source', '__first__'),
          migrations.swappable_dependency(settings.AUTH_USER_MODEL),
      ]
  
      operations = [
          migrations.CreateModel(
              name='Attachment',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('file', models.FileField(upload_to='attachments', verbose_name='file')),
              ],
          ),
          migrations.CreateModel(
              name='Harvest',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('active', models.BooleanField(default=True)),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('last_changed', models.DateTimeField(auto_now=True)),
                  ('target_frequency', models.IntegerField(blank=True, choices=[(0, 'Once only'), (1, 'Once a year'), (2, 'Twice a year'), (4, 'Quarterly'), (6, 'Every two months'), (52, 'Weekly'), (12, 'Every month'), (365, 'Daily')], null=True, verbose_name='Seeds by frequency')),
                  ('custom_seeds', models.TextField(blank=True, help_text='One URL per line', null=True, verbose_name='Custom seeds URL')),
                  ('status', models.IntegerField(choices=[(0, 'Planned'), (1, 'Running'), (2, 'Success'), (3, 'Success with failures'), (4, 'Cancelled'), (5, 'Failed')], default=0, verbose_name='State')),
                  ('title', models.CharField(blank=True, max_length=255, verbose_name='title')),
                  ('annotation', models.TextField(blank=True, null=True, verbose_name='Annotation')),
                  ('seeds_frozen', models.TextField(blank=True, null=True)),
                  ('auto_created', models.BooleanField(default=False)),
                  ('scheduled_on', core.models.DatePickerField(verbose_name='Date of harvest')),
                  ('custom_sources', models.ManyToManyField(blank=True, to='source.Source', verbose_name='Included sources')),
              ],
              options={
                  'abstract': False,
              },
          ),
          migrations.CreateModel(
              name='TopicCollection',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('active', models.BooleanField(default=True)),
                  ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                  ('last_changed', models.DateTimeField(auto_now=True)),
                  ('target_frequency', models.IntegerField(blank=True, choices=[(0, 'Once only'), (1, 'Once a year'), (2, 'Twice a year'), (4, 'Quarterly'), (6, 'Every two months'), (52, 'Weekly'), (12, 'Every month'), (365, 'Daily')], null=True, verbose_name='Seeds by frequency')),
                  ('custom_seeds', models.TextField(blank=True, help_text='One URL per line', null=True, verbose_name='Custom seeds URL')),
                  ('status', models.IntegerField(choices=[(2, 'Running'), (1, 'New'), (3, 'Finished')], default=1, verbose_name='State')),
                  ('title', models.CharField(max_length=255, verbose_name='title')),
                  ('title_cs', models.CharField(max_length=255, null=True, verbose_name='title')),
                  ('title_en', models.CharField(max_length=255, null=True, verbose_name='title')),
                  ('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='title_cs', unique=True)),
                  ('seeds_frozen', models.TextField(blank=True, null=True)),
                  ('auto_created', models.BooleanField(default=False)),
                  ('scheduled_on', core.models.DatePickerField(blank=True, null=True, verbose_name='Date of harvest')),
                  ('annotation', models.TextField(verbose_name='annotation')),
                  ('annotation_cs', models.TextField(null=True, verbose_name='annotation')),
                  ('annotation_en', models.TextField(null=True, verbose_name='annotation')),
                  ('image', models.ImageField(blank=True, null=True, upload_to='photos', verbose_name='image')),
                  ('all_open', models.BooleanField(verbose_name='All sources are under open license or contract')),
                  ('date_from', core.models.DatePickerField(null=True, verbose_name='Date from')),
                  ('date_to', core.models.DatePickerField(null=True, verbose_name='Date to')),
                  ('custom_sources', models.ManyToManyField(blank=True, to='source.Source', verbose_name='Included sources')),
                  ('keywords', models.ManyToManyField(to='source.KeyWord', verbose_name='keywords')),
                  ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='Curator')),
              ],
              options={
                  'ordering': ['id'],
                  'verbose_name_plural': 'Topic collections',
                  'verbose_name': 'Topic collection',
              },
          ),
          migrations.AddField(
              model_name='harvest',
              name='topic_collections',
              field=models.ManyToManyField(blank=True, to='harvests.TopicCollection', verbose_name='Topic collections'),
          ),
          migrations.AddField(
              model_name='attachment',
              name='topic_collection',
              field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='harvests.TopicCollection'),
          ),
      ]
  