oioioi.teams.admin

Module Contents

Classes

MembersInline

Options for inline editing of model instances.

TeamsAdmin

Encapsulate all admin options and functionality for a given model.

TeamsConfigInline

Options for inline editing of model instances.

TeamsAdminMixin

Adds TeamsConfig to an admin panel.

class oioioi.teams.admin.MembersInline(parent_model, admin_site)[source]

Bases: 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.

model[source]
fields = ['user'][source]
class oioioi.teams.admin.TeamsAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

list_display = ['name', 'join_key'][source]
fields = ['name', 'login'][source]
search_fields = ['name'][source]
inlines[source]
form[source]
has_add_permission(request)[source]

Return True if the given request has permission to add an object. Can be overridden by the user in subclasses.

has_change_permission(request, obj=None)[source]

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.

has_delete_permission(request, obj=None)[source]

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.

get_queryset(request)[source]

Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.

save_form(request, *args, **kwargs)[source]

Given a ModelForm return an unsaved instance. change is True if the object is being changed, and False if it’s being added.

class oioioi.teams.admin.TeamsConfigInline(parent_model, admin_site)[source]

Bases: 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.

model[source]
category[source]
has_add_permission(request, obj=None)[source]

Return True if the given request has permission to add an object. Can be overridden by the user in subclasses.

has_change_permission(request, obj=None)[source]

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.

has_delete_permission(request, obj=None)[source]

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.

class oioioi.teams.admin.TeamsAdminMixin(*args, **kwargs)[source]

Bases: object

Adds TeamsConfig to an admin panel.