class documentation

class AutocompleteJsonView(BaseListView):

View In Hierarchy

Handle AutocompleteWidget's AJAX requests for data.
Method get No summary
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):

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):
Use the ModelAdmin's paginator.
def get_queryset(self):
Return queryset based on ModelAdmin.get_search_results().
def has_perm(self, request, obj=None):
Check if user has permission to access the related model.
def process_request(self, request):

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):
Convert the provided model object to a dictionary that is added to the results list.
admin_site =

Undocumented

paginate_by: int =
model_admin =

Undocumented

object_list =
source_field =

Undocumented

term =

Undocumented