# Generated by Django 2.0.7 on 2018-08-01 15:57

import re

import django.core.validators
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models

import grandchallenge.challenges.models


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("challenges", "0005_auto_20180612_1138"),
    ]

    operations = [
        migrations.CreateModel(
            name="ExternalChallenge",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "short_name",
                    models.SlugField(
                        default="",
                        help_text="short name used in url, specific css, files etc. No spaces allowed",
                        unique=True,
                        validators=[
                            grandchallenge.challenges.models.validate_nounderscores,
                            django.core.validators.RegexValidator(
                                re.compile("^[-a-zA-Z0-9_]+\\Z"),
                                "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.",
                                "invalid",
                            ),
                            django.core.validators.MinLengthValidator(1),
                        ],
                    ),
                ),
                (
                    "description",
                    models.CharField(
                        blank=True,
                        default="",
                        help_text="Short summary of this project, max 1024 characters.",
                        max_length=1024,
                    ),
                ),
                (
                    "title",
                    models.CharField(
                        blank=True,
                        default="",
                        help_text="The name of the challenge that is displayed on the All Challenges page. If this is blank the short name of the challenge will be used.",
                        max_length=64,
                    ),
                ),
                (
                    "logo",
                    models.ImageField(
                        blank=True,
                        upload_to=grandchallenge.challenges.models.get_logo_path,
                    ),
                ),
                (
                    "hidden",
                    models.BooleanField(
                        default=True,
                        help_text="Do not display this Project in any public overview",
                    ),
                ),
                (
                    "workshop_date",
                    models.DateField(
                        blank=True,
                        help_text="Date on which the workshop belonging to this project will be held",
                        null=True,
                    ),
                ),
                (
                    "event_name",
                    models.CharField(
                        blank=True,
                        default="",
                        help_text="The name of the event the workshop will be held at",
                        max_length=1024,
                        null=True,
                    ),
                ),
                (
                    "event_url",
                    models.URLField(
                        blank=True,
                        help_text="Website of the event which will host the workshop",
                        null=True,
                    ),
                ),
                (
                    "is_open_for_submissions",
                    models.BooleanField(
                        default=False,
                        help_text="This project currently accepts new submissions. Affects listing in projects overview",
                    ),
                ),
                (
                    "number_of_submissions",
                    models.IntegerField(
                        blank=True,
                        help_text="The number of submissions have been evalutated for this project",
                        null=True,
                    ),
                ),
                (
                    "last_submission_date",
                    models.DateField(
                        blank=True,
                        help_text="When was the last submission evaluated?",
                        null=True,
                    ),
                ),
                (
                    "offers_data_download",
                    models.BooleanField(
                        default=False,
                        help_text="This project currently accepts new submissions. Affects listing in projects overview",
                    ),
                ),
                (
                    "number_of_downloads",
                    models.IntegerField(
                        blank=True,
                        help_text="How often has the dataset for this project been downloaded?",
                        null=True,
                    ),
                ),
                (
                    "publication_url",
                    models.URLField(
                        blank=True,
                        help_text="URL of a publication describing this project",
                        null=True,
                    ),
                ),
                (
                    "publication_journal_name",
                    models.CharField(
                        blank=True,
                        help_text="If publication was in a journal, please list the journal name here We use <a target='new' href='https://www.ncbi.nlm.nih.gov/nlmcatalog/journals'>PubMed journal abbreviations</a> format",
                        max_length=225,
                        null=True,
                    ),
                ),
                (
                    "homepage",
                    models.URLField(
                        help_text="What is the homepage for this challenge?"
                    ),
                ),
                (
                    "submission_page",
                    models.URLField(
                        blank=True,
                        help_text="Where is the submissions page for this challenge?",
                    ),
                ),
                (
                    "download_page",
                    models.URLField(
                        blank=True,
                        help_text="Where is the download page for this challenge?",
                    ),
                ),
                (
                    "creator",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={"abstract": False},
        )
    ]
