Rename problem data fields

This commit is contained in:
cuom1999 2024-03-18 23:53:35 -05:00
parent acdf94a8c9
commit 5e72b472e6
8 changed files with 277 additions and 170 deletions

View file

@ -38,7 +38,7 @@ CHECKERS = (
("identical", _("Byte identical")),
("linecount", _("Line-by-line")),
("custom", _("Custom checker (PY)")),
("customval", _("Custom validator (CPP)")),
("customcpp", _("Custom checker (CPP)")),
("interact", _("Interactive")),
("testlib", _("Testlib")),
)
@ -90,8 +90,8 @@ class ProblemData(models.Model):
upload_to=problem_directory_file,
validators=[FileExtensionValidator(allowed_extensions=["py"])],
)
custom_validator = models.FileField(
verbose_name=_("custom validator file"),
custom_checker_cpp = models.FileField(
verbose_name=_("custom cpp checker file"),
storage=problem_data_storage,
null=True,
blank=True,
@ -186,9 +186,9 @@ class ProblemData(models.Model):
self.custom_checker.name = problem_directory_file_helper(
new, self.custom_checker.name
)
if self.custom_validator:
self.custom_validator.name = problem_directory_file_helper(
new, self.custom_validator.name
if self.custom_checker_cpp:
self.custom_checker_cpp.name = problem_directory_file_helper(
new, self.custom_checker_cpp.name
)
if self.interactive_judge:
self.interactive_judge.name = problem_directory_file_helper(