oioioi.zeus.admin

Module Contents

Classes

ZeusProblemDataInline

Options for inline editing of model instances.

ZeusProblemAdminMixin

Adds ZeusProblemData to an admin panel.

class oioioi.zeus.admin.ZeusProblemDataInline(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]
can_delete = False[source]
extra = 0[source]
max_num = 0[source]
readonly_fields = ['zeus_instance', 'zeus_problem_id'][source]
fields[source]
inline_classes = ['collapse'][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.

zeus_instance(instance)[source]
class oioioi.zeus.admin.ZeusProblemAdminMixin(*args, **kwargs)[source]

Bases: object

Adds ZeusProblemData to an admin panel.