oioioi.quizzes.admin

Module Contents

Classes

QuizAnswerFormset

The nested InlineFormSet for the common case (ForeignKey inlines)

QuizPictureInline

Options for inline editing of model instances.

QuizQuestionPictureInline

Options for inline editing of model instances.

QuizAnswerPictureInline

Options for inline editing of model instances.

QuizAnswerInline

Options for inline editing of model instances.

QuizQuestionInline

Options for inline editing of model instances.

QuizModelAdmin

Encapsulate all admin options and functionality for a given model.

QuizInline

Options for inline editing of model instances.

QuizAdminMixin

Adds Quiz to an admin panel.

class oioioi.quizzes.admin.QuizAnswerFormset(*args, **kwargs)[source]

Bases: nested_admin.formsets.NestedInlineFormSet

The nested InlineFormSet for the common case (ForeignKey inlines)

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.quizzes.admin.QuizPictureInline(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedStackedInline

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.

extra = 0[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.quizzes.admin.QuizQuestionPictureInline(*args, **kwargs)[source]

Bases: QuizPictureInline

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.quizzes.admin.QuizAnswerPictureInline(*args, **kwargs)[source]

Bases: QuizPictureInline

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.quizzes.admin.QuizAnswerInline(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedTabularInline

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]
formset[source]
sortable_field_name = order[source]
extra = 0[source]
inlines[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.quizzes.admin.QuizQuestionInline(*args, **kwargs)[source]

Bases: nested_admin.nested.NestedStackedInline

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]
sortable_field_name = order[source]
extra = 0[source]
inlines[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.quizzes.admin.QuizModelAdmin(parent_model, admin_site)[source]

Bases: nested_admin.nested.NestedModelAdmin

Encapsulate all admin options and functionality for a given model.

class Media[source]

Bases: object

css[source]
model[source]
inlines[source]
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_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.

class oioioi.quizzes.admin.QuizInline(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]
fields = [][source]
readonly_fields = ['edit'][source]
category[source]
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_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.

edit(instance)[source]
class oioioi.quizzes.admin.QuizAdminMixin(*args, **kwargs)[source]

Bases: object

Adds Quiz to an admin panel.