Cloned DMOJ
This commit is contained in:
parent
f623974b58
commit
49dc9ff10c
513 changed files with 132349 additions and 39 deletions
761
judge/migrations/0001_squashed_0084_contest_formats.py
Normal file
761
judge/migrations/0001_squashed_0084_contest_formats.py
Normal file
File diff suppressed because one or more lines are too long
39
judge/migrations/0085_submission_source.py
Normal file
39
judge/migrations/0085_submission_source.py
Normal file
|
@ -0,0 +1,39 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.15 on 2019-01-31 22:18
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('judge', '0084_contest_formats'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='SubmissionSource',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('source', models.TextField(max_length=65536, verbose_name='source code')),
|
||||
('submission', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='link', to='judge.Submission', verbose_name='associated submission')),
|
||||
],
|
||||
),
|
||||
migrations.RunSQL(
|
||||
['''INSERT INTO judge_submissionsource (source, submission_id)
|
||||
SELECT source, id AS 'submission_id' FROM judge_submission;'''],
|
||||
['''UPDATE judge_submission sub
|
||||
INNER JOIN judge_submissionsource src ON sub.id = src.submission_id
|
||||
SET sub.source = src.source;'''],
|
||||
elidable=True,
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='submission',
|
||||
name='source',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='submissionsource',
|
||||
name='submission',
|
||||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='source', to='judge.Submission', verbose_name='associated submission'),
|
||||
),
|
||||
]
|
23
judge/migrations/0086_rating_ceiling.py
Normal file
23
judge/migrations/0086_rating_ceiling.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.20 on 2019-06-20 16:04
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('judge', '0085_submission_source'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='contest',
|
||||
name='rating_ceiling',
|
||||
field=models.IntegerField(blank=True, help_text='Rating ceiling for contest', null=True, verbose_name='rating ceiling'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='contest',
|
||||
name='rating_floor',
|
||||
field=models.IntegerField(blank=True, help_text='Rating floor for contest', null=True, verbose_name='rating floor'),
|
||||
),
|
||||
]
|
24
judge/migrations/0087_problem_resource_limits.py
Normal file
24
judge/migrations/0087_problem_resource_limits.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.20 on 2019-06-09 14:44
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('judge', '0086_rating_ceiling'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='problem',
|
||||
name='memory_limit',
|
||||
field=models.PositiveIntegerField(help_text='The memory limit for this problem, in kilobytes (e.g. 64mb = 65536 kilobytes).', verbose_name='memory limit'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='problem',
|
||||
name='time_limit',
|
||||
field=models.FloatField(help_text='The time limit for this problem, in seconds. Fractional seconds (e.g. 1.5) are supported.', validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(2000)], verbose_name='time limit'),
|
||||
),
|
||||
]
|
37
judge/migrations/0088_private_contests.py
Normal file
37
judge/migrations/0088_private_contests.py
Normal file
|
@ -0,0 +1,37 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.20 on 2019-09-02 15:58
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('judge', '0087_problem_resource_limits'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='contest',
|
||||
options={'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'), ('create_private_contest', 'Create private contests')), 'verbose_name': 'contest', 'verbose_name_plural': 'contests'},
|
||||
),
|
||||
migrations.RenameField(
|
||||
model_name='contest',
|
||||
old_name='is_public',
|
||||
new_name='is_visible',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='contest',
|
||||
name='is_organization_private',
|
||||
field=models.BooleanField(default=False, verbose_name='private to organizations'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='contest',
|
||||
name='private_contestants',
|
||||
field=models.ManyToManyField(blank=True, help_text='If private, only these users may see the contest', related_name='_contest_private_contestants_+', to='judge.Profile', verbose_name='private contestants'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='contest',
|
||||
name='is_private',
|
||||
field=models.BooleanField(default=False, verbose_name='private to specific users'),
|
||||
),
|
||||
]
|
27
judge/migrations/0089_submission_to_contest.py
Normal file
27
judge/migrations/0089_submission_to_contest.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Generated by Django 2.1.12 on 2019-09-25 23:28
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('judge', '0088_private_contests'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='submission',
|
||||
name='contest_object',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='judge.Contest', verbose_name='contest'),
|
||||
),
|
||||
migrations.RunSQL('''
|
||||
UPDATE `judge_submission`
|
||||
INNER JOIN `judge_contestsubmission`
|
||||
ON (`judge_submission`.`id` = `judge_contestsubmission`.`submission_id`)
|
||||
INNER JOIN `judge_contestparticipation`
|
||||
ON (`judge_contestsubmission`.`participation_id` = `judge_contestparticipation`.`id`)
|
||||
SET `judge_submission`.`contest_object_id` = `judge_contestparticipation`.`contest_id`
|
||||
''', migrations.RunSQL.noop),
|
||||
]
|
19
judge/migrations/0090_fix_contest_visibility.py
Normal file
19
judge/migrations/0090_fix_contest_visibility.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('judge', '0089_submission_to_contest'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunSQL('''
|
||||
UPDATE `judge_contest`
|
||||
SET `judge_contest`.`is_private` = 0, `judge_contest`.`is_organization_private` = 1
|
||||
WHERE `judge_contest`.`is_private` = 1
|
||||
''', '''
|
||||
UPDATE `judge_contest`
|
||||
SET `judge_contest`.`is_private` = `judge_contest`.`is_organization_private`
|
||||
'''),
|
||||
]
|
23
judge/migrations/0091_compiler_message_ansi2html.py
Normal file
23
judge/migrations/0091_compiler_message_ansi2html.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import lxml.html as lh
|
||||
from django.db import migrations
|
||||
from lxml.html.clean import clean_html
|
||||
|
||||
|
||||
def strip_error_html(apps, schema_editor):
|
||||
Submission = apps.get_model('judge', 'Submission')
|
||||
for sub in Submission.objects.filter(error__isnull=False).iterator():
|
||||
if sub.error:
|
||||
sub.error = clean_html(lh.fromstring(sub.error)).text_content()
|
||||
sub.save(update_fields=['error'])
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('judge', '0090_fix_contest_visibility'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(strip_error_html, migrations.RunPython.noop, atomic=True),
|
||||
]
|
17
judge/migrations/0092_contest_clone.py
Normal file
17
judge/migrations/0092_contest_clone.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Generated by Django 2.1.12 on 2019-09-30 21:25
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('judge', '0091_compiler_message_ansi2html'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='contest',
|
||||
options={'permissions': (('see_private_contest', 'See private contests'), ('edit_own_contest', 'Edit own contests'), ('edit_all_contest', 'Edit all contests'), ('clone_contest', 'Clone contest'), ('contest_rating', 'Rate contests'), ('contest_access_code', 'Contest access codes'), ('create_private_contest', 'Create private contests')), 'verbose_name': 'contest', 'verbose_name_plural': 'contests'},
|
||||
),
|
||||
]
|
45
judge/migrations/0093_contest_moss.py
Normal file
45
judge/migrations/0093_contest_moss.py
Normal file
|
@ -0,0 +1,45 @@
|
|||
# Generated by Django 2.1.12 on 2019-10-17 20:52
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('judge', '0092_contest_clone'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ContestMoss',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('language', models.CharField(max_length=10)),
|
||||
('submission_count', models.PositiveIntegerField(default=0)),
|
||||
('url', models.URLField(blank=True, null=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'contest moss result',
|
||||
'verbose_name_plural': 'contest moss results',
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='contest',
|
||||
options={'permissions': (('see_private_contest', 'See private contests'), ('edit_own_contest', 'Edit own contests'), ('edit_all_contest', 'Edit all contests'), ('clone_contest', 'Clone contest'), ('moss_contest', 'MOSS contest'), ('contest_rating', 'Rate contests'), ('contest_access_code', 'Contest access codes'), ('create_private_contest', 'Create private contests')), 'verbose_name': 'contest', 'verbose_name_plural': 'contests'},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='contestmoss',
|
||||
name='contest',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='moss', to='judge.Contest', verbose_name='contest'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='contestmoss',
|
||||
name='problem',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='moss', to='judge.Problem', verbose_name='problem'),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='contestmoss',
|
||||
unique_together={('contest', 'problem', 'language')},
|
||||
),
|
||||
]
|
14
judge/migrations/0094_submissiontestcase_unique_together.py
Normal file
14
judge/migrations/0094_submissiontestcase_unique_together.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('judge', '0093_contest_moss'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterUniqueTogether(
|
||||
name='submissiontestcase',
|
||||
unique_together={('submission', 'case')},
|
||||
),
|
||||
]
|
18
judge/migrations/0095_organization_logo_override.py
Normal file
18
judge/migrations/0095_organization_logo_override.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.1.12 on 2019-10-23 00:11
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('judge', '0094_submissiontestcase_unique_together'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='organization',
|
||||
name='logo_override_image',
|
||||
field=models.CharField(blank=True, default='', help_text='This image will replace the default site logo for users viewing the organization.', max_length=150, verbose_name='Logo override image'),
|
||||
),
|
||||
]
|
21
judge/migrations/0096_profile_language_set_default.py
Normal file
21
judge/migrations/0096_profile_language_set_default.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
# 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
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('judge', '0095_organization_logo_override'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
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'),
|
||||
),
|
||||
]
|
23
judge/migrations/0097_participation_is_disqualified.py
Normal file
23
judge/migrations/0097_participation_is_disqualified.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 2.2.7 on 2019-11-10 02:13
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('judge', '0096_profile_language_set_default'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='contestparticipation',
|
||||
name='is_disqualified',
|
||||
field=models.BooleanField(default=False, help_text='Whether this participation is disqualified.', verbose_name='is disqualified'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='contestparticipation',
|
||||
name='virtual',
|
||||
field=models.IntegerField(default=0, help_text='0 means non-virtual, otherwise the n-th virtual participation.', verbose_name='virtual participation id'),
|
||||
),
|
||||
]
|
0
judge/migrations/__init__.py
Normal file
0
judge/migrations/__init__.py
Normal file
Loading…
Add table
Add a link
Reference in a new issue