oioioi.programs.admin

Module Contents

Classes

ProgramsConfigInline

Options for inline editing of model instances.

ValidationFormset

A formset for child objects related to a parent.

TestInline

Options for inline editing of model instances.

ReportActionsConfigInline

Options for inline editing of model instances.

OutputCheckerInline

Options for inline editing of model instances.

LibraryProblemDataInline

Options for inline editing of model instances.

ProblemCompilerInline

Options for inline editing of model instances.

ProblemAllowedLanguageInline

Options for inline editing of model instances.

ContestCompilerInline

Options for inline editing of model instances.

ProgramsContestAdminMixin

Adds ProgramsConfig

LibraryProblemDataAdminMixin

Adds LibraryProblemData to an admin

ProgrammingProblemAdminMixin

Adds ReportActionsConfig,

ProgrammingProblemInstanceAdminMixin

Adds Test to an admin panel.

ProgrammingMainProblemInstanceAdminMixin

Adds Test to an admin panel.

ProblemPackageAdminMixin

Adds model solutions action to an admin panel.

ModelSubmissionAdminMixin

Adds model submission to an admin panel.

ProgramSubmissionAdminMixin

Adds submission diff action, language display and language filter to

LanguageListFilter

class oioioi.programs.admin.ProgramsConfigInline(parent_model, admin_site)[source]

Bases: django.contrib.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]
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.

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.

class oioioi.programs.admin.ValidationFormset(data=None, files=None, instance=None, save_as_new=False, prefix=None, queryset=None, **kwargs)[source]

Bases: django.forms.models.BaseInlineFormSet

A formset for child objects related to a parent.

get_time_limit_sum()[source]
validate_max_scores_in_group()[source]
validate_time_limit_sum()[source]
clean()[source]

Hook for doing any extra formset-wide cleaning after Form.clean() has been called on every form. Any ValidationError raised by this method will not be associated with a particular form; it will be accessible via formset.non_form_errors()

class oioioi.programs.admin.TestInline(parent_model, admin_site)[source]

Bases: django.contrib.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]
max_num = 0[source]
extra = 0[source]
template = programs/admin/tests_inline.html[source]
can_delete = False[source]
fields = ['name', 'time_limit', 'memory_limit', 'max_score', 'kind', 'input_file_link',...[source]
readonly_fields = ['name', 'kind', 'group', 'input_file_link', 'output_file_link'][source]
ordering = ['kind', 'order', 'name'][source]
formset[source]
short_description[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.

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.

class oioioi.programs.admin.ReportActionsConfigInline(parent_model, admin_site)[source]

Bases: django.contrib.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]
extra = 0[source]
inline_classes = ['collapse open'][source]
fields = ['can_user_generate_outs'][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.

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.

class oioioi.programs.admin.OutputCheckerInline(parent_model, admin_site)[source]

Bases: django.contrib.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]
fields = ['checker_link'][source]
readonly_fields = ['checker_link'][source]
can_delete = False[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.

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.

class oioioi.programs.admin.LibraryProblemDataInline(parent_model, admin_site)[source]

Bases: django.contrib.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]
fields = ['libname'][source]
readonly_fields = ['libname'][source]
can_delete = False[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.

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.

class oioioi.programs.admin.ProblemCompilerInline(parent_model, admin_site)[source]

Bases: django.contrib.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]
extra = 0[source]
form[source]
category[source]
class oioioi.programs.admin.ProblemAllowedLanguageInline(parent_model, admin_site)[source]

Bases: django.contrib.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]
extra = 0[source]
form[source]
category[source]
class oioioi.programs.admin.ContestCompilerInline(*args, **kwargs)[source]

Bases: django.contrib.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]
extra = 0[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.

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.

class oioioi.programs.admin.ProgramsContestAdminMixin(*args, **kwargs)[source]

Bases: object

Adds ProgramsConfig and ContestCompiler to an admin panel.

class oioioi.programs.admin.LibraryProblemDataAdminMixin(*args, **kwargs)[source]

Bases: object

Adds LibraryProblemData to an admin panel.

class oioioi.programs.admin.ProgrammingProblemAdminMixin(*args, **kwargs)[source]

Bases: object

Adds ReportActionsConfig, OutputChecker, LibraryProblemData and ProblemAllowedLanguage and ProblemCompiler to an admin panel.

class oioioi.programs.admin.ProgrammingProblemInstanceAdminMixin(*args, **kwargs)[source]

Bases: object

Adds Test to an admin panel.

class oioioi.programs.admin.ProgrammingMainProblemInstanceAdminMixin(*args, **kwargs)[source]

Bases: object

Adds Test to an admin panel.

class oioioi.programs.admin.ProblemPackageAdminMixin[source]

Bases: object

Adds model solutions action to an admin panel.

inline_actions(package_instance, contest)[source]
class oioioi.programs.admin.ModelSubmissionAdminMixin[source]

Bases: object

Adds model submission to an admin panel.

short_description[source]
admin_order_field[source]
user_full_name(instance)[source]
class oioioi.programs.admin.ProgramSubmissionAdminMixin(*args, **kwargs)[source]

Bases: object

Adds submission diff action, language display and language filter to an admin panel.

short_description[source]
short_description[source]
get_list_display(request)[source]
get_list_filter(request)[source]
language_display(instance)[source]
submission_diff_action(request, queryset)[source]
class oioioi.programs.admin.LanguageListFilter(request, params, model, model_admin)[source]

Bases: django.contrib.admin.SimpleListFilter

title[source]
parameter_name = lang[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.