class Migration(migrations.Migration):

    dependencies = [
        ('contest', '0006_contest_out_files'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='contest',
            name='in_files',
        ),
        migrations.RemoveField(
            model_name='contest',
            name='out_files',
        ),
        migrations.AddField(
            model_name='test',
            name='opt_file1',
            field=models.FileField(blank=True, max_length=512, null=True, upload_to=contest.models.get_tests_path),
        ),
        migrations.AddField(
            model_name='test',
            name='opt_file2',
            field=models.FileField(blank=True, max_length=512, null=True, upload_to=contest.models.get_tests_path),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('contest', '0013_auto_20200504_0633'),
    ]

    operations = [
        migrations.AddField(
            model_name='comment',
            name='commented_content_type',
            field=models.ForeignKey(
                default=0,
                on_delete=django.db.models.deletion.PROTECT,
                to='contenttypes.ContentType'),
        ),
        migrations.AddField(
            model_name='comment',
            name='commented_object_id',
            field=models.IntegerField(default=0),
        ),
        migrations.AlterField(
            model_name='photo',
            name='image',
            field=models.FileField(upload_to=contest.models.get_path),
        ),
        migrations.AlterField(
            model_name='photo',
            name='thumb_for_gallery',
            field=models.FileField(null=True,
                                   upload_to=contest.models.get_path),
        ),
        migrations.DeleteModel(name='CommentItem', ),
    ]
Beispiel #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Contest',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('contest_id', models.IntegerField(unique=True)),
                ('name_of_contest', models.CharField(max_length=20)),
                ('rated_or_test', models.BooleanField(default=False)),
                ('number_of_problems', models.IntegerField(default=0)),
                ('start_time', models.TimeField(null=True)),
                ('end_time', models.TimeField(null=True)),
                ('duration_of_content', models.FloatField(default=0)),
                ('live', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Problem',
            fields=[
                ('problem_id',
                 models.IntegerField(primary_key=True, serialize=False)),
                ('name_of_problem', models.CharField(max_length=40)),
                ('test_files',
                 models.FileField(null=True,
                                  upload_to=contest.models.test_file_upload)),
                ('sample_io',
                 models.FileField(null=True,
                                  upload_to=contest.models.sample_io_upload)),
                ('time_limit', models.IntegerField(default=1)),
                ('max_score', models.IntegerField(default=100)),
                ('number_of_correct_submissions',
                 models.IntegerField(default=0)),
                ('contest',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='problems',
                                   to='contest.Contest')),
            ],
        ),
    ]
Beispiel #4
0
class Migration(migrations.Migration):

    dependencies = [
        ('contest', '0005_auto_20191201_1744'),
    ]

    operations = [
        migrations.AddField(
            model_name='contest',
            name='out_files',
            field=models.FileField(blank=True, null=True, upload_to=contest.models.get_contest_outs_files_path),
        ),
    ]
Beispiel #5
0
class Migration(migrations.Migration):

    dependencies = [
        ('contest', '0002_remove_problem_sample_io'),
    ]

    operations = [
        migrations.AddField(
            model_name='problem',
            name='sample_io',
            field=models.FileField(null=True,
                                   upload_to=contest.models.sample_io_upload),
        ),
    ]
