oioioi.teachers.admin

Module Contents

Classes

TeacherAdmin

Encapsulate all admin options and functionality for a given model.

ContestAdminMixin

Adjusts contest admin panel for teachers app usage. Superusers continue

class oioioi.teachers.admin.TeacherAdmin(model, admin_site)[source]

Bases: oioioi.base.admin.ModelAdmin

Encapsulate all admin options and functionality for a given model.

list_display = ['teacher_login', 'teacher_email', 'teacher_first_name', 'teacher_last_name', 'school',...[source]
list_editable = ['is_active'][source]
search_fields = ['school', 'user__username', 'user__first_name', 'user__last_name', 'user__email', 'join_date'][source]
form[source]
short_description[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.

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

Get a form Field for a ForeignKey.

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.

teacher_first_name(instance)[source]
teacher_last_name(instance)[source]
teacher_email(instance)[source]
teacher_login(instance)[source]
class oioioi.teachers.admin.ContestAdminMixin(*args, **kwargs)[source]

Bases: object

Adjusts contest admin panel for teachers app usage. Superusers continue to work as usual but teachers have special options.

has_add_permission(request)[source]
save_model(request, obj, form, change)[source]
get_fieldsets(request, obj=None)[source]
get_form(request, obj=None, **kwargs)[source]
response_add(request, obj, post_url_continue=None)[source]