# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-08-21 20:04
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import publications.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='CustomFile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.CharField(max_length=256)),
                ('file', models.FileField(upload_to='publications/')),
            ],
        ),
        migrations.CreateModel(
            name='CustomLink',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.CharField(max_length=256)),
                ('url', models.URLField(verbose_name='URL')),
            ],
        ),
        migrations.CreateModel(
            name='List',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('list', models.CharField(max_length=128)),
                ('description', models.CharField(max_length=128)),
            ],
            options={
                'verbose_name_plural': 'Lists',
                'ordering': ('list',),
            },
        ),
        migrations.CreateModel(
            name='Publication',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('citekey', models.CharField(blank=True, help_text='BibTex citation key. Leave blank if unsure.', max_length=512, null=True)),
                ('title', models.CharField(max_length=512)),
                ('authors', models.CharField(help_text='List of authors separated by commas or <i>and</i>.', max_length=2048)),
                ('year', models.PositiveIntegerField()),
                ('month', models.IntegerField(blank=True, choices=[(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], null=True)),
                ('journal', models.CharField(blank=True, max_length=256)),
                ('book_title', models.CharField(blank=True, max_length=256)),
                ('publisher', models.CharField(blank=True, max_length=256)),
                ('institution', models.CharField(blank=True, max_length=256)),
                ('volume', models.IntegerField(blank=True, null=True)),
                ('number', models.IntegerField(blank=True, null=True, verbose_name='Issue number')),
                ('pages', publications.fields.PagesField(blank=True, max_length=32)),
                ('note', models.CharField(blank=True, max_length=256)),
                ('keywords', models.CharField(blank=True, help_text='List of keywords separated by commas.', max_length=256)),
                ('url', models.URLField(blank=True, help_text='Link to PDF or journal page.', verbose_name='URL')),
                ('code', models.URLField(blank=True, help_text='Link to page with code.')),
                ('pdf', models.FileField(blank=True, null=True, upload_to='publications/', verbose_name='PDF')),
                ('image', models.ImageField(blank=True, null=True, upload_to='publications/images/')),
                ('thumbnail', models.ImageField(blank=True, null=True, upload_to='publications/thumbnails/')),
                ('doi', models.CharField(blank=True, max_length=128, verbose_name='DOI')),
                ('external', models.BooleanField(default=False, help_text='If publication was written in another lab, mark as external.')),
                ('abstract', models.TextField(blank=True)),
                ('isbn', models.CharField(blank=True, help_text='Only for a book.', max_length=32, verbose_name='ISBN')),
                ('lists', models.ManyToManyField(blank=True, to='publications.List')),
            ],
            options={
                'verbose_name_plural': ' Publications',
                'ordering': ['-year', '-month', '-id'],
            },
        ),
        migrations.CreateModel(
            name='Type',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', models.PositiveIntegerField(db_index=True, editable=False)),
                ('type', models.CharField(max_length=128)),
                ('description', models.CharField(max_length=128)),
                ('bibtex_types', models.CharField(default='article', help_text='Possible BibTex types, separated by comma.', max_length=256, verbose_name='BibTex types')),
                ('hidden', models.BooleanField(default=False, help_text='Hide publications from main view.')),
            ],
            options={
                'verbose_name_plural': '  Types',
                'ordering': ('order',),
            },
        ),
        migrations.AddField(
            model_name='publication',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='publications.Type'),
        ),
        migrations.AddField(
            model_name='customlink',
            name='publication',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='publications.Publication'),
        ),
        migrations.AddField(
            model_name='customfile',
            name='publication',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='publications.Publication'),
        ),
    ]
