:py:mod:`oioioi.teams.admin` ============================ .. py:module:: oioioi.teams.admin Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.teams.admin.MembersInline oioioi.teams.admin.TeamsAdmin oioioi.teams.admin.TeamsConfigInline oioioi.teams.admin.TeamsAdminMixin .. py:class:: MembersInline(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: = ['user'] .. py:class:: TeamsAdmin(model, admin_site) Bases: :py:obj:`oioioi.base.admin.ModelAdmin` Encapsulate all admin options and functionality for a given model. .. py:attribute:: list_select_related :annotation: = True .. py:attribute:: list_display :annotation: = ['name', 'join_key'] .. py:attribute:: fields :annotation: = ['name', 'login'] .. py:attribute:: search_fields :annotation: = ['name'] .. py:attribute:: inlines .. py:attribute:: form .. 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:: 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:: save_form(request, *args, **kwargs) Given a ModelForm return an unsaved instance. ``change`` is True if the object is being changed, and False if it's being added. .. py:class:: TeamsConfigInline(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:: TeamsAdminMixin(*args, **kwargs) Bases: :py:obj:`object` Adds :class:`~oioioi.teams.models.TeamsConfig` to an admin panel.