oioioi.similarsubmits.admin

Module Contents

Classes

SubmissionsSimilarityEntryAdmin

Encapsulate all admin options and functionality for a given model.

SubmisionsSimilarityEntryInline

Options for inline editing of model instances.

SubmissionsSimilarityGroupAdmin

Encapsulate all admin options and functionality for a given model.

class oioioi.similarsubmits.admin.SubmissionsSimilarityEntryAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

list_display = ['id', 'group_link', 'submission_link', 'submission_user_full_name',...[source]
list_filter = ['guilty'][source]
search_fields = ['submission__user__username', 'submission__user__last_name'][source]
raw_id_fields = ['submission', 'group'][source]
short_description[source]
short_description[source]
short_description[source]
admin_order_field = submission__user__last_name[source]
short_description[source]
admin_order_field = submission__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_readonly_fields(request, obj=None)[source]

Hook for specifying custom readonly fields.

add_view(request, form_url='', extra_context=None)[source]
formfield_for_foreignkey(db_field, request, **kwargs)[source]

Get a form Field for a ForeignKey.

submission_user_full_name(instance)[source]
submission_problem_instance(instance)[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.

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.

class oioioi.similarsubmits.admin.SubmisionsSimilarityEntryInline(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]
raw_id_fields = ['submission'][source]
formfield_for_foreignkey(db_field, request, **kwargs)[source]

Get a form Field for a ForeignKey.

class oioioi.similarsubmits.admin.SubmissionsSimilarityGroupAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

list_display = ['id'][source]
inlines[source]
exclude = ['contest'][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.

save_model(request, obj, form, change)[source]

Given a model instance save it to the database.

_interrupt_redirection(request)[source]
response_add(request, obj, post_url_continue=None)[source]

Determine the HttpResponse for the add_view stage.

response_change(request, obj)[source]

Determine the HttpResponse for the change_view stage.

response_delete(request)[source]

Determine the HttpResponse for the delete_view stage.

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.