oioioi.mailsubmit.admin

Module Contents

Classes

MailSubmissionConfigInline

Options for inline editing of model instances.

MailSubmissionConfigAdminMixin

Adds MailSubmissionConfig to an admin

MailSubmissionAdmin

Encapsulate all admin options and functionality for a given model.

class oioioi.mailsubmit.admin.MailSubmissionConfigInline(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.mailsubmit.admin.MailSubmissionConfigAdminMixin(*args, **kwargs)[source]

Bases: object

Adds MailSubmissionConfig to an admin panel.

class oioioi.mailsubmit.admin.MailSubmissionAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

list_display = ['id', 'user_login', 'user_full_name', 'date', 'problem_instance', 'related_submission', 'accepted_by'][source]
list_filter[source]
date_hierarchy = date[source]
actions = ['accept_action'][source]
search_fields = ['user__username', 'user__last_name'][source]
short_description[source]
admin_order_field = user__username[source]
short_description[source]
admin_order_field = user__last_name[source]
short_description[source]
short_description[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.

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.

user_login(instance)[source]
user_full_name(instance)[source]
related_submission(instance)[source]
accept_action(request, queryset)[source]
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.

changelist_view(request, extra_context=None)[source]

The ‘change list’ admin view for this model.