oioioi.problems.api

Module Contents

Classes

PackageUploadQueryView

Endpoint that given package_id returns package_status.

BasePackageUploadView

Intentionally simple parent class for all views. Only implements

PackageUploadView

Endpoint allowing for uploading problem packages.

PackageReuploadView

Endpoint allowing for reuploading problem packages.

Functions

_check_permissions(request[, contest, existing_problem])

oioioi.problems.api._check_permissions(request, contest=None, existing_problem=None)[source]
class oioioi.problems.api.PackageUploadQueryView(**kwargs)[source]

Bases: rest_framework.views.APIView

Endpoint that given package_id returns package_status. Possible values for the package_status are: - “OK”: if the package was successfully uploaded (if so, the problem_id is returned, if one is available), - “ERR”: if the package upload failed (if so, info describing an error is returned, if one is available), - “?”: if the package upload is pending.

permission_classes[source]
schema[source]
static check_permissions(request, contest=None, existing_problem=None)[source]

Check if the request should be permitted. Raises an appropriate exception if the request is not permitted.

get(request, package_id)[source]
class oioioi.problems.api.BasePackageUploadView(**kwargs)[source]

Bases: rest_framework.views.APIView

Intentionally simple parent class for all views. Only implements dispatch-by-method and simple sanity checking.

parser_class[source]
permission_classes[source]
serializer_class[source]
form_class[source]
static check_permissions(request, contest=None, existing_problem=None)[source]

Check if the request should be permitted. Raises an appropriate exception if the request is not permitted.

abstract static prepare_data(dictionary)[source]
static submit_upload_form(form, request, contest)[source]
post(request, *args, **kwargs)[source]
class oioioi.problems.api.PackageUploadView(**kwargs)[source]

Bases: BasePackageUploadView

Endpoint allowing for uploading problem packages. Each uploaded problem has to be bound to some round and contest.

serializer_class[source]
static prepare_data(dictionary)[source]
class oioioi.problems.api.PackageReuploadView(**kwargs)[source]

Bases: BasePackageUploadView

Endpoint allowing for reuploading problem packages. Substitutes package file corresponding to specified problem with uploaded package.

serializer_class[source]
static prepare_data(dictionary)[source]