NDOJ/judge/migrations/0096_profile_language_set_default.py

28 lines
871 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):
Language = apps.get_model('judge', 'Language')
Language.objects.get_or_create(key='PY3', defaults={'name': 'Python 3'})[0]
2020-01-21 06:35:58 +00:00
class Migration(migrations.Migration):
dependencies = [
('judge', '0095_organization_logo_override'),
]
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(
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'),
),
]