oioioi.contests.admin
¶
Module Contents¶
Classes¶
An AdminSite object encapsulates an instance of the Django admin application, ready |
|
Options for inline editing of |
|
Options for inline editing of |
|
Options for inline editing of |
|
Encapsulate all admin options and functionality for a given model. |
|
Encapsulate all admin options and functionality for a given model. |
|
Encapsulate all admin options and functionality for a given model. |
|
Encapsulate all admin options and functionality for a given model. |
|
Encapsulate all admin options and functionality for a given model. |
|
The main implementation of all the Form logic. Note that this class is |
|
Encapsulate all admin options and functionality for a given model. |
Attributes¶
- class oioioi.contests.admin.ContestProxyAdminSite(orig)[source]¶
Bases:
oioioi.base.admin.AdminSite
An AdminSite object encapsulates an instance of the Django admin application, ready to be hooked in to your URLconf. Models are registered with the AdminSite using the register() method, and the get_urls() method can then be used to access Django view functions that present a full admin interface for the collection of registered models.
- register(model_or_iterable, admin_class=None, **options)[source]¶
Register the given model(s) with the given admin class.
The model(s) should be Model classes, not instances.
If an admin class isn’t given, use ModelAdmin (the default admin options). If keyword arguments are given – e.g., list_display – apply them as options to the admin class.
If a model is already registered, raise AlreadyRegistered.
If a model is abstract, raise ImproperlyConfigured.
- unregister(model_or_iterable)[source]¶
Unregister the given model(s).
If a model isn’t already registered, raise NotRegistered.
- oioioi.contests.admin.contest_site¶
- class oioioi.contests.admin.RoundInline(parent_model, admin_site)[source]¶
Bases:
oioioi.base.admin.StackedInline
Options for inline editing of
model
instances.Provide
fk_name
to specify the attribute name of theForeignKey
frommodel
to its parent. This is required ifmodel
has more than oneForeignKey
to its parent.- model¶
- extra = 0¶
- inline_classes = ('collapse open',)¶
- category¶
- 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.contests.admin.AttachmentInline(parent_model, admin_site)[source]¶
Bases:
oioioi.base.admin.StackedInline
Options for inline editing of
model
instances.Provide
fk_name
to specify the attribute name of theForeignKey
frommodel
to its parent. This is required ifmodel
has more than oneForeignKey
to its parent.- model¶
- extra = 0¶
- readonly_fields = ['content_link']¶
- category¶
- 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.contests.admin.ContestLinkInline(parent_model, admin_site)[source]¶
Bases:
oioioi.base.admin.TabularInline
Options for inline editing of
model
instances.Provide
fk_name
to specify the attribute name of theForeignKey
frommodel
to its parent. This is required ifmodel
has more than oneForeignKey
to its parent.- model¶
- extra = 0¶
- category¶
- class oioioi.contests.admin.ContestAdmin(model, admin_site)[source]¶
Bases:
oioioi.base.admin.ModelAdmin
Encapsulate all admin options and functionality for a given model.
- inlines¶
- readonly_fields = ['creation_date']¶
- prepopulated_fields¶
- list_display = ['name', 'id', 'creation_date']¶
- list_display_links = ['id', 'name']¶
- ordering = ['-creation_date']¶
- 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.
- get_form(request, obj=None, **kwargs)[source]¶
Return a Form class for use in the admin add view. This is used by add_view and change_view.
- class oioioi.contests.admin.BaseContestAdmin(*args, **kwargs)[source]¶
Bases:
oioioi.base.admin.MixinsAdmin
Encapsulate all admin options and functionality for a given model.
- default_model_admin¶
- class oioioi.contests.admin.ProblemInstanceAdmin(*args, **kwargs)[source]¶
Bases:
oioioi.base.admin.ModelAdmin
Encapsulate all admin options and functionality for a given model.
- form¶
- fields = ('contest', 'round', 'problem', 'short_name', 'submissions_limit')¶
- list_display = ('name_link', 'short_name_link', 'round', 'package', 'actions_field')¶
- readonly_fields = ('contest', 'problem')¶
- ordering = ('-round__start_date', 'short_name')¶
- 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.
- 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.
- get_list_display(request)[source]¶
Return a sequence containing the fields to be displayed on the changelist.
- get_actions(request)[source]¶
Return a dictionary mapping the names of all actions for this ModelAdmin to a tuple of (callable, name, description) for each action.
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.
- class oioioi.contests.admin.ProblemFilter(field, request, params, model, model_admin, field_path)[source]¶
Bases:
django.contrib.admin.AllValuesFieldListFilter
- title¶
- class oioioi.contests.admin.ContestsProblemNameListFilter(request, params, model, model_admin)[source]¶
Bases:
oioioi.base.utils.filters.ProblemNameListFilter
- initial_query_manager¶
- contest_field¶
- legacy_name_field¶
- outer_ref¶
- class oioioi.contests.admin.SubmissionKindListFilter(request, params, model, model_admin)[source]¶
Bases:
django.contrib.admin.SimpleListFilter
- title¶
- parameter_name = 'kind'¶
- class oioioi.contests.admin.SubmissionRoundListFilter(request, params, model, model_admin)[source]¶
Bases:
django.contrib.admin.SimpleListFilter
- title¶
- parameter_name = 'round'¶
- class oioioi.contests.admin.ContestListFilter(request, params, model, model_admin)[source]¶
Bases:
django.contrib.admin.SimpleListFilter
- title¶
- parameter_name = 'contest'¶
- class oioioi.contests.admin.SystemErrorListFilter(request, params, model, model_admin)[source]¶
Bases:
django.contrib.admin.SimpleListFilter
- title¶
- parameter_name = 'has_active_system_error'¶
- class oioioi.contests.admin.SubmissionAdmin(model, admin_site)[source]¶
Bases:
oioioi.base.admin.ModelAdmin
Encapsulate all admin options and functionality for a given model.
- date_hierarchy = 'date'¶
- actions = ['rejudge_action']¶
- search_fields = ['user__username', 'user__last_name', 'problem_instance__problem__legacy_name',...¶
- get_list_display(request)[source]¶
Return a sequence containing the fields to be displayed on the changelist.
- get_list_display_links(request, list_display)[source]¶
Return a sequence containing the fields to be displayed as links on the changelist. The list_display parameter is the list of fields returned by get_list_display().
- get_list_filter(request)[source]¶
Return a sequence containing the fields to be displayed as filters in the right sidebar of the changelist page.
- 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.
- get_actions(request)[source]¶
Return a dictionary mapping the names of all actions for this ModelAdmin to a tuple of (callable, name, description) for each action.
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.
- class oioioi.contests.admin.RoundTimeRoundListFilter(request, params, model, model_admin)[source]¶
Bases:
django.contrib.admin.SimpleListFilter
- title¶
- parameter_name = 'round'¶
- class oioioi.contests.admin.RoundTimeExtensionAdmin(model, admin_site)[source]¶
Bases:
oioioi.base.admin.ModelAdmin
Encapsulate all admin options and functionality for a given model.
- list_display = ['user_login', 'user_full_name', 'round', 'extra_time']¶
- list_display_links = ['extra_time']¶
- list_filter¶
- search_fields = ['user__username', 'user__last_name']¶
- 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.
- 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.
- get_queryset(request)[source]¶
Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
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.
- class oioioi.contests.admin.ContestPermissionAdminForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]¶
Bases:
django.forms.ModelForm
The main implementation of all the Form logic. Note that this class is different than Form. See the comments by the Form class for more info. Any improvements to the form API should be made to this class, not to the Form class.
- user¶
- class oioioi.contests.admin.ContestPermissionAdmin(model, admin_site)[source]¶
Bases:
oioioi.base.admin.ModelAdmin
Encapsulate all admin options and functionality for a given model.
- list_display_links = ['user']¶
- ordering = ['permission', 'user']¶
- form¶
- get_list_display(request)[source]¶
Return a sequence containing the fields to be displayed on the changelist.
- 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.