sio3pack.django.common.handler

Module Contents

class sio3pack.django.common.handler.DjangoHandler(package, problem_id)[source]

Base class for handling Django models. Allows to save the package to the database and retrieve its data.

Parameters:
  • package (Package) – The package to handle.

  • problem_id (int) – The problem ID.

package
problem_id
save_to_db()[source]

Save the package to the database.

Raises:

PackageAlreadyExists – If a package with the same problem ID already exists.

get_executable_path(program)[source]

Get the executable path for the given program.

Parameters:
  • program (django.core.files.File | str) – The program to get the path for.

  • program

Returns:

The executable path or None if not found.

Return type:

str | None

property short_name: str

Short name of the problem.

Return type:

str

property full_name: str

Full name of the problem.

Return type:

str

property lang_titles: dict[str, str]

A dictionary of problem titles, where keys are language codes and values are titles.

Return type:

dict[str, str]

property model_solutions: list[dict[str, Any]]

A list of model solutions, where each element is a dictionary containing a RemoteFile object.

Return type:

list[dict[str, Any]]

property main_model_solution: sio3pack.files.remote_file.RemoteFile

The main model solution as a RemoteFile.

Return type:

sio3pack.files.remote_file.RemoteFile

property lang_statements: dict[str, sio3pack.files.remote_file.RemoteFile]

A dictionary of problem statements, where keys are language codes and values are files.

Return type:

dict[str, sio3pack.files.remote_file.RemoteFile]

property tests: list[sio3pack.test.Test]

A list of tests, where each element is a dictionary containing

Return type:

list[sio3pack.test.Test]

property workflows: dict[str, sio3pack.workflow.Workflow]

A dictionary of workflows, where keys are workflow names and values are Workflow objects.

Return type:

dict[str, sio3pack.workflow.Workflow]