Admin#
Contains classes for managing what is displayed on the admin page.
- class fma_django.admin.ClientAdmin(model, admin_site)#
Bases:
ModelAdmin
Sets the list of Client attributes visible to the Admin.
- action_checkbox(obj)#
A list_display column containing a checkbox widget.
- action_form#
alias of
ActionForm
- actions = ()#
- actions_on_bottom = False#
- actions_on_top = True#
- actions_selection_counter = True#
- add_form_template = None#
- add_view(request, form_url='', extra_context=None)#
- autocomplete_fields = ()#
- change_form_template = None#
- change_list_template = None#
- change_view(request, object_id, form_url='', extra_context=None)#
- changeform_view(request, object_id=None, form_url='', extra_context=None)#
- changelist_view(request, extra_context=None)#
The ‘change list’ admin view for this model.
- check(**kwargs)#
- checks_class#
alias of
ModelAdminChecks
- construct_change_message(request, form, formsets, add=False)#
Construct a JSON structure describing changes from a changed object.
- date_hierarchy = None#
- delete_confirmation_template = None#
- delete_model(request, obj)#
Given a model instance delete it from the database.
- delete_queryset(request, queryset)#
Given a queryset, delete it from the database.
- delete_selected_confirmation_template = None#
- delete_view(request, object_id, extra_context=None)#
- exclude = None#
- fields = None#
- fieldsets = None#
- filter_horizontal = ()#
- filter_vertical = ()#
- form#
alias of
ModelForm
- formfield_for_choice_field(db_field, request, **kwargs)#
Get a form Field for a database Field that has declared choices.
- formfield_for_dbfield(db_field, request, **kwargs)#
Hook for specifying the form Field instance for a given database Field instance.
If kwargs are given, they’re passed to the form Field’s constructor.
- formfield_for_foreignkey(db_field, request, **kwargs)#
Get a form Field for a ForeignKey.
- formfield_for_manytomany(db_field, request, **kwargs)#
Get a form Field for a ManyToManyField.
- formfield_overrides = {}#
- get_action(action)#
Return a given action from a parameter, which can either be a callable, or the name of a method on the ModelAdmin. Return is a tuple of (callable, name, description).
- get_action_choices(request, default_choices=[('', '---------')])#
Return a list of choices for use in a form object. Each choice is a tuple (name, description).
- get_actions(request)#
Return a dictionary mapping the names of all actions for this ModelAdmin to a tuple of (callable, name, description) for each action.
- get_autocomplete_fields(request)#
Return a list of ForeignKey and/or ManyToMany fields which should use an autocomplete widget.
- get_changeform_initial_data(request)#
Get the initial form data from the request’s GET params.
- get_changelist(request, **kwargs)#
Return the ChangeList class for use on the changelist page.
- get_changelist_form(request, **kwargs)#
Return a Form class for use in the Formset on the changelist page.
- get_changelist_formset(request, **kwargs)#
Return a FormSet class for use on the changelist page if list_editable is used.
- get_changelist_instance(request)#
Return a ChangeList instance based on request. May raise IncorrectLookupParameters.
- get_deleted_objects(objs, request)#
Hook for customizing the delete process for the delete view and the “delete selected” action.
- get_empty_value_display()#
Return the empty_value_display set on ModelAdmin or AdminSite.
- get_exclude(request, obj=None)#
Hook for specifying exclude.
- get_field_queryset(db, db_field, request)#
If the ModelAdmin specifies ordering, the queryset should respect that ordering. Otherwise don’t specify the queryset, let the field decide (return None in that case).
- get_fields(request, obj=None)#
Hook for specifying fields.
- get_fieldsets(request, obj=None)#
Hook for specifying fieldsets.
- get_form(request, obj=None, change=False, **kwargs)#
Return a Form class for use in the admin add view. This is used by add_view and change_view.
- get_formset_kwargs(request, obj, inline, prefix)#
- get_formsets_with_inlines(request, obj=None)#
Yield formsets and the corresponding inlines.
- get_inline_formsets(request, formsets, inline_instances, obj=None)#
- get_inline_instances(request, obj=None)#
- get_inlines(request, obj)#
Hook for specifying custom inlines.
- get_list_display(request)#
Return a sequence containing the fields to be displayed on the changelist.
- get_list_display_links(request, list_display)#
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)#
Return a sequence containing the fields to be displayed as filters in the right sidebar of the changelist page.
Return a list of fields to add to the select_related() part of the changelist items query.
- get_model_perms(request)#
Return a dict of all perms for this model. This dict has the keys
add
,change
,delete
, andview
mapping to the True/False for each of those actions.
- get_object(request, object_id, from_field=None)#
Return an instance matching the field and value provided, the primary key is used if no field is provided. Return
None
if no match is found or the object_id fails validation.
- get_ordering(request)#
Hook for specifying field ordering.
- get_paginator(request, queryset, per_page, orphans=0, allow_empty_first_page=True)#
- get_prepopulated_fields(request, obj=None)#
Hook for specifying custom prepopulated fields.
- get_preserved_filters(request)#
Return the preserved filters querystring.
- get_queryset(request)#
Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
- get_readonly_fields(request, obj=None)#
Hook for specifying custom readonly fields.
- get_search_fields(request)#
Return a sequence containing the fields to be searched whenever somebody submits a search query.
- get_search_results(request, queryset, search_term)#
Return a tuple containing a queryset to implement the search and a boolean indicating if the results may contain duplicates.
- get_sortable_by(request)#
Hook for specifying which fields can be sorted in the changelist.
- get_urls()#
- get_view_on_site_url(obj=None)#
- has_add_permission(request)#
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)#
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)#
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 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_module_permission(request)#
Return True if the given request has any permission in the given app label.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to view the module on the admin index page and access the module’s index page. Overriding it does not restrict access to the add, change or delete views. Use ModelAdmin.has_(add|change|delete)_permission for that.
- has_view_or_change_permission(request, obj=None)#
- has_view_permission(request, obj=None)#
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.
- history_view(request, object_id, extra_context=None)#
The ‘history’ admin view for this model.
- inlines = ()#
- list_display = ('__str__',)#
- list_display_links = ()#
- list_editable = ()#
- list_filter = ()#
- list_max_show_all = 200#
- list_per_page = 100#
- log_addition(request, obj, message)#
Log that an object has been successfully added.
The default implementation creates an admin LogEntry object.
- log_change(request, obj, message)#
Log that an object has been successfully changed.
The default implementation creates an admin LogEntry object.
- log_deletion(request, obj, object_repr)#
Log that an object will be deleted. Note that this method must be called before the deletion.
The default implementation creates an admin LogEntry object.
- lookup_allowed(lookup, value)#
- property media#
- message_user(request, message, level=20, extra_tags='', fail_silently=False)#
Send a message to the user. The default implementation posts a message using the django.contrib.messages backend.
Exposes almost the same API as messages.add_message(), but accepts the positional arguments in a different order to maintain backwards compatibility. For convenience, it accepts the level argument as a string rather than the usual level number.
- object_history_template = None#
- ordering = None#
- paginator#
alias of
Paginator
- popup_response_template = None#
- prepopulated_fields = {}#
- preserve_filters = True#
- radio_fields = {}#
- raw_id_fields = ()#
- readonly_fields = ()#
- render_change_form(request, context, add=False, change=False, form_url='', obj=None)#
- render_delete_form(request, context)#
- response_action(request, queryset)#
Handle an admin action. This is called if a request is POSTed to the changelist; it returns an HttpResponse if the action was handled, and None otherwise.
- response_add(request, obj, post_url_continue=None)#
Determine the HttpResponse for the add_view stage.
- response_change(request, obj)#
Determine the HttpResponse for the change_view stage.
- response_delete(request, obj_display, obj_id)#
Determine the HttpResponse for the delete_view stage.
- response_post_save_add(request, obj)#
Figure out where to redirect after the ‘Save’ button has been pressed when adding a new object.
- response_post_save_change(request, obj)#
Figure out where to redirect after the ‘Save’ button has been pressed when editing an existing object.
- save_as = False#
- save_as_continue = True#
- save_form(request, form, change)#
Given a ModelForm return an unsaved instance.
change
is True if the object is being changed, and False if it’s being added.
- save_formset(request, form, formset, change)#
Given an inline formset save it to the database.
- save_model(request, obj, form, change)#
Given a model instance save it to the database.
- save_on_top = False#
Given the
HttpRequest
, the parentModelForm
instance, the list of inline formsets and a boolean value based on whether the parent is being added or changed, save the related objects to the database. Note that at this point save_form() and save_model() have already been called.
- search_fields = ()#
- search_help_text = None#
- show_full_result_count = True#
- sortable_by = None#
- to_field_allowed(request, to_field)#
Return True if the model associated with this admin should be allowed to be referenced by the specified field.
- property urls#
- view_on_site = True#
- class fma_django.admin.FederatedModelAdmin(model, admin_site)#
Bases:
ModelAdmin
Sets the list of Federated Model attributes visible to the Admin.
- list_display = ['name', 'last_modified']#
- action_checkbox(obj)#
A list_display column containing a checkbox widget.
- action_form#
alias of
ActionForm
- actions = ()#
- actions_on_bottom = False#
- actions_on_top = True#
- actions_selection_counter = True#
- add_form_template = None#
- add_view(request, form_url='', extra_context=None)#
- autocomplete_fields = ()#
- change_form_template = None#
- change_list_template = None#
- change_view(request, object_id, form_url='', extra_context=None)#
- changeform_view(request, object_id=None, form_url='', extra_context=None)#
- changelist_view(request, extra_context=None)#
The ‘change list’ admin view for this model.
- check(**kwargs)#
- checks_class#
alias of
ModelAdminChecks
- construct_change_message(request, form, formsets, add=False)#
Construct a JSON structure describing changes from a changed object.
- date_hierarchy = None#
- delete_confirmation_template = None#
- delete_model(request, obj)#
Given a model instance delete it from the database.
- delete_queryset(request, queryset)#
Given a queryset, delete it from the database.
- delete_selected_confirmation_template = None#
- delete_view(request, object_id, extra_context=None)#
- exclude = None#
- fields = None#
- fieldsets = None#
- filter_horizontal = ()#
- filter_vertical = ()#
- form#
alias of
ModelForm
- formfield_for_choice_field(db_field, request, **kwargs)#
Get a form Field for a database Field that has declared choices.
- formfield_for_dbfield(db_field, request, **kwargs)#
Hook for specifying the form Field instance for a given database Field instance.
If kwargs are given, they’re passed to the form Field’s constructor.
- formfield_for_foreignkey(db_field, request, **kwargs)#
Get a form Field for a ForeignKey.
- formfield_for_manytomany(db_field, request, **kwargs)#
Get a form Field for a ManyToManyField.
- formfield_overrides = {}#
- get_action(action)#
Return a given action from a parameter, which can either be a callable, or the name of a method on the ModelAdmin. Return is a tuple of (callable, name, description).
- get_action_choices(request, default_choices=[('', '---------')])#
Return a list of choices for use in a form object. Each choice is a tuple (name, description).
- get_actions(request)#
Return a dictionary mapping the names of all actions for this ModelAdmin to a tuple of (callable, name, description) for each action.
- get_autocomplete_fields(request)#
Return a list of ForeignKey and/or ManyToMany fields which should use an autocomplete widget.
- get_changeform_initial_data(request)#
Get the initial form data from the request’s GET params.
- get_changelist(request, **kwargs)#
Return the ChangeList class for use on the changelist page.
- get_changelist_form(request, **kwargs)#
Return a Form class for use in the Formset on the changelist page.
- get_changelist_formset(request, **kwargs)#
Return a FormSet class for use on the changelist page if list_editable is used.
- get_changelist_instance(request)#
Return a ChangeList instance based on request. May raise IncorrectLookupParameters.
- get_deleted_objects(objs, request)#
Hook for customizing the delete process for the delete view and the “delete selected” action.
- get_empty_value_display()#
Return the empty_value_display set on ModelAdmin or AdminSite.
- get_exclude(request, obj=None)#
Hook for specifying exclude.
- get_field_queryset(db, db_field, request)#
If the ModelAdmin specifies ordering, the queryset should respect that ordering. Otherwise don’t specify the queryset, let the field decide (return None in that case).
- get_fields(request, obj=None)#
Hook for specifying fields.
- get_fieldsets(request, obj=None)#
Hook for specifying fieldsets.
- get_form(request, obj=None, change=False, **kwargs)#
Return a Form class for use in the admin add view. This is used by add_view and change_view.
- get_formset_kwargs(request, obj, inline, prefix)#
- get_formsets_with_inlines(request, obj=None)#
Yield formsets and the corresponding inlines.
- get_inline_formsets(request, formsets, inline_instances, obj=None)#
- get_inline_instances(request, obj=None)#
- get_inlines(request, obj)#
Hook for specifying custom inlines.
- get_list_display(request)#
Return a sequence containing the fields to be displayed on the changelist.
- get_list_display_links(request, list_display)#
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)#
Return a sequence containing the fields to be displayed as filters in the right sidebar of the changelist page.
Return a list of fields to add to the select_related() part of the changelist items query.
- get_model_perms(request)#
Return a dict of all perms for this model. This dict has the keys
add
,change
,delete
, andview
mapping to the True/False for each of those actions.
- get_object(request, object_id, from_field=None)#
Return an instance matching the field and value provided, the primary key is used if no field is provided. Return
None
if no match is found or the object_id fails validation.
- get_ordering(request)#
Hook for specifying field ordering.
- get_paginator(request, queryset, per_page, orphans=0, allow_empty_first_page=True)#
- get_prepopulated_fields(request, obj=None)#
Hook for specifying custom prepopulated fields.
- get_preserved_filters(request)#
Return the preserved filters querystring.
- get_queryset(request)#
Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
- get_readonly_fields(request, obj=None)#
Hook for specifying custom readonly fields.
- get_search_fields(request)#
Return a sequence containing the fields to be searched whenever somebody submits a search query.
- get_search_results(request, queryset, search_term)#
Return a tuple containing a queryset to implement the search and a boolean indicating if the results may contain duplicates.
- get_sortable_by(request)#
Hook for specifying which fields can be sorted in the changelist.
- get_urls()#
- get_view_on_site_url(obj=None)#
- has_add_permission(request)#
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)#
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)#
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 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_module_permission(request)#
Return True if the given request has any permission in the given app label.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to view the module on the admin index page and access the module’s index page. Overriding it does not restrict access to the add, change or delete views. Use ModelAdmin.has_(add|change|delete)_permission for that.
- has_view_or_change_permission(request, obj=None)#
- has_view_permission(request, obj=None)#
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.
- history_view(request, object_id, extra_context=None)#
The ‘history’ admin view for this model.
- inlines = ()#
- list_display_links = ()#
- list_editable = ()#
- list_filter = ()#
- list_max_show_all = 200#
- list_per_page = 100#
- log_addition(request, obj, message)#
Log that an object has been successfully added.
The default implementation creates an admin LogEntry object.
- log_change(request, obj, message)#
Log that an object has been successfully changed.
The default implementation creates an admin LogEntry object.
- log_deletion(request, obj, object_repr)#
Log that an object will be deleted. Note that this method must be called before the deletion.
The default implementation creates an admin LogEntry object.
- lookup_allowed(lookup, value)#
- property media#
- message_user(request, message, level=20, extra_tags='', fail_silently=False)#
Send a message to the user. The default implementation posts a message using the django.contrib.messages backend.
Exposes almost the same API as messages.add_message(), but accepts the positional arguments in a different order to maintain backwards compatibility. For convenience, it accepts the level argument as a string rather than the usual level number.
- object_history_template = None#
- ordering = None#
- paginator#
alias of
Paginator
- popup_response_template = None#
- prepopulated_fields = {}#
- preserve_filters = True#
- radio_fields = {}#
- raw_id_fields = ()#
- readonly_fields = ()#
- render_change_form(request, context, add=False, change=False, form_url='', obj=None)#
- render_delete_form(request, context)#
- response_action(request, queryset)#
Handle an admin action. This is called if a request is POSTed to the changelist; it returns an HttpResponse if the action was handled, and None otherwise.
- response_add(request, obj, post_url_continue=None)#
Determine the HttpResponse for the add_view stage.
- response_change(request, obj)#
Determine the HttpResponse for the change_view stage.
- response_delete(request, obj_display, obj_id)#
Determine the HttpResponse for the delete_view stage.
- response_post_save_add(request, obj)#
Figure out where to redirect after the ‘Save’ button has been pressed when adding a new object.
- response_post_save_change(request, obj)#
Figure out where to redirect after the ‘Save’ button has been pressed when editing an existing object.
- save_as = False#
- save_as_continue = True#
- save_form(request, form, change)#
Given a ModelForm return an unsaved instance.
change
is True if the object is being changed, and False if it’s being added.
- save_formset(request, form, formset, change)#
Given an inline formset save it to the database.
- save_model(request, obj, form, change)#
Given a model instance save it to the database.
- save_on_top = False#
Given the
HttpRequest
, the parentModelForm
instance, the list of inline formsets and a boolean value based on whether the parent is being added or changed, save the related objects to the database. Note that at this point save_form() and save_model() have already been called.
- search_fields = ()#
- search_help_text = None#
- show_full_result_count = True#
- sortable_by = None#
- to_field_allowed(request, to_field)#
Return True if the model associated with this admin should be allowed to be referenced by the specified field.
- property urls#
- view_on_site = True#
- class fma_django.admin.ModelArtifactAdmin(model, admin_site)#
Bases:
ModelAdmin
Sets the list of Model Artifact attributes visible to the Admin.
- list_display = ['id', 'federated_model', 'version', 'created_on']#
- action_checkbox(obj)#
A list_display column containing a checkbox widget.
- action_form#
alias of
ActionForm
- actions = ()#
- actions_on_bottom = False#
- actions_on_top = True#
- actions_selection_counter = True#
- add_form_template = None#
- add_view(request, form_url='', extra_context=None)#
- autocomplete_fields = ()#
- change_form_template = None#
- change_list_template = None#
- change_view(request, object_id, form_url='', extra_context=None)#
- changeform_view(request, object_id=None, form_url='', extra_context=None)#
- changelist_view(request, extra_context=None)#
The ‘change list’ admin view for this model.
- check(**kwargs)#
- checks_class#
alias of
ModelAdminChecks
- construct_change_message(request, form, formsets, add=False)#
Construct a JSON structure describing changes from a changed object.
- date_hierarchy = None#
- delete_confirmation_template = None#
- delete_model(request, obj)#
Given a model instance delete it from the database.
- delete_queryset(request, queryset)#
Given a queryset, delete it from the database.
- delete_selected_confirmation_template = None#
- delete_view(request, object_id, extra_context=None)#
- exclude = None#
- fields = None#
- fieldsets = None#
- filter_horizontal = ()#
- filter_vertical = ()#
- form#
alias of
ModelForm
- formfield_for_choice_field(db_field, request, **kwargs)#
Get a form Field for a database Field that has declared choices.
- formfield_for_dbfield(db_field, request, **kwargs)#
Hook for specifying the form Field instance for a given database Field instance.
If kwargs are given, they’re passed to the form Field’s constructor.
- formfield_for_foreignkey(db_field, request, **kwargs)#
Get a form Field for a ForeignKey.
- formfield_for_manytomany(db_field, request, **kwargs)#
Get a form Field for a ManyToManyField.
- formfield_overrides = {}#
- get_action(action)#
Return a given action from a parameter, which can either be a callable, or the name of a method on the ModelAdmin. Return is a tuple of (callable, name, description).
- get_action_choices(request, default_choices=[('', '---------')])#
Return a list of choices for use in a form object. Each choice is a tuple (name, description).
- get_actions(request)#
Return a dictionary mapping the names of all actions for this ModelAdmin to a tuple of (callable, name, description) for each action.
- get_autocomplete_fields(request)#
Return a list of ForeignKey and/or ManyToMany fields which should use an autocomplete widget.
- get_changeform_initial_data(request)#
Get the initial form data from the request’s GET params.
- get_changelist(request, **kwargs)#
Return the ChangeList class for use on the changelist page.
- get_changelist_form(request, **kwargs)#
Return a Form class for use in the Formset on the changelist page.
- get_changelist_formset(request, **kwargs)#
Return a FormSet class for use on the changelist page if list_editable is used.
- get_changelist_instance(request)#
Return a ChangeList instance based on request. May raise IncorrectLookupParameters.
- get_deleted_objects(objs, request)#
Hook for customizing the delete process for the delete view and the “delete selected” action.
- get_empty_value_display()#
Return the empty_value_display set on ModelAdmin or AdminSite.
- get_exclude(request, obj=None)#
Hook for specifying exclude.
- get_field_queryset(db, db_field, request)#
If the ModelAdmin specifies ordering, the queryset should respect that ordering. Otherwise don’t specify the queryset, let the field decide (return None in that case).
- get_fields(request, obj=None)#
Hook for specifying fields.
- get_fieldsets(request, obj=None)#
Hook for specifying fieldsets.
- get_form(request, obj=None, change=False, **kwargs)#
Return a Form class for use in the admin add view. This is used by add_view and change_view.
- get_formset_kwargs(request, obj, inline, prefix)#
- get_formsets_with_inlines(request, obj=None)#
Yield formsets and the corresponding inlines.
- get_inline_formsets(request, formsets, inline_instances, obj=None)#
- get_inline_instances(request, obj=None)#
- get_inlines(request, obj)#
Hook for specifying custom inlines.
- get_list_display(request)#
Return a sequence containing the fields to be displayed on the changelist.
- get_list_display_links(request, list_display)#
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)#
Return a sequence containing the fields to be displayed as filters in the right sidebar of the changelist page.
Return a list of fields to add to the select_related() part of the changelist items query.
- get_model_perms(request)#
Return a dict of all perms for this model. This dict has the keys
add
,change
,delete
, andview
mapping to the True/False for each of those actions.
- get_object(request, object_id, from_field=None)#
Return an instance matching the field and value provided, the primary key is used if no field is provided. Return
None
if no match is found or the object_id fails validation.
- get_ordering(request)#
Hook for specifying field ordering.
- get_paginator(request, queryset, per_page, orphans=0, allow_empty_first_page=True)#
- get_prepopulated_fields(request, obj=None)#
Hook for specifying custom prepopulated fields.
- get_preserved_filters(request)#
Return the preserved filters querystring.
- get_queryset(request)#
Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
- get_readonly_fields(request, obj=None)#
Hook for specifying custom readonly fields.
- get_search_fields(request)#
Return a sequence containing the fields to be searched whenever somebody submits a search query.
- get_search_results(request, queryset, search_term)#
Return a tuple containing a queryset to implement the search and a boolean indicating if the results may contain duplicates.
- get_sortable_by(request)#
Hook for specifying which fields can be sorted in the changelist.
- get_urls()#
- get_view_on_site_url(obj=None)#
- has_add_permission(request)#
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)#
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)#
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 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_module_permission(request)#
Return True if the given request has any permission in the given app label.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to view the module on the admin index page and access the module’s index page. Overriding it does not restrict access to the add, change or delete views. Use ModelAdmin.has_(add|change|delete)_permission for that.
- has_view_or_change_permission(request, obj=None)#
- has_view_permission(request, obj=None)#
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.
- history_view(request, object_id, extra_context=None)#
The ‘history’ admin view for this model.
- inlines = ()#
- list_display_links = ()#
- list_editable = ()#
- list_filter = ()#
- list_max_show_all = 200#
- list_per_page = 100#
- log_addition(request, obj, message)#
Log that an object has been successfully added.
The default implementation creates an admin LogEntry object.
- log_change(request, obj, message)#
Log that an object has been successfully changed.
The default implementation creates an admin LogEntry object.
- log_deletion(request, obj, object_repr)#
Log that an object will be deleted. Note that this method must be called before the deletion.
The default implementation creates an admin LogEntry object.
- lookup_allowed(lookup, value)#
- property media#
- message_user(request, message, level=20, extra_tags='', fail_silently=False)#
Send a message to the user. The default implementation posts a message using the django.contrib.messages backend.
Exposes almost the same API as messages.add_message(), but accepts the positional arguments in a different order to maintain backwards compatibility. For convenience, it accepts the level argument as a string rather than the usual level number.
- object_history_template = None#
- ordering = None#
- paginator#
alias of
Paginator
- popup_response_template = None#
- prepopulated_fields = {}#
- preserve_filters = True#
- radio_fields = {}#
- raw_id_fields = ()#
- readonly_fields = ()#
- render_change_form(request, context, add=False, change=False, form_url='', obj=None)#
- render_delete_form(request, context)#
- response_action(request, queryset)#
Handle an admin action. This is called if a request is POSTed to the changelist; it returns an HttpResponse if the action was handled, and None otherwise.
- response_add(request, obj, post_url_continue=None)#
Determine the HttpResponse for the add_view stage.
- response_change(request, obj)#
Determine the HttpResponse for the change_view stage.
- response_delete(request, obj_display, obj_id)#
Determine the HttpResponse for the delete_view stage.
- response_post_save_add(request, obj)#
Figure out where to redirect after the ‘Save’ button has been pressed when adding a new object.
- response_post_save_change(request, obj)#
Figure out where to redirect after the ‘Save’ button has been pressed when editing an existing object.
- save_as = False#
- save_as_continue = True#
- save_form(request, form, change)#
Given a ModelForm return an unsaved instance.
change
is True if the object is being changed, and False if it’s being added.
- save_formset(request, form, formset, change)#
Given an inline formset save it to the database.
- save_model(request, obj, form, change)#
Given a model instance save it to the database.
- save_on_top = False#
Given the
HttpRequest
, the parentModelForm
instance, the list of inline formsets and a boolean value based on whether the parent is being added or changed, save the related objects to the database. Note that at this point save_form() and save_model() have already been called.
- search_fields = ()#
- search_help_text = None#
- show_full_result_count = True#
- sortable_by = None#
- to_field_allowed(request, to_field)#
Return True if the model associated with this admin should be allowed to be referenced by the specified field.
- property urls#
- view_on_site = True#
- class fma_django.admin.ModelUpdateAdmin(model, admin_site)#
Bases:
ModelAdmin
Sets the list of Model Update attributes visible to the Admin.
- list_display = ['id', 'status', 'created_on']#
- action_checkbox(obj)#
A list_display column containing a checkbox widget.
- action_form#
alias of
ActionForm
- actions = ()#
- actions_on_bottom = False#
- actions_on_top = True#
- actions_selection_counter = True#
- add_form_template = None#
- add_view(request, form_url='', extra_context=None)#
- autocomplete_fields = ()#
- change_form_template = None#
- change_list_template = None#
- change_view(request, object_id, form_url='', extra_context=None)#
- changeform_view(request, object_id=None, form_url='', extra_context=None)#
- changelist_view(request, extra_context=None)#
The ‘change list’ admin view for this model.
- check(**kwargs)#
- checks_class#
alias of
ModelAdminChecks
- construct_change_message(request, form, formsets, add=False)#
Construct a JSON structure describing changes from a changed object.
- date_hierarchy = None#
- delete_confirmation_template = None#
- delete_model(request, obj)#
Given a model instance delete it from the database.
- delete_queryset(request, queryset)#
Given a queryset, delete it from the database.
- delete_selected_confirmation_template = None#
- delete_view(request, object_id, extra_context=None)#
- exclude = None#
- fields = None#
- fieldsets = None#
- filter_horizontal = ()#
- filter_vertical = ()#
- form#
alias of
ModelForm
- formfield_for_choice_field(db_field, request, **kwargs)#
Get a form Field for a database Field that has declared choices.
- formfield_for_dbfield(db_field, request, **kwargs)#
Hook for specifying the form Field instance for a given database Field instance.
If kwargs are given, they’re passed to the form Field’s constructor.
- formfield_for_foreignkey(db_field, request, **kwargs)#
Get a form Field for a ForeignKey.
- formfield_for_manytomany(db_field, request, **kwargs)#
Get a form Field for a ManyToManyField.
- formfield_overrides = {}#
- get_action(action)#
Return a given action from a parameter, which can either be a callable, or the name of a method on the ModelAdmin. Return is a tuple of (callable, name, description).
- get_action_choices(request, default_choices=[('', '---------')])#
Return a list of choices for use in a form object. Each choice is a tuple (name, description).
- get_actions(request)#
Return a dictionary mapping the names of all actions for this ModelAdmin to a tuple of (callable, name, description) for each action.
- get_autocomplete_fields(request)#
Return a list of ForeignKey and/or ManyToMany fields which should use an autocomplete widget.
- get_changeform_initial_data(request)#
Get the initial form data from the request’s GET params.
- get_changelist(request, **kwargs)#
Return the ChangeList class for use on the changelist page.
- get_changelist_form(request, **kwargs)#
Return a Form class for use in the Formset on the changelist page.
- get_changelist_formset(request, **kwargs)#
Return a FormSet class for use on the changelist page if list_editable is used.
- get_changelist_instance(request)#
Return a ChangeList instance based on request. May raise IncorrectLookupParameters.
- get_deleted_objects(objs, request)#
Hook for customizing the delete process for the delete view and the “delete selected” action.
- get_empty_value_display()#
Return the empty_value_display set on ModelAdmin or AdminSite.
- get_exclude(request, obj=None)#
Hook for specifying exclude.
- get_field_queryset(db, db_field, request)#
If the ModelAdmin specifies ordering, the queryset should respect that ordering. Otherwise don’t specify the queryset, let the field decide (return None in that case).
- get_fields(request, obj=None)#
Hook for specifying fields.
- get_fieldsets(request, obj=None)#
Hook for specifying fieldsets.
- get_form(request, obj=None, change=False, **kwargs)#
Return a Form class for use in the admin add view. This is used by add_view and change_view.
- get_formset_kwargs(request, obj, inline, prefix)#
- get_formsets_with_inlines(request, obj=None)#
Yield formsets and the corresponding inlines.
- get_inline_formsets(request, formsets, inline_instances, obj=None)#
- get_inline_instances(request, obj=None)#
- get_inlines(request, obj)#
Hook for specifying custom inlines.
- get_list_display(request)#
Return a sequence containing the fields to be displayed on the changelist.
- get_list_display_links(request, list_display)#
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)#
Return a sequence containing the fields to be displayed as filters in the right sidebar of the changelist page.
Return a list of fields to add to the select_related() part of the changelist items query.
- get_model_perms(request)#
Return a dict of all perms for this model. This dict has the keys
add
,change
,delete
, andview
mapping to the True/False for each of those actions.
- get_object(request, object_id, from_field=None)#
Return an instance matching the field and value provided, the primary key is used if no field is provided. Return
None
if no match is found or the object_id fails validation.
- get_ordering(request)#
Hook for specifying field ordering.
- get_paginator(request, queryset, per_page, orphans=0, allow_empty_first_page=True)#
- get_prepopulated_fields(request, obj=None)#
Hook for specifying custom prepopulated fields.
- get_preserved_filters(request)#
Return the preserved filters querystring.
- get_queryset(request)#
Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
- get_readonly_fields(request, obj=None)#
Hook for specifying custom readonly fields.
- get_search_fields(request)#
Return a sequence containing the fields to be searched whenever somebody submits a search query.
- get_search_results(request, queryset, search_term)#
Return a tuple containing a queryset to implement the search and a boolean indicating if the results may contain duplicates.
- get_sortable_by(request)#
Hook for specifying which fields can be sorted in the changelist.
- get_urls()#
- get_view_on_site_url(obj=None)#
- has_add_permission(request)#
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)#
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)#
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 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_module_permission(request)#
Return True if the given request has any permission in the given app label.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to view the module on the admin index page and access the module’s index page. Overriding it does not restrict access to the add, change or delete views. Use ModelAdmin.has_(add|change|delete)_permission for that.
- has_view_or_change_permission(request, obj=None)#
- has_view_permission(request, obj=None)#
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.
- history_view(request, object_id, extra_context=None)#
The ‘history’ admin view for this model.
- inlines = ()#
- list_display_links = ()#
- list_editable = ()#
- list_filter = ()#
- list_max_show_all = 200#
- list_per_page = 100#
- log_addition(request, obj, message)#
Log that an object has been successfully added.
The default implementation creates an admin LogEntry object.
- log_change(request, obj, message)#
Log that an object has been successfully changed.
The default implementation creates an admin LogEntry object.
- log_deletion(request, obj, object_repr)#
Log that an object will be deleted. Note that this method must be called before the deletion.
The default implementation creates an admin LogEntry object.
- lookup_allowed(lookup, value)#
- property media#
- message_user(request, message, level=20, extra_tags='', fail_silently=False)#
Send a message to the user. The default implementation posts a message using the django.contrib.messages backend.
Exposes almost the same API as messages.add_message(), but accepts the positional arguments in a different order to maintain backwards compatibility. For convenience, it accepts the level argument as a string rather than the usual level number.
- object_history_template = None#
- ordering = None#
- paginator#
alias of
Paginator
- popup_response_template = None#
- prepopulated_fields = {}#
- preserve_filters = True#
- radio_fields = {}#
- raw_id_fields = ()#
- readonly_fields = ()#
- render_change_form(request, context, add=False, change=False, form_url='', obj=None)#
- render_delete_form(request, context)#
- response_action(request, queryset)#
Handle an admin action. This is called if a request is POSTed to the changelist; it returns an HttpResponse if the action was handled, and None otherwise.
- response_add(request, obj, post_url_continue=None)#
Determine the HttpResponse for the add_view stage.
- response_change(request, obj)#
Determine the HttpResponse for the change_view stage.
- response_delete(request, obj_display, obj_id)#
Determine the HttpResponse for the delete_view stage.
- response_post_save_add(request, obj)#
Figure out where to redirect after the ‘Save’ button has been pressed when adding a new object.
- response_post_save_change(request, obj)#
Figure out where to redirect after the ‘Save’ button has been pressed when editing an existing object.
- save_as = False#
- save_as_continue = True#
- save_form(request, form, change)#
Given a ModelForm return an unsaved instance.
change
is True if the object is being changed, and False if it’s being added.
- save_formset(request, form, formset, change)#
Given an inline formset save it to the database.
- save_model(request, obj, form, change)#
Given a model instance save it to the database.
- save_on_top = False#
Given the
HttpRequest
, the parentModelForm
instance, the list of inline formsets and a boolean value based on whether the parent is being added or changed, save the related objects to the database. Note that at this point save_form() and save_model() have already been called.
- search_fields = ()#
- search_help_text = None#
- show_full_result_count = True#
- sortable_by = None#
- to_field_allowed(request, to_field)#
Return True if the model associated with this admin should be allowed to be referenced by the specified field.
- property urls#
- view_on_site = True#
- class fma_django.admin.ModelAggregateAdmin(model, admin_site)#
Bases:
ModelAdmin
Sets the list of Model Aggregate attributes visible to the Admin.
- list_display = ['id', 'federated_model', 'created_on']#
- action_checkbox(obj)#
A list_display column containing a checkbox widget.
- action_form#
alias of
ActionForm
- actions = ()#
- actions_on_bottom = False#
- actions_on_top = True#
- actions_selection_counter = True#
- add_form_template = None#
- add_view(request, form_url='', extra_context=None)#
- autocomplete_fields = ()#
- change_form_template = None#
- change_list_template = None#
- change_view(request, object_id, form_url='', extra_context=None)#
- changeform_view(request, object_id=None, form_url='', extra_context=None)#
- changelist_view(request, extra_context=None)#
The ‘change list’ admin view for this model.
- check(**kwargs)#
- checks_class#
alias of
ModelAdminChecks
- construct_change_message(request, form, formsets, add=False)#
Construct a JSON structure describing changes from a changed object.
- date_hierarchy = None#
- delete_confirmation_template = None#
- delete_model(request, obj)#
Given a model instance delete it from the database.
- delete_queryset(request, queryset)#
Given a queryset, delete it from the database.
- delete_selected_confirmation_template = None#
- delete_view(request, object_id, extra_context=None)#
- exclude = None#
- fields = None#
- fieldsets = None#
- filter_horizontal = ()#
- filter_vertical = ()#
- form#
alias of
ModelForm
- formfield_for_choice_field(db_field, request, **kwargs)#
Get a form Field for a database Field that has declared choices.
- formfield_for_dbfield(db_field, request, **kwargs)#
Hook for specifying the form Field instance for a given database Field instance.
If kwargs are given, they’re passed to the form Field’s constructor.
- formfield_for_foreignkey(db_field, request, **kwargs)#
Get a form Field for a ForeignKey.
- formfield_for_manytomany(db_field, request, **kwargs)#
Get a form Field for a ManyToManyField.
- formfield_overrides = {}#
- get_action(action)#
Return a given action from a parameter, which can either be a callable, or the name of a method on the ModelAdmin. Return is a tuple of (callable, name, description).
- get_action_choices(request, default_choices=[('', '---------')])#
Return a list of choices for use in a form object. Each choice is a tuple (name, description).
- get_actions(request)#
Return a dictionary mapping the names of all actions for this ModelAdmin to a tuple of (callable, name, description) for each action.
- get_autocomplete_fields(request)#
Return a list of ForeignKey and/or ManyToMany fields which should use an autocomplete widget.
- get_changeform_initial_data(request)#
Get the initial form data from the request’s GET params.
- get_changelist(request, **kwargs)#
Return the ChangeList class for use on the changelist page.
- get_changelist_form(request, **kwargs)#
Return a Form class for use in the Formset on the changelist page.
- get_changelist_formset(request, **kwargs)#
Return a FormSet class for use on the changelist page if list_editable is used.
- get_changelist_instance(request)#
Return a ChangeList instance based on request. May raise IncorrectLookupParameters.
- get_deleted_objects(objs, request)#
Hook for customizing the delete process for the delete view and the “delete selected” action.
- get_empty_value_display()#
Return the empty_value_display set on ModelAdmin or AdminSite.
- get_exclude(request, obj=None)#
Hook for specifying exclude.
- get_field_queryset(db, db_field, request)#
If the ModelAdmin specifies ordering, the queryset should respect that ordering. Otherwise don’t specify the queryset, let the field decide (return None in that case).
- get_fields(request, obj=None)#
Hook for specifying fields.
- get_fieldsets(request, obj=None)#
Hook for specifying fieldsets.
- get_form(request, obj=None, change=False, **kwargs)#
Return a Form class for use in the admin add view. This is used by add_view and change_view.
- get_formset_kwargs(request, obj, inline, prefix)#
- get_formsets_with_inlines(request, obj=None)#
Yield formsets and the corresponding inlines.
- get_inline_formsets(request, formsets, inline_instances, obj=None)#
- get_inline_instances(request, obj=None)#
- get_inlines(request, obj)#
Hook for specifying custom inlines.
- get_list_display(request)#
Return a sequence containing the fields to be displayed on the changelist.
- get_list_display_links(request, list_display)#
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)#
Return a sequence containing the fields to be displayed as filters in the right sidebar of the changelist page.
Return a list of fields to add to the select_related() part of the changelist items query.
- get_model_perms(request)#
Return a dict of all perms for this model. This dict has the keys
add
,change
,delete
, andview
mapping to the True/False for each of those actions.
- get_object(request, object_id, from_field=None)#
Return an instance matching the field and value provided, the primary key is used if no field is provided. Return
None
if no match is found or the object_id fails validation.
- get_ordering(request)#
Hook for specifying field ordering.
- get_paginator(request, queryset, per_page, orphans=0, allow_empty_first_page=True)#
- get_prepopulated_fields(request, obj=None)#
Hook for specifying custom prepopulated fields.
- get_preserved_filters(request)#
Return the preserved filters querystring.
- get_queryset(request)#
Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
- get_readonly_fields(request, obj=None)#
Hook for specifying custom readonly fields.
- get_search_fields(request)#
Return a sequence containing the fields to be searched whenever somebody submits a search query.
- get_search_results(request, queryset, search_term)#
Return a tuple containing a queryset to implement the search and a boolean indicating if the results may contain duplicates.
- get_sortable_by(request)#
Hook for specifying which fields can be sorted in the changelist.
- get_urls()#
- get_view_on_site_url(obj=None)#
- has_add_permission(request)#
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)#
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)#
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 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_module_permission(request)#
Return True if the given request has any permission in the given app label.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to view the module on the admin index page and access the module’s index page. Overriding it does not restrict access to the add, change or delete views. Use ModelAdmin.has_(add|change|delete)_permission for that.
- has_view_or_change_permission(request, obj=None)#
- has_view_permission(request, obj=None)#
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.
- history_view(request, object_id, extra_context=None)#
The ‘history’ admin view for this model.
- inlines = ()#
- list_display_links = ()#
- list_editable = ()#
- list_filter = ()#
- list_max_show_all = 200#
- list_per_page = 100#
- log_addition(request, obj, message)#
Log that an object has been successfully added.
The default implementation creates an admin LogEntry object.
- log_change(request, obj, message)#
Log that an object has been successfully changed.
The default implementation creates an admin LogEntry object.
- log_deletion(request, obj, object_repr)#
Log that an object will be deleted. Note that this method must be called before the deletion.
The default implementation creates an admin LogEntry object.
- lookup_allowed(lookup, value)#
- property media#
- message_user(request, message, level=20, extra_tags='', fail_silently=False)#
Send a message to the user. The default implementation posts a message using the django.contrib.messages backend.
Exposes almost the same API as messages.add_message(), but accepts the positional arguments in a different order to maintain backwards compatibility. For convenience, it accepts the level argument as a string rather than the usual level number.
- object_history_template = None#
- ordering = None#
- paginator#
alias of
Paginator
- popup_response_template = None#
- prepopulated_fields = {}#
- preserve_filters = True#
- radio_fields = {}#
- raw_id_fields = ()#
- readonly_fields = ()#
- render_change_form(request, context, add=False, change=False, form_url='', obj=None)#
- render_delete_form(request, context)#
- response_action(request, queryset)#
Handle an admin action. This is called if a request is POSTed to the changelist; it returns an HttpResponse if the action was handled, and None otherwise.
- response_add(request, obj, post_url_continue=None)#
Determine the HttpResponse for the add_view stage.
- response_change(request, obj)#
Determine the HttpResponse for the change_view stage.
- response_delete(request, obj_display, obj_id)#
Determine the HttpResponse for the delete_view stage.
- response_post_save_add(request, obj)#
Figure out where to redirect after the ‘Save’ button has been pressed when adding a new object.
- response_post_save_change(request, obj)#
Figure out where to redirect after the ‘Save’ button has been pressed when editing an existing object.
- save_as = False#
- save_as_continue = True#
- save_form(request, form, change)#
Given a ModelForm return an unsaved instance.
change
is True if the object is being changed, and False if it’s being added.
- save_formset(request, form, formset, change)#
Given an inline formset save it to the database.
- save_model(request, obj, form, change)#
Given a model instance save it to the database.
- save_on_top = False#
Given the
HttpRequest
, the parentModelForm
instance, the list of inline formsets and a boolean value based on whether the parent is being added or changed, save the related objects to the database. Note that at this point save_form() and save_model() have already been called.
- search_fields = ()#
- search_help_text = None#
- show_full_result_count = True#
- sortable_by = None#
- to_field_allowed(request, to_field)#
Return True if the model associated with this admin should be allowed to be referenced by the specified field.
- property urls#
- view_on_site = True#
- class fma_django.admin.ClientAggregateScoreAdmin(model, admin_site)#
Bases:
ModelAdmin
Sets the list of Client Aggregate score attributes visible to the Admin.
- list_display = ['id', 'aggregate', 'created_on']#
- action_checkbox(obj)#
A list_display column containing a checkbox widget.
- action_form#
alias of
ActionForm
- actions = ()#
- actions_on_bottom = False#
- actions_on_top = True#
- actions_selection_counter = True#
- add_form_template = None#
- add_view(request, form_url='', extra_context=None)#
- autocomplete_fields = ()#
- change_form_template = None#
- change_list_template = None#
- change_view(request, object_id, form_url='', extra_context=None)#
- changeform_view(request, object_id=None, form_url='', extra_context=None)#
- changelist_view(request, extra_context=None)#
The ‘change list’ admin view for this model.
- check(**kwargs)#
- checks_class#
alias of
ModelAdminChecks
- construct_change_message(request, form, formsets, add=False)#
Construct a JSON structure describing changes from a changed object.
- date_hierarchy = None#
- delete_confirmation_template = None#
- delete_model(request, obj)#
Given a model instance delete it from the database.
- delete_queryset(request, queryset)#
Given a queryset, delete it from the database.
- delete_selected_confirmation_template = None#
- delete_view(request, object_id, extra_context=None)#
- exclude = None#
- fields = None#
- fieldsets = None#
- filter_horizontal = ()#
- filter_vertical = ()#
- form#
alias of
ModelForm
- formfield_for_choice_field(db_field, request, **kwargs)#
Get a form Field for a database Field that has declared choices.
- formfield_for_dbfield(db_field, request, **kwargs)#
Hook for specifying the form Field instance for a given database Field instance.
If kwargs are given, they’re passed to the form Field’s constructor.
- formfield_for_foreignkey(db_field, request, **kwargs)#
Get a form Field for a ForeignKey.
- formfield_for_manytomany(db_field, request, **kwargs)#
Get a form Field for a ManyToManyField.
- formfield_overrides = {}#
- get_action(action)#
Return a given action from a parameter, which can either be a callable, or the name of a method on the ModelAdmin. Return is a tuple of (callable, name, description).
- get_action_choices(request, default_choices=[('', '---------')])#
Return a list of choices for use in a form object. Each choice is a tuple (name, description).
- get_actions(request)#
Return a dictionary mapping the names of all actions for this ModelAdmin to a tuple of (callable, name, description) for each action.
- get_autocomplete_fields(request)#
Return a list of ForeignKey and/or ManyToMany fields which should use an autocomplete widget.
- get_changeform_initial_data(request)#
Get the initial form data from the request’s GET params.
- get_changelist(request, **kwargs)#
Return the ChangeList class for use on the changelist page.
- get_changelist_form(request, **kwargs)#
Return a Form class for use in the Formset on the changelist page.
- get_changelist_formset(request, **kwargs)#
Return a FormSet class for use on the changelist page if list_editable is used.
- get_changelist_instance(request)#
Return a ChangeList instance based on request. May raise IncorrectLookupParameters.
- get_deleted_objects(objs, request)#
Hook for customizing the delete process for the delete view and the “delete selected” action.
- get_empty_value_display()#
Return the empty_value_display set on ModelAdmin or AdminSite.
- get_exclude(request, obj=None)#
Hook for specifying exclude.
- get_field_queryset(db, db_field, request)#
If the ModelAdmin specifies ordering, the queryset should respect that ordering. Otherwise don’t specify the queryset, let the field decide (return None in that case).
- get_fields(request, obj=None)#
Hook for specifying fields.
- get_fieldsets(request, obj=None)#
Hook for specifying fieldsets.
- get_form(request, obj=None, change=False, **kwargs)#
Return a Form class for use in the admin add view. This is used by add_view and change_view.
- get_formset_kwargs(request, obj, inline, prefix)#
- get_formsets_with_inlines(request, obj=None)#
Yield formsets and the corresponding inlines.
- get_inline_formsets(request, formsets, inline_instances, obj=None)#
- get_inline_instances(request, obj=None)#
- get_inlines(request, obj)#
Hook for specifying custom inlines.
- get_list_display(request)#
Return a sequence containing the fields to be displayed on the changelist.
- get_list_display_links(request, list_display)#
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)#
Return a sequence containing the fields to be displayed as filters in the right sidebar of the changelist page.
Return a list of fields to add to the select_related() part of the changelist items query.
- get_model_perms(request)#
Return a dict of all perms for this model. This dict has the keys
add
,change
,delete
, andview
mapping to the True/False for each of those actions.
- get_object(request, object_id, from_field=None)#
Return an instance matching the field and value provided, the primary key is used if no field is provided. Return
None
if no match is found or the object_id fails validation.
- get_ordering(request)#
Hook for specifying field ordering.
- get_paginator(request, queryset, per_page, orphans=0, allow_empty_first_page=True)#
- get_prepopulated_fields(request, obj=None)#
Hook for specifying custom prepopulated fields.
- get_preserved_filters(request)#
Return the preserved filters querystring.
- get_queryset(request)#
Return a QuerySet of all model instances that can be edited by the admin site. This is used by changelist_view.
- get_readonly_fields(request, obj=None)#
Hook for specifying custom readonly fields.
- get_search_fields(request)#
Return a sequence containing the fields to be searched whenever somebody submits a search query.
- get_search_results(request, queryset, search_term)#
Return a tuple containing a queryset to implement the search and a boolean indicating if the results may contain duplicates.
- get_sortable_by(request)#
Hook for specifying which fields can be sorted in the changelist.
- get_urls()#
- get_view_on_site_url(obj=None)#
- has_add_permission(request)#
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)#
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)#
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 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_module_permission(request)#
Return True if the given request has any permission in the given app label.
Can be overridden by the user in subclasses. In such case it should return True if the given request has permission to view the module on the admin index page and access the module’s index page. Overriding it does not restrict access to the add, change or delete views. Use ModelAdmin.has_(add|change|delete)_permission for that.
- has_view_or_change_permission(request, obj=None)#
- has_view_permission(request, obj=None)#
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.
- history_view(request, object_id, extra_context=None)#
The ‘history’ admin view for this model.
- inlines = ()#
- list_display_links = ()#
- list_editable = ()#
- list_filter = ()#
- list_max_show_all = 200#
- list_per_page = 100#
- log_addition(request, obj, message)#
Log that an object has been successfully added.
The default implementation creates an admin LogEntry object.
- log_change(request, obj, message)#
Log that an object has been successfully changed.
The default implementation creates an admin LogEntry object.
- log_deletion(request, obj, object_repr)#
Log that an object will be deleted. Note that this method must be called before the deletion.
The default implementation creates an admin LogEntry object.
- lookup_allowed(lookup, value)#
- property media#
- message_user(request, message, level=20, extra_tags='', fail_silently=False)#
Send a message to the user. The default implementation posts a message using the django.contrib.messages backend.
Exposes almost the same API as messages.add_message(), but accepts the positional arguments in a different order to maintain backwards compatibility. For convenience, it accepts the level argument as a string rather than the usual level number.
- object_history_template = None#
- ordering = None#
- paginator#
alias of
Paginator
- popup_response_template = None#
- prepopulated_fields = {}#
- preserve_filters = True#
- radio_fields = {}#
- raw_id_fields = ()#
- readonly_fields = ()#
- render_change_form(request, context, add=False, change=False, form_url='', obj=None)#
- render_delete_form(request, context)#
- response_action(request, queryset)#
Handle an admin action. This is called if a request is POSTed to the changelist; it returns an HttpResponse if the action was handled, and None otherwise.
- response_add(request, obj, post_url_continue=None)#
Determine the HttpResponse for the add_view stage.
- response_change(request, obj)#
Determine the HttpResponse for the change_view stage.
- response_delete(request, obj_display, obj_id)#
Determine the HttpResponse for the delete_view stage.
- response_post_save_add(request, obj)#
Figure out where to redirect after the ‘Save’ button has been pressed when adding a new object.
- response_post_save_change(request, obj)#
Figure out where to redirect after the ‘Save’ button has been pressed when editing an existing object.
- save_as = False#
- save_as_continue = True#
- save_form(request, form, change)#
Given a ModelForm return an unsaved instance.
change
is True if the object is being changed, and False if it’s being added.
- save_formset(request, form, formset, change)#
Given an inline formset save it to the database.
- save_model(request, obj, form, change)#
Given a model instance save it to the database.
- save_on_top = False#
Given the
HttpRequest
, the parentModelForm
instance, the list of inline formsets and a boolean value based on whether the parent is being added or changed, save the related objects to the database. Note that at this point save_form() and save_model() have already been called.
- search_fields = ()#
- search_help_text = None#
- show_full_result_count = True#
- sortable_by = None#
- to_field_allowed(request, to_field)#
Return True if the model associated with this admin should be allowed to be referenced by the specified field.
- property urls#
- view_on_site = True#