NDOJ/judge/migrations/0096_profile_language_set_default.py

33 lines
950 B
Python
Raw Permalink Normal View History

2020-01-21 06:35:58 +00:00
# Generated by Django 2.2.6 on 2019-11-08 01:27
import django.db.models.deletion
from django.db import migrations, models
import judge.models.runtime
2021-07-08 21:03:51 +00:00
def create_python3(apps, schema_editor):
2022-05-14 17:57:27 +00:00
Language = apps.get_model("judge", "Language")
Language.objects.get_or_create(key="PY3", defaults={"name": "Python 3"})[0]
2021-07-08 21:03:51 +00:00
2020-01-21 06:35:58 +00:00
class Migration(migrations.Migration):
dependencies = [
2022-05-14 17:57:27 +00:00
("judge", "0095_organization_logo_override"),
2020-01-21 06:35:58 +00:00
]
operations = [
2021-07-08 21:03:51 +00:00
migrations.RunPython(create_python3, reverse_code=migrations.RunPython.noop),
2020-01-21 06:35:58 +00:00
migrations.AlterField(
2022-05-14 17:57:27 +00:00
model_name="profile",
name="language",
field=models.ForeignKey(
default=judge.models.runtime.Language.get_default_language_pk,
on_delete=django.db.models.deletion.SET_DEFAULT,
to="judge.Language",
verbose_name="preferred language",
),
2020-01-21 06:35:58 +00:00
),
]