class documentation

class AutocompleteJsonView(BaseListView): (source)

View In Hierarchy

Handle AutocompleteWidget's AJAX requests for data.

Method get Return a JsonResponse with search results as defined in serialize_result(), by default: { results: [{id: "123" text: "foo"}], pagination: {more: true} }
Method get_paginator Use the ModelAdmin's paginator.
Method get_queryset Return queryset based on ModelAdmin.get_search_results().
Method has_perm Check if user has permission to access the related model.
Method process_request Validate request integrity, extract and return request parameters.
Method serialize_result Convert the provided model object to a dictionary that is added to the results list.
Class Variable admin_site Undocumented
Class Variable paginate_by Undocumented
Instance Variable model_admin Undocumented
Instance Variable object_list Undocumented
Instance Variable source_field Undocumented
Instance Variable term Undocumented

Inherited from MultipleObjectMixin (via BaseListView):

Method get_allow_empty Return ``True`` if the view should display empty lists and ``False`` if a 404 should be raised instead.
Method get_context_data Get the context for this view.
Method get_context_object_name Get the name of the item to be used in the context.
Method get_ordering Return the field or fields to use for ordering the queryset.
Method get_paginate_by Get the number of items to paginate by, or ``None`` for no pagination.
Method get_paginate_orphans Return the maximum number of orphans extend the last page by when paginating.
Method paginate_queryset Paginate the queryset, if needed.
Class Variable allow_empty Undocumented
Class Variable context_object_name Undocumented
Class Variable model Undocumented
Class Variable ordering Undocumented
Class Variable page_kwarg Undocumented
Class Variable paginate_orphans Undocumented
Class Variable queryset Undocumented

Inherited from ContextMixin (via BaseListView, MultipleObjectMixin):

Class Variable extra_context Undocumented
def get(self, request, *args, **kwargs): (source)

Return a JsonResponse with search results as defined in serialize_result(), by default: { results: [{id: "123" text: "foo"}], pagination: {more: true} }

def get_paginator(self, *args, **kwargs): (source)

Use the ModelAdmin's paginator.

def get_queryset(self): (source)

Return queryset based on ModelAdmin.get_search_results().

def has_perm(self, request, obj=None): (source)

Check if user has permission to access the related model.

def process_request(self, request): (source)

Validate request integrity, extract and return request parameters. Since the subsequent view permission check requires the target model admin, which is determined here, raise PermissionDenied if the requested app, model or field are malformed. Raise Http404 if the target model admin is not configured properly with search_fields.

def serialize_result(self, obj, to_field_name): (source)

Convert the provided model object to a dictionary that is added to the results list.

admin_site = (source)

Undocumented

model_admin = (source)

Undocumented

source_field = (source)

Undocumented

Undocumented