oioioi.problems.admin

Module Contents

Classes

StatementConfigInline

Options for inline editing of model instances.

StatementConfigAdminMixin

Adds ProblemStatementConfig to an admin

RankingVisibilityConfigInline

Options for inline editing of model instances.

RankingVisibilityConfigAdminMixin

Adds RankingVisibilityConfig to an admin

RegistrationAvailabilityConfigInline

Options for inline editing of model instances.

RegistrationAvailabilityConfigAdminMixin

Adds OpenRegistrationConfig to an admin

NameInline

Options for inline editing of model instances.

StatementInline

Options for inline editing of model instances.

AttachmentInline

Options for inline editing of model instances.

ProblemInstanceInline

Options for inline editing of model instances.

ProblemSiteInline

Options for inline editing of model instances.

BaseTagLocalizationInline

Options for inline editing of model instances.

BaseTagAdmin

Encapsulate all admin options and functionality for a given model.

OriginTagInline

Options for inline editing of model instances.

OriginTagLocalizationInline

Options for inline editing of model instances.

OriginTagAdmin

Encapsulate all admin options and functionality for a given model.

OriginInfoCategoryLocalizationInline

Options for inline editing of model instances.

OriginInfoCategoryAdmin

Encapsulate all admin options and functionality for a given model.

OriginInfoValueInline

Options for inline editing of model instances.

OriginInfoValueLocalizationInline

Options for inline editing of model instances.

OriginInfoValueAdmin

Encapsulate all admin options and functionality for a given model.

DifficultyTagInline

Options for inline editing of model instances.

DifficultyTagLocalizationInline

Options for inline editing of model instances.

DifficultyTagAdmin

Encapsulate all admin options and functionality for a given model.

AlgorithmTagInline

Options for inline editing of model instances.

AlgorithmTagLocalizationInline

Options for inline editing of model instances.

AlgorithmTagAdmin

Encapsulate all admin options and functionality for a given model.

ProblemAdmin

Encapsulate all admin options and functionality for a given model.

BaseProblemAdmin

Encapsulate all admin options and functionality for a given model.

ProblemPackageAdmin

Encapsulate all admin options and functionality for a given model.

ContestProblemPackage

Represents a file with data necessary for creating a

ContestProblemPackageAdmin

Encapsulate all admin options and functionality for a given model.

MainProblemInstanceAdmin

Encapsulate all admin options and functionality for a given model.

Functions

tag_inline(model, form, verbose_name, verbose_name_plural)

_update_queryset_if_problems(db_field, **kwargs)

pending_packages(request)

pending_contest_packages(request)

Attributes

