:py:mod:`oioioi.mailsubmit.admin` ================================= .. py:module:: oioioi.mailsubmit.admin Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.mailsubmit.admin.MailSubmissionConfigInline oioioi.mailsubmit.admin.MailSubmissionConfigAdminMixin oioioi.mailsubmit.admin.MailSubmissionAdmin .. py:class:: MailSubmissionConfigInline(parent_model, admin_site) Bases: :py:obj:`oioioi.base.admin.TabularInline` Options for inline editing of ``model`` instances. Provide ``fk_name`` to specify the attribute name of the ``ForeignKey`` from ``model`` to its parent. This is required if ``model`` has more than one ``ForeignKey`` to its parent. .. py:attribute:: model .. py:attribute:: category .. py:method:: has_add_permission(request, obj=None) Return True if the given request has permission to add an object. Can be overridden by the user in subclasses. .. 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:: 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:class:: MailSubmissionConfigAdminMixin(*args, **kwargs) Bases: :py:obj:`object` Adds :class:`~oioioi.mailsubmit.models.MailSubmissionConfig` to an admin panel. .. py:class:: MailSubmissionAdmin(model, admin_site) Bases: :py:obj:`oioioi.base.admin.ModelAdmin` Encapsulate all admin options and functionality for a given model. .. py:attribute:: list_display :annotation: = ['id', 'user_login', 'user_full_name', 'date', 'problem_instance', 'related_submission', 'accepted_by'] .. py:attribute:: list_display_links .. py:attribute:: list_filter .. py:attribute:: date_hierarchy :annotation: = date .. py:attribute:: actions :annotation: = ['accept_action'] .. py:attribute:: search_fields :annotation: = ['user__username', 'user__last_name'] .. py:attribute:: short_description .. py:attribute:: admin_order_field :annotation: = user__username .. py:attribute:: short_description .. py:attribute:: admin_order_field :annotation: = user__last_name .. py:attribute:: short_description .. py:attribute:: short_description .. 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: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:: 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:: 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:: user_login(instance) .. py:method:: user_full_name(instance) .. py:method:: related_submission(instance) .. py:method:: accept_action(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:: changelist_view(request, extra_context=None) The 'change list' admin view for this model.