# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-04-18 02:06
import django.core.validators
import django.utils.timezone
import jsonfield.fields
import mptt.fields
import sortedm2m.fields
from django.conf import settings
from django.db import migrations, models

import judge.models.interface
import judge.utils.problem_data


class Migration(migrations.Migration):

    replaces = [
        ("judge", "0001_initial"),
        ("judge", "0002_license"),
        ("judge", "0003_license_key"),
        ("judge", "0004_language_limit"),
        ("judge", "0005_nav_path_len"),
        ("judge", "0006_language_extension"),
        ("judge", "0007_test_site_perm"),
        ("judge", "0008_contestproblem_order"),
        ("judge", "0009_solution_problem"),
        ("judge", "0010_comment_page_index"),
        ("judge", "0011_organization_is_open"),
        ("judge", "0012_organization_perms"),
        ("judge", "0013_private_contests"),
        ("judge", "0014_multi_organization"),
        ("judge", "0015_remove_single_organization"),
        ("judge", "0016_organizationrequest"),
        ("judge", "0017_edit_public_problem_perm"),
        ("judge", "0018_django_1_9"),
        ("judge", "0019_og_images"),
        ("judge", "0020_profile_user_script"),
        ("judge", "0021_output_prefix_override"),
        ("judge", "0022_judge_last_ping"),
        ("judge", "0023_contest_tag"),
        ("judge", "0024_submission_judge"),
        ("judge", "0025_submission_rejudge_flag"),
        ("judge", "0026_change_public_visibility_perm"),
        ("judge", "0027_bridge_revert"),
        ("judge", "0028_judge_ip"),
        ("judge", "0029_problem_translation"),
        ("judge", "0030_remove_contest_profile"),
        ("judge", "0031_judge_versions"),
        ("judge", "0032_hide_problem_tags_in_contest"),
        ("judge", "0033_proper_pretest_support"),
        ("judge", "0034_submission_is_pretested"),
        ("judge", "0035_contest_spectate_mode"),
        ("judge", "0036_contest_participation_unique"),
        ("judge", "0037_user_count_ac_rate_field"),
        ("judge", "0038_profile_problem_count"),
        ("judge", "0039_remove_contest_is_external"),
        ("judge", "0040_profile_math_engine"),
        ("judge", "0041_virtual_contest_participation"),
        ("judge", "0042_remove_spectate_field"),
        ("judge", "0043_contest_user_count"),
        ("judge", "0044_organization_slots"),
        ("judge", "0045_organization_access_code"),
        ("judge", "0046_blogpost_authors"),
        ("judge", "0047_site_managed_data"),
        ("judge", "0048_site_managed_checkers"),
        ("judge", "0049_contest_summary"),
        ("judge", "0050_problem_tester_field"),
        ("judge", "0051_was_rejudged_field"),
        ("judge", "0052_switch_to_durationfield"),
        ("judge", "0053_opengraph_problems"),
        ("judge", "0054_tickets"),
        ("judge", "0055_add_performance_points"),
        ("judge", "0056_ticket_is_open"),
        ("judge", "0057_blue_pretests"),
        ("judge", "0058_problem_curator_field"),
        ("judge", "0059_problem_is_manually_managed"),
        ("judge", "0060_contest_clarifications"),
        ("judge", "0061_language_template"),
        ("judge", "0062_add_contest_submission_limit"),
        ("judge", "0063_new_solutions"),
        ("judge", "0064_unique_solution"),
        ("judge", "0065_blogpost_perms"),
        ("judge", "0066_submission_date_index"),
        ("judge", "0067_contest_access_code"),
        ("judge", "0068_hide_scoreboard"),
        ("judge", "0069_judge_blocking"),
        ("judge", "0070_organization_slug"),
        ("judge", "0071_organization_private_problems"),
        ("judge", "0072_contest_logo_override_image"),
        ("judge", "0073_comment_lock"),
        ("judge", "0074_totp"),
        ("judge", "0075_organization_admin_reverse"),
        ("judge", "0076_problem_statistics"),
        ("judge", "0077_remove_organization_key"),
        ("judge", "0078_add_user_notes"),
        ("judge", "0079_remove_comment_title"),
        ("judge", "0080_contest_banned_users"),
        ("judge", "0081_unlisted_users"),
        ("judge", "0082_remove_profile_name"),
        ("judge", "0083_extended_feedback"),
        ("judge", "0084_contest_formats"),
    ]

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("contenttypes", "0002_remove_content_type_name"),
    ]

    operations = [
        migrations.CreateModel(
            name="BlogPost",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("title", models.CharField(max_length=100, verbose_name="post title")),
                ("slug", models.SlugField(verbose_name="slug")),
                (
                    "visible",
                    models.BooleanField(
                        default=False, verbose_name="public visibility"
                    ),
                ),
                ("sticky", models.BooleanField(default=False, verbose_name="sticky")),
                ("publish_on", models.DateTimeField(verbose_name="publish after")),
                ("content", models.TextField(verbose_name="post content")),
                ("summary", models.TextField(blank=True, verbose_name="post summary")),
                (
                    "og_image",
                    models.CharField(
                        blank=True,
                        default="",
                        max_length=150,
                        verbose_name="openGraph image",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "blog posts",
                "permissions": (("edit_all_post", "Edit all posts"),),
                "verbose_name": "blog post",
            },
        ),
        migrations.CreateModel(
            name="Comment",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "time",
                    models.DateTimeField(auto_now_add=True, verbose_name="posted time"),
                ),
                (
                    "page",
                    models.CharField(
                        db_index=True,
                        max_length=30,
                        validators=[
                            django.core.validators.RegexValidator(
                                "^[pcs]:[a-z0-9]+$|^b:\\d+$",
                                "Page code must be ^[pcs]:[a-z0-9]+$|^b:\\d+$",
                            )
                        ],
                        verbose_name="associated page",
                    ),
                ),
                ("score", models.IntegerField(default=0, verbose_name="votes")),
                (
                    "body",
                    models.TextField(max_length=8192, verbose_name="body of comment"),
                ),
                (
                    "hidden",
                    models.BooleanField(default=0, verbose_name="hide the comment"),
                ),
                ("lft", models.PositiveIntegerField(db_index=True, editable=False)),
                ("rght", models.PositiveIntegerField(db_index=True, editable=False)),
                ("tree_id", models.PositiveIntegerField(db_index=True, editable=False)),
                ("level", models.PositiveIntegerField(db_index=True, editable=False)),
            ],
            options={
                "verbose_name_plural": "comments",
                "verbose_name": "comment",
            },
        ),
        migrations.CreateModel(
            name="CommentLock",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "page",
                    models.CharField(
                        db_index=True,
                        max_length=30,
                        validators=[
                            django.core.validators.RegexValidator(
                                "^[pcs]:[a-z0-9]+$|^b:\\d+$",
                                "Page code must be ^[pcs]:[a-z0-9]+$|^b:\\d+$",
                            )
                        ],
                        verbose_name="associated page",
                    ),
                ),
            ],
            options={
                "permissions": (("override_comment_lock", "Override comment lock"),),
            },
        ),
        migrations.CreateModel(
            name="CommentVote",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("score", models.IntegerField()),
                (
                    "comment",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="votes",
                        to="judge.Comment",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "comment votes",
                "verbose_name": "comment vote",
            },
        ),
        migrations.CreateModel(
            name="Contest",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "key",
                    models.CharField(
                        max_length=20,
                        unique=True,
                        validators=[
                            django.core.validators.RegexValidator(
                                "^[a-z0-9]+$", "Contest id must be ^[a-z0-9]+$"
                            )
                        ],
                        verbose_name="contest id",
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        db_index=True, max_length=100, verbose_name="contest name"
                    ),
                ),
                (
                    "description",
                    models.TextField(blank=True, verbose_name="description"),
                ),
                (
                    "start_time",
                    models.DateTimeField(db_index=True, verbose_name="start time"),
                ),
                (
                    "end_time",
                    models.DateTimeField(db_index=True, verbose_name="end time"),
                ),
                (
                    "time_limit",
                    models.DurationField(
                        blank=True, null=True, verbose_name="time limit"
                    ),
                ),
                (
                    "is_public",
                    models.BooleanField(
                        default=False,
                        help_text="Should be set even for organization-private contests, where it determines whether the contest is visible to members of the specified organizations.",
                        verbose_name="publicly visible",
                    ),
                ),
                (
                    "is_rated",
                    models.BooleanField(
                        default=False,
                        help_text="Whether this contest can be rated.",
                        verbose_name="contest rated",
                    ),
                ),
                (
                    "hide_scoreboard",
                    models.BooleanField(
                        default=False,
                        help_text="Whether the scoreboard should remain hidden for the duration of the contest.",
                        verbose_name="hide scoreboard",
                    ),
                ),
                (
                    "use_clarifications",
                    models.BooleanField(
                        default=True,
                        help_text="Use clarification system instead of comments.",
                        verbose_name="no comments",
                    ),
                ),
                (
                    "rate_all",
                    models.BooleanField(
                        default=False,
                        help_text="Rate all users who joined.",
                        verbose_name="rate all",
                    ),
                ),
                (
                    "is_private",
                    models.BooleanField(
                        default=False, verbose_name="private to organizations"
                    ),
                ),
                (
                    "hide_problem_tags",
                    models.BooleanField(
                        default=False,
                        help_text="Whether problem tags should be hidden by default.",
                        verbose_name="hide problem tags",
                    ),
                ),
                (
                    "run_pretests_only",
                    models.BooleanField(
                        default=False,
                        help_text="Whether judges should grade pretests only, versus all testcases. Commonly set during a contest, then unset prior to rejudging user submissions when the contest ends.",
                        verbose_name="run pretests only",
                    ),
                ),
                (
                    "og_image",
                    models.CharField(
                        blank=True,
                        default="",
                        max_length=150,
                        verbose_name="OpenGraph image",
                    ),
                ),
                (
                    "logo_override_image",
                    models.CharField(
                        blank=True,
                        default="",
                        help_text="This image will replace the default site logo for users inside the contest.",
                        max_length=150,
                        verbose_name="Logo override image",
                    ),
                ),
                (
                    "user_count",
                    models.IntegerField(
                        default=0, verbose_name="the amount of live participants"
                    ),
                ),
                (
                    "summary",
                    models.TextField(
                        blank=True,
                        help_text="Plain-text, shown in meta description tag, e.g. for social media.",
                        verbose_name="contest summary",
                    ),
                ),
                (
                    "access_code",
                    models.CharField(
                        blank=True,
                        default="",
                        help_text="An optional code to prompt contestants before they are allowed to join the contest. Leave it blank to disable.",
                        max_length=255,
                        verbose_name="access code",
                    ),
                ),
                (
                    "format_name",
                    models.CharField(
                        choices=[("default", "Default")],
                        default="default",
                        help_text="The contest format module to use.",
                        max_length=32,
                        verbose_name="contest format",
                    ),
                ),
                (
                    "format_config",
                    jsonfield.fields.JSONField(
                        blank=True,
                        help_text="A JSON object to serve as the configuration for the chosen contest format module. Leave empty to use None. Exact format depends on the contest format selected.",
                        null=True,
                        verbose_name="contest format configuration",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "contests",
                "permissions": (
                    ("see_private_contest", "See private contests"),
                    ("edit_own_contest", "Edit own contests"),
                    ("edit_all_contest", "Edit all contests"),
                    ("contest_rating", "Rate contests"),
                    ("contest_access_code", "Contest access codes"),
                ),
                "verbose_name": "contest",
            },
        ),
        migrations.CreateModel(
            name="ContestParticipation",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "real_start",
                    models.DateTimeField(
                        db_column="start",
                        default=django.utils.timezone.now,
                        verbose_name="start time",
                    ),
                ),
                (
                    "score",
                    models.IntegerField(db_index=True, default=0, verbose_name="score"),
                ),
                (
                    "cumtime",
                    models.PositiveIntegerField(
                        default=0, verbose_name="cumulative time"
                    ),
                ),
                (
                    "virtual",
                    models.IntegerField(
                        default=0,
                        help_text="0 means non-virtual, otherwise the n-th virtual participation",
                        verbose_name="virtual participation id",
                    ),
                ),
                (
                    "format_data",
                    jsonfield.fields.JSONField(
                        blank=True,
                        null=True,
                        verbose_name="contest format specific data",
                    ),
                ),
                (
                    "contest",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="users",
                        to="judge.Contest",
                        verbose_name="associated contest",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "contest participations",
                "verbose_name": "contest participation",
            },
        ),
        migrations.CreateModel(
            name="ContestProblem",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("points", models.IntegerField(verbose_name="points")),
                ("partial", models.BooleanField(default=True, verbose_name="partial")),
                (
                    "is_pretested",
                    models.BooleanField(default=False, verbose_name="is pretested"),
                ),
                (
                    "order",
                    models.PositiveIntegerField(db_index=True, verbose_name="order"),
                ),
                (
                    "output_prefix_override",
                    models.IntegerField(
                        blank=True,
                        null=True,
                        verbose_name="output prefix length override",
                    ),
                ),
                (
                    "max_submissions",
                    models.IntegerField(
                        default=0,
                        help_text="Maximum number of submissions for this problem, or 0 for no limit.",
                        validators=[
                            django.core.validators.MinValueValidator(
                                0, "Why include a problem you can't submit to?"
                            )
                        ],
                    ),
                ),
                (
                    "contest",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="contest_problems",
                        to="judge.Contest",
                        verbose_name="contest",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "contest problems",
                "verbose_name": "contest problem",
            },
        ),
        migrations.CreateModel(
            name="ContestSubmission",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("points", models.FloatField(default=0.0, verbose_name="points")),
                (
                    "is_pretest",
                    models.BooleanField(
                        default=False,
                        help_text="Whether this submission was ran only on pretests.",
                        verbose_name="is pretested",
                    ),
                ),
                (
                    "participation",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="submissions",
                        related_query_name="submission",
                        to="judge.ContestParticipation",
                        verbose_name="participation",
                    ),
                ),
                (
                    "problem",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="submissions",
                        related_query_name="submission",
                        to="judge.ContestProblem",
                        verbose_name="problem",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "contest submissions",
                "verbose_name": "contest submission",
            },
        ),
        migrations.CreateModel(
            name="ContestTag",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        max_length=20,
                        unique=True,
                        validators=[
                            django.core.validators.RegexValidator(
                                "^[a-z-]+$",
                                message="Lowercase letters and hyphens only.",
                            )
                        ],
                        verbose_name="tag name",
                    ),
                ),
                (
                    "color",
                    models.CharField(
                        max_length=7,
                        validators=[
                            django.core.validators.RegexValidator(
                                "^#(?:[A-Fa-f0-9]{3}){1,2}$", "Invalid colour."
                            )
                        ],
                        verbose_name="tag colour",
                    ),
                ),
                (
                    "description",
                    models.TextField(blank=True, verbose_name="tag description"),
                ),
            ],
            options={
                "verbose_name_plural": "contest tags",
                "verbose_name": "contest tag",
            },
        ),
        migrations.CreateModel(
            name="Judge",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        help_text="Server name, hostname-style",
                        max_length=50,
                        unique=True,
                    ),
                ),
                (
                    "created",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="time of creation"
                    ),
                ),
                (
                    "auth_key",
                    models.CharField(
                        help_text="A key to authenticated this judge",
                        max_length=100,
                        verbose_name="authentication key",
                    ),
                ),
                (
                    "is_blocked",
                    models.BooleanField(
                        default=False,
                        help_text="Whether this judge should be blocked from connecting, even if its key is correct.",
                        verbose_name="block judge",
                    ),
                ),
                (
                    "online",
                    models.BooleanField(
                        default=False, verbose_name="judge online status"
                    ),
                ),
                (
                    "start_time",
                    models.DateTimeField(null=True, verbose_name="judge start time"),
                ),
                ("ping", models.FloatField(null=True, verbose_name="response time")),
                (
                    "load",
                    models.FloatField(
                        help_text="Load for the last minute, divided by processors to be fair.",
                        null=True,
                        verbose_name="system load",
                    ),
                ),
                (
                    "description",
                    models.TextField(blank=True, verbose_name="description"),
                ),
                (
                    "last_ip",
                    models.GenericIPAddressField(
                        blank=True, null=True, verbose_name="Last connected IP"
                    ),
                ),
            ],
            options={
                "ordering": ["name"],
                "verbose_name_plural": "judges",
                "verbose_name": "judge",
            },
        ),
        migrations.CreateModel(
            name="Language",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "key",
                    models.CharField(
                        help_text="The identifier for this language; the same as its executor id for judges.",
                        max_length=6,
                        unique=True,
                        verbose_name="short identifier",
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        help_text='Longer name for the language, e.g. "Python 2" or "C++11".',
                        max_length=20,
                        verbose_name="long name",
                    ),
                ),
                (
                    "short_name",
                    models.CharField(
                        blank=True,
                        help_text='More readable, but short, name to display publicly; e.g. "PY2" or "C++11". If left blank, it will default to the short identifier.',
                        max_length=10,
                        null=True,
                        verbose_name="short name",
                    ),
                ),
                (
                    "common_name",
                    models.CharField(
                        help_text='Common name for the language. For example, the common name for C++03, C++11, and C++14 would be "C++"',
                        max_length=10,
                        verbose_name="common name",
                    ),
                ),
                (
                    "ace",
                    models.CharField(
                        help_text='Language ID for Ace.js editor highlighting, appended to "mode-" to determine the Ace JavaScript file to use, e.g., "python".',
                        max_length=20,
                        verbose_name="ace mode name",
                    ),
                ),
                (
                    "pygments",
                    models.CharField(
                        help_text="Language ID for Pygments highlighting in source windows.",
                        max_length=20,
                        verbose_name="pygments name",
                    ),
                ),
                (
                    "template",
                    models.TextField(
                        blank=True,
                        help_text="Code template to display in submission editor.",
                        verbose_name="code template",
                    ),
                ),
                (
                    "info",
                    models.CharField(
                        blank=True,
                        help_text="Do not set this unless you know what you're doing! It will override the usually more specific, judge-provided runtime info!",
                        max_length=50,
                        verbose_name="runtime info override",
                    ),
                ),
                (
                    "description",
                    models.TextField(
                        blank=True,
                        help_text="Use field this to inform users of quirks with your environment, additional restrictions, etc.",
                        verbose_name="language description",
                    ),
                ),
                (
                    "extension",
                    models.CharField(
                        help_text='The extension of source files, e.g., "py" or "cpp".',
                        max_length=10,
                        verbose_name="extension",
                    ),
                ),
            ],
            options={
                "ordering": ["key"],
                "verbose_name_plural": "languages",
                "verbose_name": "language",
            },
        ),
        migrations.CreateModel(
            name="LanguageLimit",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("time_limit", models.FloatField(verbose_name="time limit")),
                ("memory_limit", models.IntegerField(verbose_name="memory limit")),
                (
                    "language",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="judge.Language",
                        verbose_name="language",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "language-specific resource limits",
                "verbose_name": "language-specific resource limit",
            },
        ),
        migrations.CreateModel(
            name="License",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "key",
                    models.CharField(
                        max_length=20,
                        unique=True,
                        validators=[
                            django.core.validators.RegexValidator(
                                "^[-\\w.]+$", "License key must be ^[-\\w.]+$"
                            )
                        ],
                        verbose_name="key",
                    ),
                ),
                ("link", models.CharField(max_length=256, verbose_name="link")),
                ("name", models.CharField(max_length=256, verbose_name="full name")),
                (
                    "display",
                    models.CharField(
                        blank=True,
                        help_text="Displayed on pages under this license",
                        max_length=256,
                        verbose_name="short name",
                    ),
                ),
                (
                    "icon",
                    models.CharField(
                        blank=True,
                        help_text="URL to the icon",
                        max_length=256,
                        verbose_name="icon",
                    ),
                ),
                ("text", models.TextField(verbose_name="license text")),
            ],
            options={
                "verbose_name_plural": "licenses",
                "verbose_name": "license",
            },
        ),
        migrations.CreateModel(
            name="MiscConfig",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("key", models.CharField(db_index=True, max_length=30)),
                ("value", models.TextField(blank=True)),
            ],
            options={
                "verbose_name_plural": "miscellaneous configuration",
                "verbose_name": "configuration item",
            },
        ),
        migrations.CreateModel(
            name="NavigationBar",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "order",
                    models.PositiveIntegerField(db_index=True, verbose_name="order"),
                ),
                (
                    "key",
                    models.CharField(
                        max_length=10, unique=True, verbose_name="identifier"
                    ),
                ),
                ("label", models.CharField(max_length=20, verbose_name="label")),
                ("path", models.CharField(max_length=255, verbose_name="link path")),
                (
                    "regex",
                    models.TextField(
                        validators=[judge.models.interface.validate_regex],
                        verbose_name="highlight regex",
                    ),
                ),
                ("lft", models.PositiveIntegerField(db_index=True, editable=False)),
                ("rght", models.PositiveIntegerField(db_index=True, editable=False)),
                ("tree_id", models.PositiveIntegerField(db_index=True, editable=False)),
                ("level", models.PositiveIntegerField(db_index=True, editable=False)),
                (
                    "parent",
                    mptt.fields.TreeForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="children",
                        to="judge.NavigationBar",
                        verbose_name="parent item",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "navigation bar",
                "verbose_name": "navigation item",
            },
        ),
        migrations.CreateModel(
            name="Organization",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name",
                    models.CharField(max_length=128, verbose_name="organization title"),
                ),
                (
                    "slug",
                    models.SlugField(
                        help_text="Organization name shown in URL",
                        max_length=128,
                        verbose_name="organization slug",
                    ),
                ),
                (
                    "short_name",
                    models.CharField(
                        help_text="Displayed beside user name during contests",
                        max_length=20,
                        verbose_name="short name",
                    ),
                ),
                ("about", models.TextField(verbose_name="organization description")),
                (
                    "creation_date",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="creation date"
                    ),
                ),
                (
                    "is_open",
                    models.BooleanField(
                        default=True,
                        help_text="Allow joining organization",
                        verbose_name="is open organization?",
                    ),
                ),
                (
                    "slots",
                    models.IntegerField(
                        blank=True,
                        help_text="Maximum amount of users in this organization, only applicable to private organizations",
                        null=True,
                        verbose_name="maximum size",
                    ),
                ),
                (
                    "access_code",
                    models.CharField(
                        blank=True,
                        help_text="Student access code",
                        max_length=7,
                        null=True,
                        verbose_name="access code",
                    ),
                ),
            ],
            options={
                "ordering": ["name"],
                "verbose_name_plural": "organizations",
                "permissions": (
                    ("organization_admin", "Administer organizations"),
                    ("edit_all_organization", "Edit all organizations"),
                ),
                "verbose_name": "organization",
            },
        ),
        migrations.CreateModel(
            name="OrganizationRequest",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "time",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="request time"
                    ),
                ),
                (
                    "state",
                    models.CharField(
                        choices=[
                            ("P", "Pending"),
                            ("A", "Approved"),
                            ("R", "Rejected"),
                        ],
                        max_length=1,
                        verbose_name="state",
                    ),
                ),
                ("reason", models.TextField(verbose_name="reason")),
                (
                    "organization",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="requests",
                        to="judge.Organization",
                        verbose_name="organization",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "organization join requests",
                "verbose_name": "organization join request",
            },
        ),
        migrations.CreateModel(
            name="PrivateMessage",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "title",
                    models.CharField(max_length=50, verbose_name="message title"),
                ),
                ("content", models.TextField(verbose_name="message body")),
                (
                    "timestamp",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="message timestamp"
                    ),
                ),
                ("read", models.BooleanField(default=False, verbose_name="read")),
            ],
        ),
        migrations.CreateModel(
            name="PrivateMessageThread",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "messages",
                    models.ManyToManyField(
                        to="judge.PrivateMessage", verbose_name="messages in the thread"
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Problem",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "code",
                    models.CharField(
                        max_length=20,
                        unique=True,
                        validators=[
                            django.core.validators.RegexValidator(
                                "^[a-z0-9]+$", "Problem code must be ^[a-z0-9]+$"
                            )
                        ],
                        verbose_name="problem code",
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        db_index=True, max_length=100, verbose_name="problem name"
                    ),
                ),
                ("description", models.TextField(verbose_name="problem body")),
                (
                    "time_limit",
                    models.FloatField(
                        help_text="The time limit for this problem, in seconds. Fractional seconds (e.g. 1.5) are supported.",
                        verbose_name="time limit",
                    ),
                ),
                (
                    "memory_limit",
                    models.IntegerField(
                        help_text="The memory limit for this problem, in kilobytes (e.g. 64mb = 65536 kilobytes).",
                        verbose_name="memory limit",
                    ),
                ),
                ("short_circuit", models.BooleanField(default=False)),
                ("points", models.FloatField(verbose_name="points")),
                (
                    "partial",
                    models.BooleanField(
                        default=False, verbose_name="allows partial points"
                    ),
                ),
                (
                    "is_public",
                    models.BooleanField(
                        db_index=True, default=False, verbose_name="publicly visible"
                    ),
                ),
                (
                    "is_manually_managed",
                    models.BooleanField(
                        db_index=True,
                        default=False,
                        help_text="Whether judges should be allowed to manage data or not",
                        verbose_name="manually managed",
                    ),
                ),
                (
                    "date",
                    models.DateTimeField(
                        blank=True,
                        db_index=True,
                        help_text="Doesn't have magic ability to auto-publish due to backward compatibility",
                        null=True,
                        verbose_name="date of publishing",
                    ),
                ),
                (
                    "og_image",
                    models.CharField(
                        blank=True, max_length=150, verbose_name="OpenGraph image"
                    ),
                ),
                (
                    "summary",
                    models.TextField(
                        blank=True,
                        help_text="Plain-text, shown in meta description tag, e.g. for social media.",
                        verbose_name="problem summary",
                    ),
                ),
                (
                    "user_count",
                    models.IntegerField(
                        default=0,
                        help_text="The number of users who solved the problem.",
                        verbose_name="number of users",
                    ),
                ),
                ("ac_rate", models.FloatField(default=0, verbose_name="solve rate")),
                (
                    "is_organization_private",
                    models.BooleanField(
                        default=False, verbose_name="private to organizations"
                    ),
                ),
                (
                    "allowed_languages",
                    models.ManyToManyField(
                        to="judge.Language", verbose_name="allowed languages"
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "problems",
                "permissions": (
                    ("see_private_problem", "See hidden problems"),
                    ("edit_own_problem", "Edit own problems"),
                    ("edit_all_problem", "Edit all problems"),
                    ("edit_public_problem", "Edit all public problems"),
                    ("clone_problem", "Clone problem"),
                    ("change_public_visibility", "Change is_public field"),
                    ("change_manually_managed", "Change is_manually_managed field"),
                    ("see_organization_problem", "See organization-private problems"),
                ),
                "verbose_name": "problem",
            },
        ),
        migrations.CreateModel(
            name="ProblemClarification",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("description", models.TextField(verbose_name="clarification body")),
                (
                    "date",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="clarification timestamp"
                    ),
                ),
                (
                    "problem",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="judge.Problem",
                        verbose_name="clarified problem",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="ProblemData",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "zipfile",
                    models.FileField(
                        blank=True,
                        null=True,
                        storage=judge.utils.problem_data.ProblemDataStorage(),
                        upload_to=judge.models.problem_data.problem_directory_file,
                        verbose_name="data zip file",
                    ),
                ),
                (
                    "generator",
                    models.FileField(
                        blank=True,
                        null=True,
                        storage=judge.utils.problem_data.ProblemDataStorage(),
                        upload_to=judge.models.problem_data.problem_directory_file,
                        verbose_name="generator file",
                    ),
                ),
                (
                    "output_prefix",
                    models.IntegerField(
                        blank=True, null=True, verbose_name="output prefix length"
                    ),
                ),
                (
                    "output_limit",
                    models.IntegerField(
                        blank=True, null=True, verbose_name="output limit length"
                    ),
                ),
                (
                    "feedback",
                    models.TextField(
                        blank=True, verbose_name="init.yml generation feedback"
                    ),
                ),
                (
                    "checker",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("standard", "Standard"),
                            ("floats", "Floats"),
                            ("floatsabs", "Floats (absolute)"),
                            ("floatsrel", "Floats (relative)"),
                            ("rstripped", "Non-trailing spaces"),
                            ("sorted", "Unordered"),
                            ("identical", "Byte identical"),
                            ("linecount", "Line-by-line"),
                        ],
                        max_length=10,
                        verbose_name="checker",
                    ),
                ),
                (
                    "checker_args",
                    models.TextField(
                        blank=True,
                        help_text="checker arguments as a JSON object",
                        verbose_name="checker arguments",
                    ),
                ),
                (
                    "problem",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="data_files",
                        to="judge.Problem",
                        verbose_name="problem",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="ProblemGroup",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        max_length=20, unique=True, verbose_name="problem group ID"
                    ),
                ),
                (
                    "full_name",
                    models.CharField(max_length=100, verbose_name="problem group name"),
                ),
            ],
            options={
                "ordering": ["full_name"],
                "verbose_name_plural": "problem groups",
                "verbose_name": "problem group",
            },
        ),
        migrations.CreateModel(
            name="ProblemTestCase",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("order", models.IntegerField(verbose_name="case position")),
                (
                    "type",
                    models.CharField(
                        choices=[
                            ("C", "Normal case"),
                            ("S", "Batch start"),
                            ("E", "Batch end"),
                        ],
                        default="C",
                        max_length=1,
                        verbose_name="case type",
                    ),
                ),
                (
                    "input_file",
                    models.CharField(
                        blank=True, max_length=100, verbose_name="input file name"
                    ),
                ),
                (
                    "output_file",
                    models.CharField(
                        blank=True, max_length=100, verbose_name="output file name"
                    ),
                ),
                (
                    "generator_args",
                    models.TextField(blank=True, verbose_name="generator arguments"),
                ),
                (
                    "points",
                    models.IntegerField(
                        blank=True, null=True, verbose_name="point value"
                    ),
                ),
                ("is_pretest", models.BooleanField(verbose_name="case is pretest?")),
                (
                    "output_prefix",
                    models.IntegerField(
                        blank=True, null=True, verbose_name="output prefix length"
                    ),
                ),
                (
                    "output_limit",
                    models.IntegerField(
                        blank=True, null=True, verbose_name="output limit length"
                    ),
                ),
                (
                    "checker",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("standard", "Standard"),
                            ("floats", "Floats"),
                            ("floatsabs", "Floats (absolute)"),
                            ("floatsrel", "Floats (relative)"),
                            ("rstripped", "Non-trailing spaces"),
                            ("sorted", "Unordered"),
                            ("identical", "Byte identical"),
                            ("linecount", "Line-by-line"),
                        ],
                        max_length=10,
                        verbose_name="checker",
                    ),
                ),
                (
                    "checker_args",
                    models.TextField(
                        blank=True,
                        help_text="checker arguments as a JSON object",
                        verbose_name="checker arguments",
                    ),
                ),
                (
                    "dataset",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="cases",
                        to="judge.Problem",
                        verbose_name="problem data set",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="ProblemTranslation",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "language",
                    models.CharField(
                        choices=[
                            ("de", "German"),
                            ("en", "English"),
                            ("es", "Spanish"),
                            ("fr", "French"),
                            ("hr", "Croatian"),
                            ("hu", "Hungarian"),
                            ("ko", "Korean"),
                            ("ro", "Romanian"),
                            ("ru", "Russian"),
                            ("sr-latn", "Serbian (Latin)"),
                            ("tr", "Turkish"),
                            ("vi", "Vietnamese"),
                            ("zh-hans", "Simplified Chinese"),
                        ],
                        max_length=7,
                        verbose_name="language",
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        db_index=True, max_length=100, verbose_name="translated name"
                    ),
                ),
                (
                    "description",
                    models.TextField(verbose_name="translated description"),
                ),
                (
                    "problem",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="translations",
                        to="judge.Problem",
                        verbose_name="problem",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "problem translations",
                "verbose_name": "problem translation",
            },
        ),
        migrations.CreateModel(
            name="ProblemType",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        max_length=20, unique=True, verbose_name="problem category ID"
                    ),
                ),
                (
                    "full_name",
                    models.CharField(
                        max_length=100, verbose_name="problem category name"
                    ),
                ),
            ],
            options={
                "ordering": ["full_name"],
                "verbose_name_plural": "problem types",
                "verbose_name": "problem type",
            },
        ),
        migrations.CreateModel(
            name="Profile",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "about",
                    models.TextField(
                        blank=True, null=True, verbose_name="self-description"
                    ),
                ),
                (
                    "timezone",
                    models.CharField(
                        choices=[
                            (
                                "Africa",
                                [
                                    ("Africa/Abidjan", "Abidjan"),
                                    ("Africa/Accra", "Accra"),
                                    ("Africa/Addis_Ababa", "Addis_Ababa"),
                                    ("Africa/Algiers", "Algiers"),
                                    ("Africa/Asmara", "Asmara"),
                                    ("Africa/Asmera", "Asmera"),
                                    ("Africa/Bamako", "Bamako"),
                                    ("Africa/Bangui", "Bangui"),
                                    ("Africa/Banjul", "Banjul"),
                                    ("Africa/Bissau", "Bissau"),
                                    ("Africa/Blantyre", "Blantyre"),
                                    ("Africa/Brazzaville", "Brazzaville"),
                                    ("Africa/Bujumbura", "Bujumbura"),
                                    ("Africa/Cairo", "Cairo"),
                                    ("Africa/Casablanca", "Casablanca"),
                                    ("Africa/Ceuta", "Ceuta"),
                                    ("Africa/Conakry", "Conakry"),
                                    ("Africa/Dakar", "Dakar"),
                                    ("Africa/Dar_es_Salaam", "Dar_es_Salaam"),
                                    ("Africa/Djibouti", "Djibouti"),
                                    ("Africa/Douala", "Douala"),
                                    ("Africa/El_Aaiun", "El_Aaiun"),
                                    ("Africa/Freetown", "Freetown"),
                                    ("Africa/Gaborone", "Gaborone"),
                                    ("Africa/Harare", "Harare"),
                                    ("Africa/Johannesburg", "Johannesburg"),
                                    ("Africa/Juba", "Juba"),
                                    ("Africa/Kampala", "Kampala"),
                                    ("Africa/Khartoum", "Khartoum"),
                                    ("Africa/Kigali", "Kigali"),
                                    ("Africa/Kinshasa", "Kinshasa"),
                                    ("Africa/Lagos", "Lagos"),
                                    ("Africa/Libreville", "Libreville"),
                                    ("Africa/Lome", "Lome"),
                                    ("Africa/Luanda", "Luanda"),
                                    ("Africa/Lubumbashi", "Lubumbashi"),
                                    ("Africa/Lusaka", "Lusaka"),
                                    ("Africa/Malabo", "Malabo"),
                                    ("Africa/Maputo", "Maputo"),
                                    ("Africa/Maseru", "Maseru"),
                                    ("Africa/Mbabane", "Mbabane"),
                                    ("Africa/Mogadishu", "Mogadishu"),
                                    ("Africa/Monrovia", "Monrovia"),
                                    ("Africa/Nairobi", "Nairobi"),
                                    ("Africa/Ndjamena", "Ndjamena"),
                                    ("Africa/Niamey", "Niamey"),
                                    ("Africa/Nouakchott", "Nouakchott"),
                                    ("Africa/Ouagadougou", "Ouagadougou"),
                                    ("Africa/Porto-Novo", "Porto-Novo"),
                                    ("Africa/Sao_Tome", "Sao_Tome"),
                                    ("Africa/Timbuktu", "Timbuktu"),
                                    ("Africa/Tripoli", "Tripoli"),
                                    ("Africa/Tunis", "Tunis"),
                                    ("Africa/Windhoek", "Windhoek"),
                                ],
                            ),
                            (
                                "America",
                                [
                                    ("America/Adak", "Adak"),
                                    ("America/Anchorage", "Anchorage"),
                                    ("America/Anguilla", "Anguilla"),
                                    ("America/Antigua", "Antigua"),
                                    ("America/Araguaina", "Araguaina"),
                                    (
                                        "America/Argentina/Buenos_Aires",
                                        "Argentina/Buenos_Aires",
                                    ),
                                    (
                                        "America/Argentina/Catamarca",
                                        "Argentina/Catamarca",
                                    ),
                                    (
                                        "America/Argentina/ComodRivadavia",
                                        "Argentina/ComodRivadavia",
                                    ),
                                    ("America/Argentina/Cordoba", "Argentina/Cordoba"),
                                    ("America/Argentina/Jujuy", "Argentina/Jujuy"),
                                    (
                                        "America/Argentina/La_Rioja",
                                        "Argentina/La_Rioja",
                                    ),
                                    ("America/Argentina/Mendoza", "Argentina/Mendoza"),
                                    (
                                        "America/Argentina/Rio_Gallegos",
                                        "Argentina/Rio_Gallegos",
                                    ),
                                    ("America/Argentina/Salta", "Argentina/Salta"),
                                    (
                                        "America/Argentina/San_Juan",
                                        "Argentina/San_Juan",
                                    ),
                                    (
                                        "America/Argentina/San_Luis",
                                        "Argentina/San_Luis",
                                    ),
                                    ("America/Argentina/Tucuman", "Argentina/Tucuman"),
                                    ("America/Argentina/Ushuaia", "Argentina/Ushuaia"),
                                    ("America/Aruba", "Aruba"),
                                    ("America/Asuncion", "Asuncion"),
                                    ("America/Atikokan", "Atikokan"),
                                    ("America/Atka", "Atka"),
                                    ("America/Bahia", "Bahia"),
                                    ("America/Bahia_Banderas", "Bahia_Banderas"),
                                    ("America/Barbados", "Barbados"),
                                    ("America/Belem", "Belem"),
                                    ("America/Belize", "Belize"),
                                    ("America/Blanc-Sablon", "Blanc-Sablon"),
                                    ("America/Boa_Vista", "Boa_Vista"),
                                    ("America/Bogota", "Bogota"),
                                    ("America/Boise", "Boise"),
                                    ("America/Buenos_Aires", "Buenos_Aires"),
                                    ("America/Cambridge_Bay", "Cambridge_Bay"),
                                    ("America/Campo_Grande", "Campo_Grande"),
                                    ("America/Cancun", "Cancun"),
                                    ("America/Caracas", "Caracas"),
                                    ("America/Catamarca", "Catamarca"),
                                    ("America/Cayenne", "Cayenne"),
                                    ("America/Cayman", "Cayman"),
                                    ("America/Chicago", "Chicago"),
                                    ("America/Chihuahua", "Chihuahua"),
                                    ("America/Coral_Harbour", "Coral_Harbour"),
                                    ("America/Cordoba", "Cordoba"),
                                    ("America/Costa_Rica", "Costa_Rica"),
                                    ("America/Creston", "Creston"),
                                    ("America/Cuiaba", "Cuiaba"),
                                    ("America/Curacao", "Curacao"),
                                    ("America/Danmarkshavn", "Danmarkshavn"),
                                    ("America/Dawson", "Dawson"),
                                    ("America/Dawson_Creek", "Dawson_Creek"),
                                    ("America/Denver", "Denver"),
                                    ("America/Detroit", "Detroit"),
                                    ("America/Dominica", "Dominica"),
                                    ("America/Edmonton", "Edmonton"),
                                    ("America/Eirunepe", "Eirunepe"),
                                    ("America/El_Salvador", "El_Salvador"),
                                    ("America/Ensenada", "Ensenada"),
                                    ("America/Fort_Nelson", "Fort_Nelson"),
                                    ("America/Fort_Wayne", "Fort_Wayne"),
                                    ("America/Fortaleza", "Fortaleza"),
                                    ("America/Glace_Bay", "Glace_Bay"),
                                    ("America/Godthab", "Godthab"),
                                    ("America/Goose_Bay", "Goose_Bay"),
                                    ("America/Grand_Turk", "Grand_Turk"),
                                    ("America/Grenada", "Grenada"),
                                    ("America/Guadeloupe", "Guadeloupe"),
                                    ("America/Guatemala", "Guatemala"),
                                    ("America/Guayaquil", "Guayaquil"),
                                    ("America/Guyana", "Guyana"),
                                    ("America/Halifax", "Halifax"),
                                    ("America/Havana", "Havana"),
                                    ("America/Hermosillo", "Hermosillo"),
                                    (
                                        "America/Indiana/Indianapolis",
                                        "Indiana/Indianapolis",
                                    ),
                                    ("America/Indiana/Knox", "Indiana/Knox"),
                                    ("America/Indiana/Marengo", "Indiana/Marengo"),
                                    (
                                        "America/Indiana/Petersburg",
                                        "Indiana/Petersburg",
                                    ),
                                    ("America/Indiana/Tell_City", "Indiana/Tell_City"),
                                    ("America/Indiana/Vevay", "Indiana/Vevay"),
                                    ("America/Indiana/Vincennes", "Indiana/Vincennes"),
                                    ("America/Indiana/Winamac", "Indiana/Winamac"),
                                    ("America/Indianapolis", "Indianapolis"),
                                    ("America/Inuvik", "Inuvik"),
                                    ("America/Iqaluit", "Iqaluit"),
                                    ("America/Jamaica", "Jamaica"),
                                    ("America/Jujuy", "Jujuy"),
                                    ("America/Juneau", "Juneau"),
                                    (
                                        "America/Kentucky/Louisville",
                                        "Kentucky/Louisville",
                                    ),
                                    (
                                        "America/Kentucky/Monticello",
                                        "Kentucky/Monticello",
                                    ),
                                    ("America/Knox_IN", "Knox_IN"),
                                    ("America/Kralendijk", "Kralendijk"),
                                    ("America/La_Paz", "La_Paz"),
                                    ("America/Lima", "Lima"),
                                    ("America/Los_Angeles", "Los_Angeles"),
                                    ("America/Louisville", "Louisville"),
                                    ("America/Lower_Princes", "Lower_Princes"),
                                    ("America/Maceio", "Maceio"),
                                    ("America/Managua", "Managua"),
                                    ("America/Manaus", "Manaus"),
                                    ("America/Marigot", "Marigot"),
                                    ("America/Martinique", "Martinique"),
                                    ("America/Matamoros", "Matamoros"),
                                    ("America/Mazatlan", "Mazatlan"),
                                    ("America/Mendoza", "Mendoza"),
                                    ("America/Menominee", "Menominee"),
                                    ("America/Merida", "Merida"),
                                    ("America/Metlakatla", "Metlakatla"),
                                    ("America/Mexico_City", "Mexico_City"),
                                    ("America/Miquelon", "Miquelon"),
                                    ("America/Moncton", "Moncton"),
                                    ("America/Monterrey", "Monterrey"),
                                    ("America/Montevideo", "Montevideo"),
                                    ("America/Montreal", "Montreal"),
                                    ("America/Montserrat", "Montserrat"),
                                    ("America/Nassau", "Nassau"),
                                    ("America/New_York", "New_York"),
                                    ("America/Nipigon", "Nipigon"),
                                    ("America/Nome", "Nome"),
                                    ("America/Noronha", "Noronha"),
                                    (
                                        "America/North_Dakota/Beulah",
                                        "North_Dakota/Beulah",
                                    ),
                                    (
                                        "America/North_Dakota/Center",
                                        "North_Dakota/Center",
                                    ),
                                    (
                                        "America/North_Dakota/New_Salem",
                                        "North_Dakota/New_Salem",
                                    ),
                                    ("America/Ojinaga", "Ojinaga"),
                                    ("America/Panama", "Panama"),
                                    ("America/Pangnirtung", "Pangnirtung"),
                                    ("America/Paramaribo", "Paramaribo"),
                                    ("America/Phoenix", "Phoenix"),
                                    ("America/Port-au-Prince", "Port-au-Prince"),
                                    ("America/Port_of_Spain", "Port_of_Spain"),
                                    ("America/Porto_Acre", "Porto_Acre"),
                                    ("America/Porto_Velho", "Porto_Velho"),
                                    ("America/Puerto_Rico", "Puerto_Rico"),
                                    ("America/Punta_Arenas", "Punta_Arenas"),
                                    ("America/Rainy_River", "Rainy_River"),
                                    ("America/Rankin_Inlet", "Rankin_Inlet"),
                                    ("America/Recife", "Recife"),
                                    ("America/Regina", "Regina"),
                                    ("America/Resolute", "Resolute"),
                                    ("America/Rio_Branco", "Rio_Branco"),
                                    ("America/Rosario", "Rosario"),
                                    ("America/Santa_Isabel", "Santa_Isabel"),
                                    ("America/Santarem", "Santarem"),
                                    ("America/Santiago", "Santiago"),
                                    ("America/Santo_Domingo", "Santo_Domingo"),
                                    ("America/Sao_Paulo", "Sao_Paulo"),
                                    ("America/Scoresbysund", "Scoresbysund"),
                                    ("America/Shiprock", "Shiprock"),
                                    ("America/Sitka", "Sitka"),
                                    ("America/St_Barthelemy", "St_Barthelemy"),
                                    ("America/St_Johns", "St_Johns"),
                                    ("America/St_Kitts", "St_Kitts"),
                                    ("America/St_Lucia", "St_Lucia"),
                                    ("America/St_Thomas", "St_Thomas"),
                                    ("America/St_Vincent", "St_Vincent"),
                                    ("America/Swift_Current", "Swift_Current"),
                                    ("America/Tegucigalpa", "Tegucigalpa"),
                                    ("America/Thule", "Thule"),
                                    ("America/Thunder_Bay", "Thunder_Bay"),
                                    ("America/Tijuana", "Tijuana"),
                                    ("America/Toronto", "Toronto"),
                                    ("America/Tortola", "Tortola"),
                                    ("America/Vancouver", "Vancouver"),
                                    ("America/Virgin", "Virgin"),
                                    ("America/Whitehorse", "Whitehorse"),
                                    ("America/Winnipeg", "Winnipeg"),
                                    ("America/Yakutat", "Yakutat"),
                                    ("America/Yellowknife", "Yellowknife"),
                                ],
                            ),
                            (
                                "Antarctica",
                                [
                                    ("Antarctica/Casey", "Casey"),
                                    ("Antarctica/Davis", "Davis"),
                                    ("Antarctica/DumontDUrville", "DumontDUrville"),
                                    ("Antarctica/Macquarie", "Macquarie"),
                                    ("Antarctica/Mawson", "Mawson"),
                                    ("Antarctica/McMurdo", "McMurdo"),
                                    ("Antarctica/Palmer", "Palmer"),
                                    ("Antarctica/Rothera", "Rothera"),
                                    ("Antarctica/South_Pole", "South_Pole"),
                                    ("Antarctica/Syowa", "Syowa"),
                                    ("Antarctica/Troll", "Troll"),
                                    ("Antarctica/Vostok", "Vostok"),
                                ],
                            ),
                            ("Arctic", [("Arctic/Longyearbyen", "Longyearbyen")]),
                            (
                                "Asia",
                                [
                                    ("Asia/Aden", "Aden"),
                                    ("Asia/Almaty", "Almaty"),
                                    ("Asia/Amman", "Amman"),
                                    ("Asia/Anadyr", "Anadyr"),
                                    ("Asia/Aqtau", "Aqtau"),
                                    ("Asia/Aqtobe", "Aqtobe"),
                                    ("Asia/Ashgabat", "Ashgabat"),
                                    ("Asia/Ashkhabad", "Ashkhabad"),
                                    ("Asia/Atyrau", "Atyrau"),
                                    ("Asia/Baghdad", "Baghdad"),
                                    ("Asia/Bahrain", "Bahrain"),
                                    ("Asia/Baku", "Baku"),
                                    ("Asia/Bangkok", "Bangkok"),
                                    ("Asia/Barnaul", "Barnaul"),
                                    ("Asia/Beirut", "Beirut"),
                                    ("Asia/Bishkek", "Bishkek"),
                                    ("Asia/Brunei", "Brunei"),
                                    ("Asia/Calcutta", "Calcutta"),
                                    ("Asia/Chita", "Chita"),
                                    ("Asia/Choibalsan", "Choibalsan"),
                                    ("Asia/Chongqing", "Chongqing"),
                                    ("Asia/Chungking", "Chungking"),
                                    ("Asia/Colombo", "Colombo"),
                                    ("Asia/Dacca", "Dacca"),
                                    ("Asia/Damascus", "Damascus"),
                                    ("Asia/Dhaka", "Dhaka"),
                                    ("Asia/Dili", "Dili"),
                                    ("Asia/Dubai", "Dubai"),
                                    ("Asia/Dushanbe", "Dushanbe"),
                                    ("Asia/Famagusta", "Famagusta"),
                                    ("Asia/Gaza", "Gaza"),
                                    ("Asia/Harbin", "Harbin"),
                                    ("Asia/Hebron", "Hebron"),
                                    ("Asia/Ho_Chi_Minh", "Ho_Chi_Minh"),
                                    ("Asia/Hong_Kong", "Hong_Kong"),
                                    ("Asia/Hovd", "Hovd"),
                                    ("Asia/Irkutsk", "Irkutsk"),
                                    ("Asia/Istanbul", "Istanbul"),
                                    ("Asia/Jakarta", "Jakarta"),
                                    ("Asia/Jayapura", "Jayapura"),
                                    ("Asia/Jerusalem", "Jerusalem"),
                                    ("Asia/Kabul", "Kabul"),
                                    ("Asia/Kamchatka", "Kamchatka"),
                                    ("Asia/Karachi", "Karachi"),
                                    ("Asia/Kashgar", "Kashgar"),
                                    ("Asia/Kathmandu", "Kathmandu"),
                                    ("Asia/Katmandu", "Katmandu"),
                                    ("Asia/Khandyga", "Khandyga"),
                                    ("Asia/Kolkata", "Kolkata"),
                                    ("Asia/Krasnoyarsk", "Krasnoyarsk"),
                                    ("Asia/Kuala_Lumpur", "Kuala_Lumpur"),
                                    ("Asia/Kuching", "Kuching"),
                                    ("Asia/Kuwait", "Kuwait"),
                                    ("Asia/Macao", "Macao"),
                                    ("Asia/Macau", "Macau"),
                                    ("Asia/Magadan", "Magadan"),
                                    ("Asia/Makassar", "Makassar"),
                                    ("Asia/Manila", "Manila"),
                                    ("Asia/Muscat", "Muscat"),
                                    ("Asia/Nicosia", "Nicosia"),
                                    ("Asia/Novokuznetsk", "Novokuznetsk"),
                                    ("Asia/Novosibirsk", "Novosibirsk"),
                                    ("Asia/Omsk", "Omsk"),
                                    ("Asia/Oral", "Oral"),
                                    ("Asia/Phnom_Penh", "Phnom_Penh"),
                                    ("Asia/Pontianak", "Pontianak"),
                                    ("Asia/Pyongyang", "Pyongyang"),
                                    ("Asia/Qatar", "Qatar"),
                                    ("Asia/Qostanay", "Qostanay"),
                                    ("Asia/Qyzylorda", "Qyzylorda"),
                                    ("Asia/Rangoon", "Rangoon"),
                                    ("Asia/Riyadh", "Riyadh"),
                                    ("Asia/Saigon", "Saigon"),
                                    ("Asia/Sakhalin", "Sakhalin"),
                                    ("Asia/Samarkand", "Samarkand"),
                                    ("Asia/Seoul", "Seoul"),
                                    ("Asia/Shanghai", "Shanghai"),
                                    ("Asia/Singapore", "Singapore"),
                                    ("Asia/Srednekolymsk", "Srednekolymsk"),
                                    ("Asia/Taipei", "Taipei"),
                                    ("Asia/Tashkent", "Tashkent"),
                                    ("Asia/Tbilisi", "Tbilisi"),
                                    ("Asia/Tehran", "Tehran"),
                                    ("Asia/Tel_Aviv", "Tel_Aviv"),
                                    ("Asia/Thimbu", "Thimbu"),
                                    ("Asia/Thimphu", "Thimphu"),
                                    ("Asia/Tokyo", "Tokyo"),
                                    ("Asia/Tomsk", "Tomsk"),
                                    ("Asia/Ujung_Pandang", "Ujung_Pandang"),
                                    ("Asia/Ulaanbaatar", "Ulaanbaatar"),
                                    ("Asia/Ulan_Bator", "Ulan_Bator"),
                                    ("Asia/Urumqi", "Urumqi"),
                                    ("Asia/Ust-Nera", "Ust-Nera"),
                                    ("Asia/Vientiane", "Vientiane"),
                                    ("Asia/Vladivostok", "Vladivostok"),
                                    ("Asia/Yakutsk", "Yakutsk"),
                                    ("Asia/Yangon", "Yangon"),
                                    ("Asia/Yekaterinburg", "Yekaterinburg"),
                                    ("Asia/Yerevan", "Yerevan"),
                                ],
                            ),
                            (
                                "Atlantic",
                                [
                                    ("Atlantic/Azores", "Azores"),
                                    ("Atlantic/Bermuda", "Bermuda"),
                                    ("Atlantic/Canary", "Canary"),
                                    ("Atlantic/Cape_Verde", "Cape_Verde"),
                                    ("Atlantic/Faeroe", "Faeroe"),
                                    ("Atlantic/Faroe", "Faroe"),
                                    ("Atlantic/Jan_Mayen", "Jan_Mayen"),
                                    ("Atlantic/Madeira", "Madeira"),
                                    ("Atlantic/Reykjavik", "Reykjavik"),
                                    ("Atlantic/South_Georgia", "South_Georgia"),
                                    ("Atlantic/St_Helena", "St_Helena"),
                                    ("Atlantic/Stanley", "Stanley"),
                                ],
                            ),
                            (
                                "Australia",
                                [
                                    ("Australia/ACT", "ACT"),
                                    ("Australia/Adelaide", "Adelaide"),
                                    ("Australia/Brisbane", "Brisbane"),
                                    ("Australia/Broken_Hill", "Broken_Hill"),
                                    ("Australia/Canberra", "Canberra"),
                                    ("Australia/Currie", "Currie"),
                                    ("Australia/Darwin", "Darwin"),
                                    ("Australia/Eucla", "Eucla"),
                                    ("Australia/Hobart", "Hobart"),
                                    ("Australia/LHI", "LHI"),
                                    ("Australia/Lindeman", "Lindeman"),
                                    ("Australia/Lord_Howe", "Lord_Howe"),
                                    ("Australia/Melbourne", "Melbourne"),
                                    ("Australia/NSW", "NSW"),
                                    ("Australia/North", "North"),
                                    ("Australia/Perth", "Perth"),
                                    ("Australia/Queensland", "Queensland"),
                                    ("Australia/South", "South"),
                                    ("Australia/Sydney", "Sydney"),
                                    ("Australia/Tasmania", "Tasmania"),
                                    ("Australia/Victoria", "Victoria"),
                                    ("Australia/West", "West"),
                                    ("Australia/Yancowinna", "Yancowinna"),
                                ],
                            ),
                            (
                                "Brazil",
                                [
                                    ("Brazil/Acre", "Acre"),
                                    ("Brazil/DeNoronha", "DeNoronha"),
                                    ("Brazil/East", "East"),
                                    ("Brazil/West", "West"),
                                ],
                            ),
                            (
                                "Canada",
                                [
                                    ("Canada/Atlantic", "Atlantic"),
                                    ("Canada/Central", "Central"),
                                    ("Canada/Eastern", "Eastern"),
                                    ("Canada/Mountain", "Mountain"),
                                    ("Canada/Newfoundland", "Newfoundland"),
                                    ("Canada/Pacific", "Pacific"),
                                    ("Canada/Saskatchewan", "Saskatchewan"),
                                    ("Canada/Yukon", "Yukon"),
                                ],
                            ),
                            (
                                "Chile",
                                [
                                    ("Chile/Continental", "Continental"),
                                    ("Chile/EasterIsland", "EasterIsland"),
                                ],
                            ),
                            (
                                "Etc",
                                [
                                    ("Etc/Greenwich", "Greenwich"),
                                    ("Etc/UCT", "UCT"),
                                    ("Etc/UTC", "UTC"),
                                    ("Etc/Universal", "Universal"),
                                    ("Etc/Zulu", "Zulu"),
                                ],
                            ),
                            (
                                "Europe",
                                [
                                    ("Europe/Amsterdam", "Amsterdam"),
                                    ("Europe/Andorra", "Andorra"),
                                    ("Europe/Astrakhan", "Astrakhan"),
                                    ("Europe/Athens", "Athens"),
                                    ("Europe/Belfast", "Belfast"),
                                    ("Europe/Belgrade", "Belgrade"),
                                    ("Europe/Berlin", "Berlin"),
                                    ("Europe/Bratislava", "Bratislava"),
                                    ("Europe/Brussels", "Brussels"),
                                    ("Europe/Bucharest", "Bucharest"),
                                    ("Europe/Budapest", "Budapest"),
                                    ("Europe/Busingen", "Busingen"),
                                    ("Europe/Chisinau", "Chisinau"),
                                    ("Europe/Copenhagen", "Copenhagen"),
                                    ("Europe/Dublin", "Dublin"),
                                    ("Europe/Gibraltar", "Gibraltar"),
                                    ("Europe/Guernsey", "Guernsey"),
                                    ("Europe/Helsinki", "Helsinki"),
                                    ("Europe/Isle_of_Man", "Isle_of_Man"),
                                    ("Europe/Istanbul", "Istanbul"),
                                    ("Europe/Jersey", "Jersey"),
                                    ("Europe/Kaliningrad", "Kaliningrad"),
                                    ("Europe/Kiev", "Kiev"),
                                    ("Europe/Kirov", "Kirov"),
                                    ("Europe/Lisbon", "Lisbon"),
                                    ("Europe/Ljubljana", "Ljubljana"),
                                    ("Europe/London", "London"),
                                    ("Europe/Luxembourg", "Luxembourg"),
                                    ("Europe/Madrid", "Madrid"),
                                    ("Europe/Malta", "Malta"),
                                    ("Europe/Mariehamn", "Mariehamn"),
                                    ("Europe/Minsk", "Minsk"),
                                    ("Europe/Monaco", "Monaco"),
                                    ("Europe/Moscow", "Moscow"),
                                    ("Europe/Nicosia", "Nicosia"),
                                    ("Europe/Oslo", "Oslo"),
                                    ("Europe/Paris", "Paris"),
                                    ("Europe/Podgorica", "Podgorica"),
                                    ("Europe/Prague", "Prague"),
                                    ("Europe/Riga", "Riga"),
                                    ("Europe/Rome", "Rome"),
                                    ("Europe/Samara", "Samara"),
                                    ("Europe/San_Marino", "San_Marino"),
                                    ("Europe/Sarajevo", "Sarajevo"),
                                    ("Europe/Saratov", "Saratov"),
                                    ("Europe/Simferopol", "Simferopol"),
                                    ("Europe/Skopje", "Skopje"),
                                    ("Europe/Sofia", "Sofia"),
                                    ("Europe/Stockholm", "Stockholm"),
                                    ("Europe/Tallinn", "Tallinn"),
                                    ("Europe/Tirane", "Tirane"),
                                    ("Europe/Tiraspol", "Tiraspol"),
                                    ("Europe/Ulyanovsk", "Ulyanovsk"),
                                    ("Europe/Uzhgorod", "Uzhgorod"),
                                    ("Europe/Vaduz", "Vaduz"),
                                    ("Europe/Vatican", "Vatican"),
                                    ("Europe/Vienna", "Vienna"),
                                    ("Europe/Vilnius", "Vilnius"),
                                    ("Europe/Volgograd", "Volgograd"),
                                    ("Europe/Warsaw", "Warsaw"),
                                    ("Europe/Zagreb", "Zagreb"),
                                    ("Europe/Zaporozhye", "Zaporozhye"),
                                    ("Europe/Zurich", "Zurich"),
                                ],
                            ),
                            (
                                "Indian",
                                [
                                    ("Indian/Antananarivo", "Antananarivo"),
                                    ("Indian/Chagos", "Chagos"),
                                    ("Indian/Christmas", "Christmas"),
                                    ("Indian/Cocos", "Cocos"),
                                    ("Indian/Comoro", "Comoro"),
                                    ("Indian/Kerguelen", "Kerguelen"),
                                    ("Indian/Mahe", "Mahe"),
                                    ("Indian/Maldives", "Maldives"),
                                    ("Indian/Mauritius", "Mauritius"),
                                    ("Indian/Mayotte", "Mayotte"),
                                    ("Indian/Reunion", "Reunion"),
                                ],
                            ),
                            (
                                "Mexico",
                                [
                                    ("Mexico/BajaNorte", "BajaNorte"),
                                    ("Mexico/BajaSur", "BajaSur"),
                                    ("Mexico/General", "General"),
                                ],
                            ),
                            (
                                "Other",
                                [
                                    ("CET", "CET"),
                                    ("CST6CDT", "CST6CDT"),
                                    ("Cuba", "Cuba"),
                                    ("EET", "EET"),
                                    ("EST", "EST"),
                                    ("EST5EDT", "EST5EDT"),
                                    ("Egypt", "Egypt"),
                                    ("Eire", "Eire"),
                                    ("GB", "GB"),
                                    ("GB-Eire", "GB-Eire"),
                                    ("Greenwich", "Greenwich"),
                                    ("HST", "HST"),
                                    ("Hongkong", "Hongkong"),
                                    ("Iceland", "Iceland"),
                                    ("Iran", "Iran"),
                                    ("Israel", "Israel"),
                                    ("Jamaica", "Jamaica"),
                                    ("Japan", "Japan"),
                                    ("Kwajalein", "Kwajalein"),
                                    ("Libya", "Libya"),
                                    ("MET", "MET"),
                                    ("MST", "MST"),
                                    ("MST7MDT", "MST7MDT"),
                                    ("NZ", "NZ"),
                                    ("NZ-CHAT", "NZ-CHAT"),
                                    ("Navajo", "Navajo"),
                                    ("PRC", "PRC"),
                                    ("PST8PDT", "PST8PDT"),
                                    ("Poland", "Poland"),
                                    ("Portugal", "Portugal"),
                                    ("ROC", "ROC"),
                                    ("ROK", "ROK"),
                                    ("Singapore", "Singapore"),
                                    ("Turkey", "Turkey"),
                                    ("UCT", "UCT"),
                                    ("UTC", "UTC"),
                                    ("Universal", "Universal"),
                                    ("W-SU", "W-SU"),
                                    ("WET", "WET"),
                                    ("Zulu", "Zulu"),
                                ],
                            ),
                            (
                                "Pacific",
                                [
                                    ("Pacific/Apia", "Apia"),
                                    ("Pacific/Auckland", "Auckland"),
                                    ("Pacific/Bougainville", "Bougainville"),
                                    ("Pacific/Chatham", "Chatham"),
                                    ("Pacific/Chuuk", "Chuuk"),
                                    ("Pacific/Easter", "Easter"),
                                    ("Pacific/Efate", "Efate"),
                                    ("Pacific/Enderbury", "Enderbury"),
                                    ("Pacific/Fakaofo", "Fakaofo"),
                                    ("Pacific/Fiji", "Fiji"),
                                    ("Pacific/Funafuti", "Funafuti"),
                                    ("Pacific/Galapagos", "Galapagos"),
                                    ("Pacific/Gambier", "Gambier"),
                                    ("Pacific/Guadalcanal", "Guadalcanal"),
                                    ("Pacific/Guam", "Guam"),
                                    ("Pacific/Honolulu", "Honolulu"),
                                    ("Pacific/Johnston", "Johnston"),
                                    ("Pacific/Kiritimati", "Kiritimati"),
                                    ("Pacific/Kosrae", "Kosrae"),
                                    ("Pacific/Kwajalein", "Kwajalein"),
                                    ("Pacific/Majuro", "Majuro"),
                                    ("Pacific/Marquesas", "Marquesas"),
                                    ("Pacific/Midway", "Midway"),
                                    ("Pacific/Nauru", "Nauru"),
                                    ("Pacific/Niue", "Niue"),
                                    ("Pacific/Norfolk", "Norfolk"),
                                    ("Pacific/Noumea", "Noumea"),
                                    ("Pacific/Pago_Pago", "Pago_Pago"),
                                    ("Pacific/Palau", "Palau"),
                                    ("Pacific/Pitcairn", "Pitcairn"),
                                    ("Pacific/Pohnpei", "Pohnpei"),
                                    ("Pacific/Ponape", "Ponape"),
                                    ("Pacific/Port_Moresby", "Port_Moresby"),
                                    ("Pacific/Rarotonga", "Rarotonga"),
                                    ("Pacific/Saipan", "Saipan"),
                                    ("Pacific/Samoa", "Samoa"),
                                    ("Pacific/Tahiti", "Tahiti"),
                                    ("Pacific/Tarawa", "Tarawa"),
                                    ("Pacific/Tongatapu", "Tongatapu"),
                                    ("Pacific/Truk", "Truk"),
                                    ("Pacific/Wake", "Wake"),
                                    ("Pacific/Wallis", "Wallis"),
                                    ("Pacific/Yap", "Yap"),
                                ],
                            ),
                            (
                                "US",
                                [
                                    ("US/Alaska", "Alaska"),
                                    ("US/Aleutian", "Aleutian"),
                                    ("US/Arizona", "Arizona"),
                                    ("US/Central", "Central"),
                                    ("US/East-Indiana", "East-Indiana"),
                                    ("US/Eastern", "Eastern"),
                                    ("US/Hawaii", "Hawaii"),
                                    ("US/Indiana-Starke", "Indiana-Starke"),
                                    ("US/Michigan", "Michigan"),
                                    ("US/Mountain", "Mountain"),
                                    ("US/Pacific", "Pacific"),
                                    ("US/Samoa", "Samoa"),
                                ],
                            ),
                        ],
                        default="America/Toronto",
                        max_length=50,
                        verbose_name="location",
                    ),
                ),
                ("points", models.FloatField(db_index=True, default=0)),
                ("performance_points", models.FloatField(db_index=True, default=0)),
                ("problem_count", models.IntegerField(db_index=True, default=0)),
                (
                    "ace_theme",
                    models.CharField(
                        choices=[
                            ("ambiance", "Ambiance"),
                            ("chaos", "Chaos"),
                            ("chrome", "Chrome"),
                            ("clouds", "Clouds"),
                            ("clouds_midnight", "Clouds Midnight"),
                            ("cobalt", "Cobalt"),
                            ("crimson_editor", "Crimson Editor"),
                            ("dawn", "Dawn"),
                            ("dreamweaver", "Dreamweaver"),
                            ("eclipse", "Eclipse"),
                            ("github", "Github"),
                            ("idle_fingers", "Idle Fingers"),
                            ("katzenmilch", "Katzenmilch"),
                            ("kr_theme", "KR Theme"),
                            ("kuroir", "Kuroir"),
                            ("merbivore", "Merbivore"),
                            ("merbivore_soft", "Merbivore Soft"),
                            ("mono_industrial", "Mono Industrial"),
                            ("monokai", "Monokai"),
                            ("pastel_on_dark", "Pastel on Dark"),
                            ("solarized_dark", "Solarized Dark"),
                            ("solarized_light", "Solarized Light"),
                            ("terminal", "Terminal"),
                            ("textmate", "Textmate"),
                            ("tomorrow", "Tomorrow"),
                            ("tomorrow_night", "Tomorrow Night"),
                            ("tomorrow_night_blue", "Tomorrow Night Blue"),
                            ("tomorrow_night_bright", "Tomorrow Night Bright"),
                            ("tomorrow_night_eighties", "Tomorrow Night Eighties"),
                            ("twilight", "Twilight"),
                            ("vibrant_ink", "Vibrant Ink"),
                            ("xcode", "XCode"),
                        ],
                        default="github",
                        max_length=30,
                    ),
                ),
                (
                    "last_access",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        verbose_name="last access time",
                    ),
                ),
                (
                    "ip",
                    models.GenericIPAddressField(
                        blank=True, null=True, verbose_name="last IP"
                    ),
                ),
                (
                    "display_rank",
                    models.CharField(
                        choices=[
                            ("user", "Normal User"),
                            ("setter", "Problem Setter"),
                            ("admin", "Admin"),
                        ],
                        default="user",
                        max_length=10,
                        verbose_name="display rank",
                    ),
                ),
                (
                    "mute",
                    models.BooleanField(
                        default=False,
                        help_text="Some users are at their best when silent.",
                        verbose_name="comment mute",
                    ),
                ),
                (
                    "is_unlisted",
                    models.BooleanField(
                        default=False,
                        help_text="User will not be ranked.",
                        verbose_name="unlisted user",
                    ),
                ),
                ("rating", models.IntegerField(default=None, null=True)),
                (
                    "user_script",
                    models.TextField(
                        blank=True,
                        default="",
                        help_text="User-defined JavaScript for site customization.",
                        max_length=65536,
                        verbose_name="user script",
                    ),
                ),
                (
                    "math_engine",
                    models.CharField(
                        choices=[
                            ("tex", "Leave as LaTeX"),
                            ("svg", "SVG with PNG fallback"),
                            ("mml", "MathML only"),
                            ("jax", "MathJax with SVG/PNG fallback"),
                            ("auto", "Detect best quality"),
                        ],
                        default="auto",
                        help_text="the rendering engine used to render math",
                        max_length=4,
                        verbose_name="math engine",
                    ),
                ),
                (
                    "is_totp_enabled",
                    models.BooleanField(
                        default=False,
                        help_text="check to enable TOTP-based two factor authentication",
                        verbose_name="2FA enabled",
                    ),
                ),
                (
                    "totp_key",
                    judge.models.profile.EncryptedNullCharField(
                        blank=True,
                        help_text="32 character base32-encoded key for TOTP",
                        max_length=32,
                        null=True,
                        validators=[
                            django.core.validators.RegexValidator(
                                "^$|^[A-Z2-7]{32}$", "TOTP key must be empty or base32"
                            )
                        ],
                        verbose_name="TOTP key",
                    ),
                ),
                (
                    "notes",
                    models.TextField(
                        blank=True,
                        help_text="Notes for administrators regarding this user.",
                        null=True,
                        verbose_name="internal notes",
                    ),
                ),
                (
                    "current_contest",
                    models.OneToOneField(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to="judge.ContestParticipation",
                        verbose_name="current contest",
                    ),
                ),
                (
                    "language",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="judge.Language",
                        verbose_name="preferred language",
                    ),
                ),
                (
                    "organizations",
                    sortedm2m.fields.SortedManyToManyField(
                        blank=True,
                        help_text=None,
                        related_name="members",
                        related_query_name="member",
                        to="judge.Organization",
                        verbose_name="organization",
                    ),
                ),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="user associated",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "user profiles",
                "permissions": (
                    ("test_site", "Shows in-progress development stuff"),
                    ("totp", "Edit TOTP settings"),
                ),
                "verbose_name": "user profile",
            },
        ),
        migrations.CreateModel(
            name="Rating",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("rank", models.IntegerField(verbose_name="rank")),
                ("rating", models.IntegerField(verbose_name="rating")),
                ("volatility", models.IntegerField(verbose_name="volatility")),
                (
                    "last_rated",
                    models.DateTimeField(db_index=True, verbose_name="last rated"),
                ),
                (
                    "contest",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ratings",
                        to="judge.Contest",
                        verbose_name="contest",
                    ),
                ),
                (
                    "participation",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="rating",
                        to="judge.ContestParticipation",
                        verbose_name="participation",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ratings",
                        to="judge.Profile",
                        verbose_name="user",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "contest ratings",
                "verbose_name": "contest rating",
            },
        ),
        migrations.CreateModel(
            name="RuntimeVersion",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=64, verbose_name="runtime name")),
                (
                    "version",
                    models.CharField(
                        blank=True, max_length=64, verbose_name="runtime version"
                    ),
                ),
                (
                    "priority",
                    models.IntegerField(
                        default=0, verbose_name="order in which to display this runtime"
                    ),
                ),
                (
                    "judge",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="judge.Judge",
                        verbose_name="judge on which this runtime exists",
                    ),
                ),
                (
                    "language",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="judge.Language",
                        verbose_name="language to which this runtime belongs",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Solution",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "is_public",
                    models.BooleanField(
                        default=False, verbose_name="public visibility"
                    ),
                ),
                ("publish_on", models.DateTimeField(verbose_name="publish date")),
                ("content", models.TextField(verbose_name="editorial content")),
                (
                    "authors",
                    models.ManyToManyField(
                        blank=True, to="judge.Profile", verbose_name="authors"
                    ),
                ),
                (
                    "problem",
                    models.OneToOneField(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="solution",
                        to="judge.Problem",
                        verbose_name="associated problem",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "solutions",
                "permissions": (("see_private_solution", "See hidden solutions"),),
                "verbose_name": "solution",
            },
        ),
        migrations.CreateModel(
            name="Submission",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "date",
                    models.DateTimeField(
                        auto_now_add=True, db_index=True, verbose_name="submission time"
                    ),
                ),
                (
                    "time",
                    models.FloatField(
                        db_index=True, null=True, verbose_name="execution time"
                    ),
                ),
                ("memory", models.FloatField(null=True, verbose_name="memory usage")),
                (
                    "points",
                    models.FloatField(
                        db_index=True, null=True, verbose_name="points granted"
                    ),
                ),
                (
                    "source",
                    models.TextField(max_length=65536, verbose_name="source code"),
                ),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("QU", "Queued"),
                            ("P", "Processing"),
                            ("G", "Grading"),
                            ("D", "Completed"),
                            ("IE", "Internal Error"),
                            ("CE", "Compile Error"),
                            ("AB", "Aborted"),
                        ],
                        db_index=True,
                        default="QU",
                        max_length=2,
                        verbose_name="status",
                    ),
                ),
                (
                    "result",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("AC", "Accepted"),
                            ("WA", "Wrong Answer"),
                            ("TLE", "Time Limit Exceeded"),
                            ("MLE", "Memory Limit Exceeded"),
                            ("OLE", "Output Limit Exceeded"),
                            ("IR", "Invalid Return"),
                            ("RTE", "Runtime Error"),
                            ("CE", "Compile Error"),
                            ("IE", "Internal Error"),
                            ("SC", "Short circuit"),
                            ("AB", "Aborted"),
                        ],
                        db_index=True,
                        default=None,
                        max_length=3,
                        null=True,
                        verbose_name="result",
                    ),
                ),
                (
                    "error",
                    models.TextField(
                        blank=True, null=True, verbose_name="compile errors"
                    ),
                ),
                ("current_testcase", models.IntegerField(default=0)),
                (
                    "batch",
                    models.BooleanField(default=False, verbose_name="batched cases"),
                ),
                (
                    "case_points",
                    models.FloatField(default=0, verbose_name="test case points"),
                ),
                (
                    "case_total",
                    models.FloatField(default=0, verbose_name="test case total points"),
                ),
                (
                    "was_rejudged",
                    models.BooleanField(
                        default=False, verbose_name="was rejudged by admin"
                    ),
                ),
                (
                    "is_pretested",
                    models.BooleanField(
                        default=False, verbose_name="was ran on pretests only"
                    ),
                ),
                (
                    "judged_on",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="judge.Judge",
                        verbose_name="judged on",
                    ),
                ),
                (
                    "language",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="judge.Language",
                        verbose_name="submission language",
                    ),
                ),
                (
                    "problem",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to="judge.Problem"
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to="judge.Profile"
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "submissions",
                "permissions": (
                    ("abort_any_submission", "Abort any submission"),
                    ("rejudge_submission", "Rejudge the submission"),
                    ("rejudge_submission_lot", "Rejudge a lot of submissions"),
                    ("spam_submission", "Submit without limit"),
                    ("view_all_submission", "View all submission"),
                    ("resubmit_other", "Resubmit others' submission"),
                ),
                "verbose_name": "submission",
            },
        ),
        migrations.CreateModel(
            name="SubmissionTestCase",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("case", models.IntegerField(verbose_name="test case ID")),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("AC", "Accepted"),
                            ("WA", "Wrong Answer"),
                            ("TLE", "Time Limit Exceeded"),
                            ("MLE", "Memory Limit Exceeded"),
                            ("OLE", "Output Limit Exceeded"),
                            ("IR", "Invalid Return"),
                            ("RTE", "Runtime Error"),
                            ("CE", "Compile Error"),
                            ("IE", "Internal Error"),
                            ("SC", "Short circuit"),
                            ("AB", "Aborted"),
                        ],
                        max_length=3,
                        verbose_name="status flag",
                    ),
                ),
                ("time", models.FloatField(null=True, verbose_name="execution time")),
                ("memory", models.FloatField(null=True, verbose_name="memory usage")),
                ("points", models.FloatField(null=True, verbose_name="points granted")),
                ("total", models.FloatField(null=True, verbose_name="points possible")),
                ("batch", models.IntegerField(null=True, verbose_name="batch number")),
                (
                    "feedback",
                    models.CharField(
                        blank=True, max_length=50, verbose_name="judging feedback"
                    ),
                ),
                (
                    "extended_feedback",
                    models.TextField(
                        blank=True, verbose_name="extended judging feedback"
                    ),
                ),
                ("output", models.TextField(blank=True, verbose_name="program output")),
                (
                    "submission",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="test_cases",
                        to="judge.Submission",
                        verbose_name="associated submission",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "submission test cases",
                "verbose_name": "submission test case",
            },
        ),
        migrations.CreateModel(
            name="Ticket",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "title",
                    models.CharField(max_length=100, verbose_name="ticket title"),
                ),
                (
                    "time",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="creation time"
                    ),
                ),
                (
                    "notes",
                    models.TextField(
                        blank=True,
                        help_text="Staff notes for this issue to aid in processing.",
                        verbose_name="quick notes",
                    ),
                ),
                (
                    "object_id",
                    models.PositiveIntegerField(verbose_name="linked item ID"),
                ),
                (
                    "is_open",
                    models.BooleanField(default=True, verbose_name="is ticket open?"),
                ),
                (
                    "assignees",
                    models.ManyToManyField(
                        related_name="assigned_tickets",
                        to="judge.Profile",
                        verbose_name="assignees",
                    ),
                ),
                (
                    "content_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.ContentType",
                        verbose_name="linked item type",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="tickets",
                        to="judge.Profile",
                        verbose_name="ticket creator",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="TicketMessage",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("body", models.TextField(verbose_name="message body")),
                (
                    "time",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="message time"
                    ),
                ),
                (
                    "ticket",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="messages",
                        related_query_name="message",
                        to="judge.Ticket",
                        verbose_name="ticket",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ticket_messages",
                        to="judge.Profile",
                        verbose_name="poster",
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="problem",
            name="authors",
            field=models.ManyToManyField(
                blank=True,
                related_name="authored_problems",
                to="judge.Profile",
                verbose_name="creators",
            ),
        ),
        migrations.AddField(
            model_name="problem",
            name="banned_users",
            field=models.ManyToManyField(
                blank=True,
                help_text="Bans the selected users from submitting to this problem.",
                to="judge.Profile",
                verbose_name="personae non gratae",
            ),
        ),
        migrations.AddField(
            model_name="problem",
            name="curators",
            field=models.ManyToManyField(
                blank=True,
                help_text="These users will be able to edit a problem, but not be publicly shown as an author.",
                related_name="curated_problems",
                to="judge.Profile",
                verbose_name="curators",
            ),
        ),
        migrations.AddField(
            model_name="problem",
            name="group",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to="judge.ProblemGroup",
                verbose_name="problem group",
            ),
        ),
        migrations.AddField(
            model_name="problem",
            name="license",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to="judge.License",
            ),
        ),
        migrations.AddField(
            model_name="problem",
            name="organizations",
            field=models.ManyToManyField(
                blank=True,
                help_text="If private, only these organizations may see the problem.",
                to="judge.Organization",
                verbose_name="organizations",
            ),
        ),
        migrations.AddField(
            model_name="problem",
            name="testers",
            field=models.ManyToManyField(
                blank=True,
                help_text="These users will be able to view a private problem, but not edit it.",
                related_name="tested_problems",
                to="judge.Profile",
                verbose_name="testers",
            ),
        ),
        migrations.AddField(
            model_name="problem",
            name="types",
            field=models.ManyToManyField(
                to="judge.ProblemType", verbose_name="problem types"
            ),
        ),
        migrations.AddField(
            model_name="privatemessage",
            name="sender",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="sent_messages",
                to="judge.Profile",
                verbose_name="sender",
            ),
        ),
        migrations.AddField(
            model_name="privatemessage",
            name="target",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="received_messages",
                to="judge.Profile",
                verbose_name="target",
            ),
        ),
        migrations.AddField(
            model_name="organizationrequest",
            name="user",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="requests",
                to="judge.Profile",
                verbose_name="user",
            ),
        ),
        migrations.AddField(
            model_name="organization",
            name="admins",
            field=models.ManyToManyField(
                help_text="Those who can edit this organization",
                related_name="admin_of",
                to="judge.Profile",
                verbose_name="administrators",
            ),
        ),
        migrations.AddField(
            model_name="organization",
            name="registrant",
            field=models.ForeignKey(
                help_text="User who registered this organization",
                on_delete=django.db.models.deletion.CASCADE,
                related_name="registrant+",
                to="judge.Profile",
                verbose_name="registrant",
            ),
        ),
        migrations.AddField(
            model_name="languagelimit",
            name="problem",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="language_limits",
                to="judge.Problem",
                verbose_name="problem",
            ),
        ),
        migrations.AddField(
            model_name="judge",
            name="problems",
            field=models.ManyToManyField(
                related_name="judges", to="judge.Problem", verbose_name="problems"
            ),
        ),
        migrations.AddField(
            model_name="judge",
            name="runtimes",
            field=models.ManyToManyField(
                related_name="judges", to="judge.Language", verbose_name="judges"
            ),
        ),
        migrations.AddField(
            model_name="contestsubmission",
            name="submission",
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="contest",
                to="judge.Submission",
                verbose_name="submission",
            ),
        ),
        migrations.AddField(
            model_name="contestproblem",
            name="problem",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="contests",
                to="judge.Problem",
                verbose_name="problem",
            ),
        ),
        migrations.AddField(
            model_name="contestparticipation",
            name="user",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="contest_history",
                to="judge.Profile",
                verbose_name="user",
            ),
        ),
        migrations.AddField(
            model_name="contest",
            name="banned_users",
            field=models.ManyToManyField(
                blank=True,
                help_text="Bans the selected users from joining this contest.",
                to="judge.Profile",
                verbose_name="personae non gratae",
            ),
        ),
        migrations.AddField(
            model_name="contest",
            name="organizations",
            field=models.ManyToManyField(
                blank=True,
                help_text="If private, only these organizations may see the contest",
                to="judge.Organization",
                verbose_name="organizations",
            ),
        ),
        migrations.AddField(
            model_name="contest",
            name="organizers",
            field=models.ManyToManyField(
                help_text="These people will be able to edit the contest.",
                related_name="_contest_organizers_+",
                to="judge.Profile",
            ),
        ),
        migrations.AddField(
            model_name="contest",
            name="problems",
            field=models.ManyToManyField(
                through="judge.ContestProblem",
                to="judge.Problem",
                verbose_name="problems",
            ),
        ),
        migrations.AddField(
            model_name="contest",
            name="rate_exclude",
            field=models.ManyToManyField(
                blank=True,
                related_name="_contest_rate_exclude_+",
                to="judge.Profile",
                verbose_name="exclude from ratings",
            ),
        ),
        migrations.AddField(
            model_name="contest",
            name="tags",
            field=models.ManyToManyField(
                blank=True,
                related_name="contests",
                to="judge.ContestTag",
                verbose_name="contest tags",
            ),
        ),
        migrations.AddField(
            model_name="commentvote",
            name="voter",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="voted_comments",
                to="judge.Profile",
            ),
        ),
        migrations.AddField(
            model_name="comment",
            name="author",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to="judge.Profile",
                verbose_name="commenter",
            ),
        ),
        migrations.AddField(
            model_name="comment",
            name="parent",
            field=mptt.fields.TreeForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="replies",
                to="judge.Comment",
                verbose_name="parent",
            ),
        ),
        migrations.AddField(
            model_name="blogpost",
            name="authors",
            field=models.ManyToManyField(
                blank=True, to="judge.Profile", verbose_name="authors"
            ),
        ),
        migrations.AlterUniqueTogether(
            name="rating",
            unique_together=set([("user", "contest")]),
        ),
        migrations.AlterUniqueTogether(
            name="problemtranslation",
            unique_together=set([("problem", "language")]),
        ),
        migrations.AlterUniqueTogether(
            name="languagelimit",
            unique_together=set([("problem", "language")]),
        ),
        migrations.AlterUniqueTogether(
            name="contestproblem",
            unique_together=set([("problem", "contest")]),
        ),
        migrations.AlterUniqueTogether(
            name="contestparticipation",
            unique_together=set([("contest", "user", "virtual")]),
        ),
        migrations.AlterUniqueTogether(
            name="commentvote",
            unique_together=set([("voter", "comment")]),
        ),
    ]
