categories.base.CategoryBaseAdmin

CategoryBaseAdmin#

class categories.base.CategoryBaseAdmin(*args, **kwargs)[source]#

Base admin class for categories.

Methods

action_checkbox(obj)

A list_display column containing a checkbox widget.

activate(request, queryset)

Set active to True for selected items.

add_view(request[, form_url, extra_context])

change_view(request, object_id[, form_url, ...])

changeform_view(request[, object_id, ...])

changelist_view(request[, extra_context])

Handle the changelist view, the django view for the model instances change list/actions page.

check(**kwargs)

construct_change_message(request, form, formsets)

Construct a JSON structure describing changes from a changed object.

deactivate(request, queryset)

Set active to False for selected items.

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_view(request, object_id[, extra_context])

formfield_for_choice_field(db_field, ...)

Get a form Field for a database Field that has declared choices.

formfield_for_dbfield(db_field, request, ...)

Hook for specifying the form Field instance for a given database Field instance.

formfield_for_foreignkey(db_field, request, ...)

Get a form Field for a ForeignKey.

formfield_for_manytomany(db_field, request, ...)

Get a form Field for a ManyToManyField.

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.

get_action_choices(request[, default_choices])

Return a list of choices for use in a form object.

get_actions(request)

Get available actions for the admin interface.

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)

Returns 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.

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])

Hook for specifying exclude.

get_field_queryset(db, db_field, request)

If the ModelAdmin specifies ordering, the queryset should respect that ordering.

get_fields(request[, obj])

Hook for specifying fields.

get_fieldsets(request[, obj])

Hook for specifying fieldsets.

get_form(request[, obj, change])

Return a Form class for use in the admin add view.

get_formsets_with_inlines(request[, obj])

Yield formsets and the corresponding inlines.

get_inline_formsets(request, formsets, ...)

get_inline_instances(request[, obj])

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.

get_list_filter(request)

Return a sequence containing the fields to be displayed as filters in the right sidebar of the changelist page.

get_list_select_related(request)

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.

get_object(request, object_id[, from_field])

Return an instance matching the field and value provided, the primary key is used if no field is provided.

get_ordering(request)

Hook for specifying field ordering.

get_paginator(request, queryset, per_page[, ...])

get_prepopulated_fields(request[, obj])

Hook for specifying custom prepopulated fields.

get_preserved_filters(request)

Return the preserved filters querystring.

get_queryset(request)

Returns a QuerySet of all model instances that can be edited by the admin site.

get_readonly_fields(request[, obj])

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, ...)

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])

has_add_permission(request)

Return True if the given request has permission to add an object.

has_change_permission(request[, obj])

Return True if the given request has permission to change the given Django model instance, the default implementation doesn't examine the obj parameter.

has_delete_permission(request[, obj])

Return True if the given request has permission to change the given Django model instance, the default implementation doesn't examine the obj parameter.

has_module_permission(request)

Return True if the given request has any permission in the given app label.

has_view_or_change_permission(request[, obj])

has_view_permission(request[, obj])

Return True if the given request has permission to view the given Django model instance.

history_view(request, object_id[, extra_context])

The 'history' admin view for this model.

log_addition(request, object, message)

Log that an object has been successfully added.

log_change(request, object, message)

Log that an object has been successfully changed.

log_deletion(request, object, object_repr)

Log that an object will be deleted.

lookup_allowed(lookup, value)

message_user(request, message[, level, ...])

Send a message to the user.

old_changelist_view(request[, extra_context])

The 'change list' admin view for this model.

render_change_form(request, context[, add, ...])

render_delete_form(request, context)

response_action(request, queryset)

Handle an admin action.

response_add(request, obj[, post_url_continue])

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_form(request, form, change)

Given a ModelForm return an unsaved instance.

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_related(request, form, formsets, change)

Given the HttpRequest, the parent ModelForm 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.

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.

Attributes

actions

actions_on_bottom

actions_on_top

actions_selection_counter

add_form_template

autocomplete_fields

change_form_template

change_list_template

date_hierarchy

delete_confirmation_template

delete_selected_confirmation_template

exclude

fields

filter_horizontal

filter_vertical

formfield_overrides

inlines

list_display

list_display_links

list_editable

list_filter

list_max_show_all

list_per_page

list_select_related

media

object_history_template

ordering

popup_response_template

prepopulated_fields

preserve_filters

radio_fields

raw_id_fields

readonly_fields

save_as

save_as_continue

save_on_top

search_fields

show_full_result_count

sortable_by

urls

view_on_site