oioioi.problems.admin.logger[source]
class oioioi.problems.admin.StatementConfigInline(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 = 1[source]
form[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.problems.admin.StatementConfigAdminMixin(*args, **kwargs)[source]

Bases: object

Adds ProblemStatementConfig to an admin panel.

class oioioi.problems.admin.RankingVisibilityConfigInline(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 = 1[source]
form[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.problems.admin.RankingVisibilityConfigAdminMixin(*args, **kwargs)[source]

Bases: object

Adds RankingVisibilityConfig to an admin panel.

class oioioi.problems.admin.RegistrationAvailabilityConfigInline(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 = 1[source]
form[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.problems.admin.RegistrationAvailabilityConfigAdminMixin(*args, **kwargs)[source]

Bases: object

Adds OpenRegistrationConfig to an admin panel.

class oioioi.problems.admin.NameInline(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]
formset[source]
fields = ['name', 'language'][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.problems.admin.StatementInline(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]
can_delete = False[source]
readonly_fields = ['language', 'content_link'][source]
fields[source]
category[source]
short_description[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.problems.admin.AttachmentInline(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 = ['content_link'][source]
category[source]
short_description[source]
class oioioi.problems.admin.ProblemInstanceInline(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]
fields = [][source]
inline_classes = ['collapse open'][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.problems.admin.ProblemSiteInline(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]
form[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.

oioioi.problems.admin.tag_inline(model, form, verbose_name, verbose_name_plural, extra=0, category=_('Tags'), has_permission_func=lambda self, request, obj=None: ...)[source]
oioioi.problems.admin._update_queryset_if_problems(db_field, **kwargs)[source]
class oioioi.problems.admin.BaseTagLocalizationInline(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.

formset[source]
class oioioi.problems.admin.BaseTagAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

filter_horizontal = ['problems'][source]
class oioioi.problems.admin.OriginTagInline(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.

class oioioi.problems.admin.OriginTagLocalizationInline(parent_model, admin_site)[source]

Bases: BaseTagLocalizationInline

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]
class oioioi.problems.admin.OriginTagAdmin(model, admin_site)[source]

Bases: BaseTagAdmin

Encapsulate all admin options and functionality for a given model.

inlines[source]
formfield_for_manytomany(db_field, request, **kwargs)[source]

Get a form Field for a ManyToManyField.

class oioioi.problems.admin.OriginInfoCategoryLocalizationInline(parent_model, admin_site)[source]

Bases: BaseTagLocalizationInline

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]
class oioioi.problems.admin.OriginInfoCategoryAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

inlines[source]
class oioioi.problems.admin.OriginInfoValueInline(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.

class oioioi.problems.admin.OriginInfoValueLocalizationInline(parent_model, admin_site)[source]

Bases: BaseTagLocalizationInline

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]
class oioioi.problems.admin.OriginInfoValueAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

form[source]
inlines[source]
formfield_for_manytomany(db_field, request, **kwargs)[source]

Get a form Field for a ManyToManyField.

class oioioi.problems.admin.DifficultyTagInline(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.

class oioioi.problems.admin.DifficultyTagLocalizationInline(parent_model, admin_site)[source]

Bases: BaseTagLocalizationInline

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]
class oioioi.problems.admin.DifficultyTagAdmin(model, admin_site)[source]

Bases: BaseTagAdmin

Encapsulate all admin options and functionality for a given model.

inlines[source]
formfield_for_manytomany(db_field, request, **kwargs)[source]

Get a form Field for a ManyToManyField.

class oioioi.problems.admin.AlgorithmTagInline(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.

class oioioi.problems.admin.AlgorithmTagLocalizationInline(parent_model, admin_site)[source]

Bases: BaseTagLocalizationInline

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]
class oioioi.problems.admin.AlgorithmTagAdmin(model, admin_site)[source]

Bases: BaseTagAdmin

Encapsulate all admin options and functionality for a given model.

inlines[source]
formfield_for_manytomany(db_field, request, **kwargs)[source]

Get a form Field for a ManyToManyField.

class oioioi.problems.admin.ProblemAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

class Media[source]

Bases: object

js = ['problems/admin-origintag.js'][source]
inlines[source]
readonly_fields = ['author', 'legacy_name', 'short_name', 'controller_name', 'package_backend_name',...[source]
exclude = ['contest'][source]
list_filter = ['short_name'][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.

redirect_to_list(request, problem)[source]
response_change(request, obj)[source]

Determine the HttpResponse for the change_view stage.

add_view(request, form_url='', extra_context=None)[source]
download_view(request, object_id)[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.

delete_view(request, object_id, extra_context=None)[source]
get_readonly_fields(request, obj=None)[source]

Hook for specifying custom readonly fields.

change_view(request, object_id, form_url='', extra_context=None)[source]
class oioioi.problems.admin.BaseProblemAdmin(*args, **kwargs)[source]

Bases: oioioi.base.admin.MixinsAdmin

Encapsulate all admin options and functionality for a given model.

default_model_admin[source]
_mixins_for_instance(request, instance=None)[source]
reupload_view(request, object_id)[source]
download_view(request, object_id)[source]
get_urls()[source]
oioioi.problems.admin.pending_packages(request)[source]
oioioi.problems.admin.pending_contest_packages(request)[source]
class oioioi.problems.admin.ProblemPackageAdmin(*args, **kwargs)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

list_display = ['contest', 'problem_name', 'colored_status', 'created_by', 'creation_date', 'package_info'][source]
list_filter = ['status', 'problem_name', 'contest'][source]
actions = ['delete_selected'][source]
short_description[source]
short_description[source]
admin_order_field = status[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_view_permission(request, obj=None)[source]

Return True if the given request has permission to view the given Django model instance. The default implementation doesn’t examine the obj parameter.

If overridden by the user in subclasses, it should return True if the given request has permission to view the obj model instance. If obj is None, it should return True if the request has permission to view 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.

delete_selected(request, queryset)[source]
colored_status(instance)[source]
package_info(instance)[source]
came_from()[source]
inline_actions(instance, contest)[source]
actions_field(contest)[source]
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.

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.

class oioioi.problems.admin.ContestProblemPackage(*args, **kwargs)[source]

Bases: oioioi.problems.models.ProblemPackage

Represents a file with data necessary for creating a Problem instance.

class Meta[source]

Bases: object

proxy = True[source]
verbose_name[source]
class oioioi.problems.admin.ContestProblemPackageAdmin(*args, **kwargs)[source]

Bases: ProblemPackageAdmin

Encapsulate all admin options and functionality for a given model.

list_display[source]
list_filter[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.

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.

came_from()[source]
get_actions(request)[source]

Return a dictionary mapping the names of all actions for this ModelAdmin to a tuple of (callable, name, description) for each action.

class oioioi.problems.admin.MainProblemInstanceAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

fields = ['problem', 'short_name'][source]
readonly_fields = ['problem'][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.

response_change(request, obj)[source]

Determine the HttpResponse for the change_view stage.