Beispiel #6
0
class Migration(migrations.Migration):

    dependencies = [
        ('contest', '0002_auto_20201222_1316'),
    ]

    operations = [
        migrations.AddField(
            model_name='contest',
            name='banner_image',
            field=models.FileField(
                null=True, upload_to=contest.models.upload_contest_banner),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('contest', '0004_contest_in_files'),
    ]

    operations = [
        migrations.AlterField(
            model_name='contest',
            name='in_files',
            field=models.FileField(
                blank=True,
                null=True,
                upload_to=contest.models.get_contest_ins_files_path),
        ),
    ]
Beispiel #8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Atempt',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True)),
                ('file',
                 models.FileField(
                     max_length=512,
                     upload_to=contest.models.get_file_path,
                     validators=[contest.validators.validate_file_extension])),
                ('comment',
                 models.CharField(blank=True, max_length=128, null=True)),
                ('compile_error', models.BooleanField(blank=True,
                                                      default=False)),
                ('failed_mandatory_test',
                 models.BooleanField(blank=True, default=False)),
                ('error_description', models.TextField(blank=True, null=True)),
                ('grade', models.IntegerField(blank=True, default=0,
                                              null=True)),
                ('time_benchmark',
                 models.IntegerField(blank=True, default=0, null=True)),
                ('memory_benchmark',
                 models.IntegerField(blank=True, default=0, null=True)),
                ('elapsed_time',
                 models.IntegerField(blank=True, default=0, null=True)),
                ('cpu_time',
                 models.DecimalField(blank=True,
                                     decimal_places=3,
                                     max_digits=8,
                                     null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Contest',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=128)),
                ('short_name', models.CharField(max_length=16, unique=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('sow',
                 models.FileField(
                     blank=True,
                     max_length=512,
                     null=True,
                     upload_to=contest.models.get_contest_detail_path)),
                ('reference_code',
                 models.FileField(
                     blank=True,
                     null=True,
                     upload_to=contest.models.get_contest_code_path)),
                ('start_date', models.DateTimeField(blank=True, null=True)),
                ('end_date', models.DateTimeField(blank=True, null=True)),
                ('min_team_members',
                 models.PositiveSmallIntegerField(default=1)),
                ('max_team_members',
                 models.PositiveSmallIntegerField(default=3)),
                ('compile_flags', models.CharField(max_length=120)),
                ('linkage_flags', models.CharField(max_length=120)),
                ('max_classification', models.IntegerField(default=20)),
                ('visible', models.BooleanField(default=True)),
                ('automatic_weight', models.BooleanField(default=True)),
                ('max_submitions', models.PositiveIntegerField(default=0)),
                ('cpu', models.PositiveIntegerField(default=1)),
                ('mem', models.PositiveIntegerField(default=32768)),
                ('space', models.PositiveIntegerField(default=0)),
                ('minuid', models.PositiveIntegerField(default=5000)),
                ('maxuid', models.PositiveIntegerField(default=65535)),
                ('core', models.PositiveIntegerField(default=0)),
                ('nproc', models.PositiveIntegerField(default=0)),
                ('fsize', models.PositiveIntegerField(default=8192)),
                ('stack', models.PositiveIntegerField(default=8192)),
                ('clock', models.PositiveIntegerField(default=10)),
                ('chroot', models.CharField(default='/tmp', max_length=128)),
            ],
        ),
        migrations.CreateModel(
            name='SafeExecError',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('description', models.CharField(max_length=128, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Team',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=16)),
                ('contest',
                 models.ForeignKey(default=1,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='contest.Contest')),
            ],
            options={
                'unique_together': {('name', 'contest')},
            },
        ),
        migrations.CreateModel(
            name='Test',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('input_file',
                 models.FileField(max_length=512,
                                  upload_to=contest.models.get_tests_path)),
                ('output_file',
                 models.FileField(max_length=512,
                                  upload_to=contest.models.get_tests_path)),
                ('mandatory', models.BooleanField(default=False)),
                ('weight_pct',
                 models.DecimalField(decimal_places=2,
                                     default=10,
                                     max_digits=6)),
                ('run_arguments',
                 models.CharField(blank=True, max_length=512, null=True)),
                ('use_for_time_benchmark', models.BooleanField(default=False)),
                ('use_for_memory_benchmark',
                 models.BooleanField(default=False)),
                ('type_of_feedback', models.PositiveIntegerField(default=1)),
                ('override_exec_options', models.BooleanField(default=False)),
                ('cpu', models.PositiveIntegerField(default=1)),
                ('mem', models.PositiveIntegerField(default=32768)),
                ('space', models.PositiveIntegerField(default=0)),
                ('core', models.PositiveIntegerField(default=0)),
                ('nproc', models.PositiveIntegerField(default=0)),
                ('fsize', models.PositiveIntegerField(default=8192)),
                ('stack', models.PositiveIntegerField(default=8192)),
                ('clock', models.PositiveIntegerField(default=10)),
                ('contest',
                 models.ForeignKey(default=1,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='contest.Contest')),
            ],
        ),
        migrations.CreateModel(
            name='TeamMember',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('approved', models.BooleanField(blank=True, default=False)),
                ('team',
                 models.ForeignKey(default=1,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='contest.Team')),
                ('user',
                 models.ForeignKey(default=1,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('number', models.IntegerField(blank=True, null=True)),
                ('gprd',
                 models.BooleanField(blank=True, default=True, null=True)),
                ('valid', models.BooleanField(default=False)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='profile',
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Classification',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('passed', models.BooleanField(default=False)),
                ('output',
                 models.FileField(blank=True,
                                  max_length=512,
                                  null=True,
                                  upload_to='')),
                ('report_file',
                 models.FileField(blank=True,
                                  max_length=512,
                                  null=True,
                                  upload_to='')),
                ('execution_time', models.IntegerField(blank=True, null=True)),
                ('error_description', models.TextField(blank=True, null=True)),
                ('memory_usage', models.IntegerField(blank=True, null=True)),
                ('cpu_time',
                 models.DecimalField(blank=True,
                                     decimal_places=3,
                                     max_digits=8,
                                     null=True)),
                ('elapsed_time', models.IntegerField(blank=True, null=True)),
                ('exception', models.TextField(blank=True, null=True)),
                ('attempt',
                 models.ForeignKey(default=1,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='contest.Atempt')),
                ('error',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='contest.SafeExecError')),
                ('test',
                 models.ForeignKey(default=1,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='contest.Test')),
            ],
        ),
        migrations.AddField(
            model_name='atempt',
            name='contest',
            field=models.ForeignKey(
                default=1,
                on_delete=django.db.models.deletion.CASCADE,
                to='contest.Contest'),
        ),
        migrations.AddField(
            model_name='atempt',
            name='team',
            field=models.ForeignKey(
                default=1,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to='contest.Team'),
        ),
        migrations.AddField(
            model_name='atempt',
            name='user',
            field=models.ForeignKey(
                default=1,
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL),
        ),
    ]