:py:mod:`oioioi.pa.admin` ========================= .. py:module:: oioioi.pa.admin Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.pa.admin.PARegistrationInline oioioi.pa.admin.PARegistrationParticipantAdmin oioioi.pa.admin.PAProblemInstanceInline oioioi.pa.admin.PAProblemInstanceAdminMixin .. py:class:: PARegistrationInline(parent_model, admin_site) Bases: :py:obj:`oioioi.base.admin.StackedInline` 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:: fk_name :annotation: = participant .. py:attribute:: form .. py:attribute:: can_delete :annotation: = False .. py:attribute:: inline_classes :annotation: = ['collapse open'] .. py:attribute:: exclude :annotation: = ['terms_accepted'] .. py:class:: PARegistrationParticipantAdmin(model, admin_site) Bases: :py:obj:`oioioi.participants.admin.ParticipantAdmin` Encapsulate all admin options and functionality for a given model. .. py:attribute:: list_display .. py:attribute:: inlines .. py:attribute:: readonly_fields :annotation: = ['user'] .. 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_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_actions(request) Return a dictionary mapping the names of all actions for this ModelAdmin to a tuple of (callable, name, description) for each action. .. py:class:: PAProblemInstanceInline(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:: fields :annotation: = ['division'] .. 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_readonly_fields(request, obj=None) Hook for specifying custom readonly fields. .. py:class:: PAProblemInstanceAdminMixin(*args, **kwargs) Bases: :py:obj:`object` Adds :class:`~oioioi.pa.models.PAProblemInstanceData` to an admin panel.