:py:mod:`oioioi.evalmgr.admin` ============================== .. py:module:: oioioi.evalmgr.admin Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.evalmgr.admin.UserListFilter oioioi.evalmgr.admin.EvalMgrProblemNameListFilter oioioi.evalmgr.admin.SystemJobsQueueAdmin oioioi.evalmgr.admin.ContestQueuedJob oioioi.evalmgr.admin.ContestJobsQueueAdmin Functions ~~~~~~~~~ .. autoapisummary:: oioioi.evalmgr.admin._require_submission oioioi.evalmgr.admin._require_problem_instance oioioi.evalmgr.admin._require_contest .. py:class:: UserListFilter(request, params, model, model_admin) Bases: :py:obj:`django.contrib.admin.SimpleListFilter` .. py:attribute:: title .. py:attribute:: parameter_name :annotation: = user .. py:method:: lookups(request, model_admin) Must be overridden to return a list of tuples (value, verbose value) .. py:method:: queryset(request, queryset) Return the filtered queryset. .. py:class:: EvalMgrProblemNameListFilter(request, params, model, model_admin) Bases: :py:obj:`oioioi.base.utils.filters.ProblemNameListFilter` .. py:attribute:: initial_query_manager .. py:attribute:: contest_field .. py:attribute:: related_names :annotation: = submission__problem_instance__problem__names .. py:attribute:: legacy_name_field .. py:attribute:: outer_ref .. py:function:: _require_submission(function) .. py:function:: _require_problem_instance(function) .. py:function:: _require_contest(function) .. py:class:: SystemJobsQueueAdmin(*args, **kwargs) Bases: :py:obj:`oioioi.base.admin.ModelAdmin` Encapsulate all admin options and functionality for a given model. .. py:attribute:: list_display :annotation: = ['submit_id', 'colored_state', 'contest', 'problem_instance', 'user', 'creation_date', 'celery_task_id'] .. py:attribute:: list_filter .. py:attribute:: actions :annotation: = ['remove_from_queue', 'delete_selected'] .. py:attribute:: admin_order_field :annotation: = submission__id .. py:attribute:: short_description .. py:attribute:: admin_order_field :annotation: = submission__problem_instance .. py:attribute:: short_description .. py:attribute:: admin_order_field :annotation: = submission__problem_instance__contest .. py:attribute:: short_description .. py:attribute:: admin_order_field :annotation: = submission__user .. py:attribute:: short_description .. py:attribute:: short_description .. py:attribute:: admin_order_field :annotation: = state .. py:attribute:: short_description .. py:method:: _get_link(caption, app, *args, **kwargs) .. py:method:: _get_contest_id(instance) .. py:method:: has_add_permission(request) Return True if the given request has permission to add an object. Can be overridden by the user in subclasses. .. py:method:: submit_id(instance) .. py:method:: problem_instance(instance) .. py:method:: contest(instance) .. py:method:: user(instance) .. py:method:: colored_state(instance) .. py:method:: remove_from_queue(request, queryset) .. py:method:: get_queryset(request) Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view. .. py:method:: has_delete_permission(request, obj=None) Return True if the given request has permission to delete the given Django model instance, the default implementation doesn't examine the `obj` parameter. Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to delete the `obj` model instance. If `obj` is None, this should return True if the given request has permission to delete *any* object of the given type. .. py:method:: get_custom_list_select_related() Returns a list of fields passed to queryset.select_related By default - empty list. Override this method (instead of get_queryset()) to pass another field to the select_related. .. py:class:: ContestQueuedJob(*args, **kwargs) Bases: :py:obj:`oioioi.evalmgr.models.QueuedJob` Make subclasses preserve the alters_data attribute on overridden methods. .. py:class:: Meta Bases: :py:obj:`object` .. py:attribute:: proxy :annotation: = True .. py:attribute:: verbose_name .. py:class:: ContestJobsQueueAdmin(*args, **kwargs) Bases: :py:obj:`SystemJobsQueueAdmin` Encapsulate all admin options and functionality for a given model. .. py:method:: has_change_permission(request, obj=None) Return True if the given request has permission to change the given Django model instance, the default implementation doesn't examine the `obj` parameter. Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to change the `obj` model instance. If `obj` is None, this should return True if the given request has permission to change *any* object of the given type. .. py:method:: get_queryset(request) Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.