:py:mod:`oioioi.teachers.admin` =============================== .. py:module:: oioioi.teachers.admin Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.teachers.admin.TeacherAdmin oioioi.teachers.admin.ContestAdminMixin .. py:class:: TeacherAdmin(model, admin_site) Bases: :py:obj:`oioioi.base.admin.ModelAdmin` Encapsulate all admin options and functionality for a given model. .. py:attribute:: list_display :annotation: = ['teacher_login', 'teacher_email', 'teacher_first_name', 'teacher_last_name', 'school',... .. py:attribute:: list_editable :annotation: = ['is_active'] .. py:attribute:: search_fields :annotation: = ['school', 'user__username', 'user__first_name', 'user__last_name', 'user__email', 'join_date'] .. py:attribute:: form .. py:attribute:: short_description .. py:attribute:: short_description .. py:attribute:: short_description .. py:attribute:: short_description .. py:method:: has_add_permission(request) Return True if the given request has permission to add an object. Can be overridden by the user in subclasses. .. py:method:: has_change_permission(request, obj=None) 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. .. py:method:: has_delete_permission(request, obj=None) 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. .. py:method:: formfield_for_foreignkey(db_field, request, **kwargs) Get a form Field for a ForeignKey. .. py:method:: get_custom_list_select_related() 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. .. py:method:: teacher_first_name(instance) .. py:method:: teacher_last_name(instance) .. py:method:: teacher_email(instance) .. py:method:: teacher_login(instance) .. py:class:: ContestAdminMixin(*args, **kwargs) Bases: :py:obj:`object` Adjusts contest admin panel for teachers app usage. Superusers continue to work as usual but teachers have special options. .. py:method:: has_add_permission(request) .. py:method:: save_model(request, obj, form, change) .. py:method:: get_fieldsets(request, obj=None) .. py:method:: get_form(request, obj=None, **kwargs) .. py:method:: response_add(request, obj, post_url_continue=None)