oioioi.questions.admin

Module Contents

Classes

MessageAdmin

Encapsulate all admin options and functionality for a given model.

MessageNotifierConfigInline

Options for inline editing of model instances.

MessageNotifierContestAdminMixin

Adds MessageNotifierConfig to an admin

ReplyTemplateAdmin

Encapsulate all admin options and functionality for a given model.

class oioioi.questions.admin.MessageAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

list_display = ['id', 'date', 'topic', 'author'][source]
fields = ['date', 'author', 'contest', 'round', 'problem_instance', 'kind', 'topic', 'content'][source]
readonly_fields = ['date', 'author', 'contest', 'round', 'problem_instance'][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.

add_view(request, form_url='', extra_context=None)[source]

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.

change_view(request, object_id, form_url='', extra_context=None)[source]
response_delete(request)[source]

Determine the HttpResponse for the delete_view stage.

class oioioi.questions.admin.MessageNotifierConfigInline(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]
extra = 0[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.

formfield_for_foreignkey(db_field, request, **kwargs)[source]

Get a form Field for a ForeignKey.

class oioioi.questions.admin.MessageNotifierContestAdminMixin(*args, **kwargs)[source]

Bases: object

Adds MessageNotifierConfig to an admin panel.

class oioioi.questions.admin.ReplyTemplateAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

get_list_display(request)[source]

Return a sequence containing the fields to be displayed on the changelist.

get_list_filter(request)[source]

Return a sequence containing the fields to be displayed as filters in the right sidebar of the changelist page.

get_readonly_fields(request, obj=None)[source]

Hook for specifying custom readonly fields.

get_form(request, obj=None, **kwargs)[source]

Return a Form class for use in the admin add view. This is used by add_view and change_view.

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.