:py:mod:`oioioi.problems.api` ============================= .. py:module:: oioioi.problems.api Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.problems.api.PackageUploadQueryView oioioi.problems.api.BasePackageUploadView oioioi.problems.api.PackageUploadView oioioi.problems.api.PackageReuploadView Functions ~~~~~~~~~ .. autoapisummary:: oioioi.problems.api._check_permissions .. py:function:: _check_permissions(request, contest=None, existing_problem=None) .. py:class:: PackageUploadQueryView(**kwargs) Bases: :py:obj:`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. .. py:attribute:: permission_classes .. py:attribute:: schema .. py:method:: check_permissions(request, contest=None, existing_problem=None) :staticmethod: Check if the request should be permitted. Raises an appropriate exception if the request is not permitted. .. py:method:: get(request, package_id) .. py:class:: BasePackageUploadView(**kwargs) Bases: :py:obj:`rest_framework.views.APIView` Intentionally simple parent class for all views. Only implements dispatch-by-method and simple sanity checking. .. py:attribute:: parser_class .. py:attribute:: permission_classes .. py:attribute:: serializer_class .. py:attribute:: form_class .. py:method:: check_permissions(request, contest=None, existing_problem=None) :staticmethod: Check if the request should be permitted. Raises an appropriate exception if the request is not permitted. .. py:method:: prepare_data(dictionary) :staticmethod: :abstractmethod: .. py:method:: submit_upload_form(form, request, contest) :staticmethod: .. py:method:: post(request, *args, **kwargs) .. py:class:: PackageUploadView(**kwargs) Bases: :py:obj:`BasePackageUploadView` Endpoint allowing for uploading problem packages. Each uploaded problem has to be bound to some round and contest. .. py:attribute:: serializer_class .. py:method:: prepare_data(dictionary) :staticmethod: .. py:class:: PackageReuploadView(**kwargs) Bases: :py:obj:`BasePackageUploadView` Endpoint allowing for reuploading problem packages. Substitutes package file corresponding to specified problem with uploaded package. .. py:attribute:: serializer_class .. py:method:: prepare_data(dictionary) :staticmethod: