:py:mod:`oioioi.contestexcl.admin` ================================== .. py:module:: oioioi.contestexcl.admin Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.contestexcl.admin.ExclusivenessConfigInline oioioi.contestexcl.admin.ContestAdminWithExclusivenessInlineMixin .. py:class:: ExclusivenessConfigInline(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:: extra :annotation: = 0 .. py:attribute:: form .. py:attribute:: fields :annotation: = ['enabled', 'start_date', 'end_date', 'disable'] .. py:attribute:: category .. py:method:: get_fields(request, obj=None) Hook for specifying fields. .. py:method:: get_readonly_fields(request, obj=None) Hook for specifying custom readonly fields. .. 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:: ContestAdminWithExclusivenessInlineMixin(*args, **kwargs) Bases: :py:obj:`object` Adds :class:`~oioioi.contestexcl.models.ExclusivenessConfig` to an admin panel. .. py:method:: _warn_on_contestexcl_overlap(request, ex_confs) .. py:method:: _warn_on_not_exclusive_rounds(request, ex_confs) .. py:method:: save_formset(request, form, formset, change)