oioioi.participants.admin

Module Contents

Classes

ParticipantAdmin

Encapsulate all admin options and functionality for a given model.

NoParticipantAdmin

Encapsulate all admin options and functionality for a given model.

ContestDependentParticipantAdmin

Encapsulate all admin options and functionality for a given model.

ParticipantInline

Options for inline editing of model instances.

RegionAdmin

Encapsulate all admin options and functionality for a given model.

OnsiteRegistrationInline

Options for inline editing of model instances.

RegionFilter

OnsiteRegistrationParticipantAdmin

Encapsulate all admin options and functionality for a given model.

RegionListFilter

OnsiteSubmissionAdminMixin

Adds RegionListFilter filter to

UserWithParticipantsAdminMixin

Adds Participant to an admin panel.

ParticipantsRoundTimeExtensionMixin

Adds contest participants to an admin panel.

TermsAcceptedPhraseInline

Options for inline editing of model instances.

TermsAcceptedPhraseAdminMixin

Adds TermsAcceptedPhrase to an admin

class oioioi.participants.admin.ParticipantAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

list_display = ['user_login', 'user_full_name', 'status'][source]
list_filter = ['status'][source]
fields = [['user', 'status']][source]
search_fields = ['user__username', 'user__last_name'][source]
actions = ['make_active', 'make_banned', 'delete_selected', 'extend_round'][source]
form[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]
short_description[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.

user_login(instance)[source]
user_full_name(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_list_display(request)[source]

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

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_model(request, obj, form, change)[source]

Given a model instance save it to the database.

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.

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

Get a form Field for a ForeignKey.

make_active(request, queryset)[source]
make_banned(request, queryset)[source]
extend_round(request, queryset)[source]
class oioioi.participants.admin.NoParticipantAdmin(model, admin_site)[source]

Bases: ParticipantAdmin

Encapsulate all admin options and functionality for a given model.

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.

class oioioi.participants.admin.ContestDependentParticipantAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.InstanceDependentAdmin

Encapsulate all admin options and functionality for a given model.

default_participant_admin[source]
_find_model_admin(request, object_id)[source]
abstract _model_admin_for_instance(request, instance=None)[source]
class oioioi.participants.admin.ParticipantInline(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]
readonly_fields = ['contest', 'status'][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.participants.admin.RegionAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

list_display = ['short_name', 'name', 'region_server'][source]
fields = ['short_name', 'name', 'region_server'][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_model(request, obj, form, change)[source]

Given a model instance save it to the database.

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.

class oioioi.participants.admin.OnsiteRegistrationInline(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]
fk_name = participant[source]
can_delete = False[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.

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

Get a form Field for a ForeignKey.

class oioioi.participants.admin.RegionFilter(field, request, *args, **kwargs)[source]

Bases: django.contrib.admin.RelatedFieldListFilter

class oioioi.participants.admin.OnsiteRegistrationParticipantAdmin(model, admin_site)[source]

Bases: ParticipantAdmin

Encapsulate all admin options and functionality for a given model.

list_display[source]
inlines[source]
list_filter[source]
ordering = ['participants_onsiteregistration__number'][source]
search_fields[source]
admin_order_field = participants_onsiteregistration__number[source]
admin_order_field = participants_onsiteregistration__region[source]
admin_order_field = participants_onsiteregistration__local_number[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.

number(instance)[source]
region(instance)[source]
local_number(instance)[source]
class oioioi.participants.admin.RegionListFilter(request, params, model, model_admin)[source]

Bases: django.contrib.admin.SimpleListFilter

title[source]
parameter_name = region[source]
lookups(request, model_admin)[source]

Must be overridden to return a list of tuples (value, verbose value)

queryset(request, queryset)[source]

Return the filtered queryset.

class oioioi.participants.admin.OnsiteSubmissionAdminMixin(*args, **kwargs)[source]

Bases: object

Adds RegionListFilter filter to an admin panel.

get_list_filter(request)[source]
class oioioi.participants.admin.UserWithParticipantsAdminMixin(*args, **kwargs)[source]

Bases: object

Adds Participant to an admin panel.

class oioioi.participants.admin.ParticipantsRoundTimeExtensionMixin[source]

Bases: object

Adds contest participants to an admin panel.

formfield_for_foreignkey(db_field, request, **kwargs)[source]
class oioioi.participants.admin.TermsAcceptedPhraseInline(parent_model, admin_site)[source]

Bases: oioioi.base.admin.StackedInline

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]
can_delete = False[source]
form[source]
max_num = 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.

get_readonly_fields(request, obj=None)[source]

Hook for specifying custom readonly fields.

class oioioi.participants.admin.TermsAcceptedPhraseAdminMixin(*args, **kwargs)[source]

Bases: object

Adds TermsAcceptedPhrase to an admin panel.