NDOJ/judge/migrations/0164_show_testcase.py

31 lines
803 B
Python
Raw Normal View History

# Generated by Django 3.2.18 on 2023-08-25 23:03
from django.db import migrations, models
def migrate_show_testcases(apps, schema_editor):
ContestProblem = apps.get_model("judge", "ContestProblem")
for c in ContestProblem.objects.all():
if c.output_prefix_override == 1:
c.show_testcases = True
c.save()
class Migration(migrations.Migration):
dependencies = [
("judge", "0163_email_change"),
]
operations = [
migrations.AddField(
model_name="contestproblem",
name="show_testcases",
field=models.BooleanField(default=False, verbose_name="visible testcases"),
),
migrations.RunPython(
migrate_show_testcases, migrations.RunPython.noop, atomic=True
),
]