:py:mod:`oioioi.similarsubmits.admin` ===================================== .. py:module:: oioioi.similarsubmits.admin Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: oioioi.similarsubmits.admin.SubmissionsSimilarityEntryAdmin oioioi.similarsubmits.admin.SubmisionsSimilarityEntryInline oioioi.similarsubmits.admin.SubmissionsSimilarityGroupAdmin .. py:class:: SubmissionsSimilarityEntryAdmin(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: = ['id', 'group_link', 'submission_link', 'submission_user_full_name',... .. py:attribute:: list_display_links :annotation: = ['id', 'guilty'] .. py:attribute:: list_filter :annotation: = ['guilty'] .. py:attribute:: search_fields :annotation: = ['submission__user__username', 'submission__user__last_name'] .. py:attribute:: raw_id_fields :annotation: = ['submission', 'group'] .. py:attribute:: short_description .. py:attribute:: short_description .. py:attribute:: short_description .. py:attribute:: admin_order_field :annotation: = submission__user__last_name .. py:attribute:: short_description .. py:attribute:: admin_order_field :annotation: = submission__problem_instance .. 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:: get_readonly_fields(request, obj=None) Hook for specifying custom readonly fields. .. py:method:: add_view(request, form_url='', extra_context=None) .. py:method:: formfield_for_foreignkey(db_field, request, **kwargs) Get a form Field for a ForeignKey. .. py:method:: group_link(instance) .. py:method:: submission_link(instance) .. py:method:: submission_user_full_name(instance) .. py:method:: submission_problem_instance(instance) .. 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:: get_queryset(request) Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view. .. py:class:: SubmisionsSimilarityEntryInline(parent_model, admin_site) Bases: :py:obj:`oioioi.base.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. .. py:attribute:: model .. py:attribute:: extra :annotation: = 0 .. py:attribute:: raw_id_fields :annotation: = ['submission'] .. py:method:: formfield_for_foreignkey(db_field, request, **kwargs) Get a form Field for a ForeignKey. .. py:class:: SubmissionsSimilarityGroupAdmin(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: = ['id'] .. py:attribute:: inlines .. py:attribute:: exclude :annotation: = ['contest'] .. 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:: save_model(request, obj, form, change) Given a model instance save it to the database. .. py:method:: _interrupt_redirection(request) .. py:method:: response_add(request, obj, post_url_continue=None) Determine the HttpResponse for the add_view stage. .. py:method:: response_change(request, obj) Determine the HttpResponse for the change_view stage. .. py:method:: response_delete(request) Determine the HttpResponse for the delete_view stage. .. py:method:: get_queryset(request) Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.