Server : Apache System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64 User : dh_edsupp ( 6597262) PHP Version : 8.2.26 Disable Function : NONE Directory : /lib/python3/dist-packages/django/contrib/admin/views/__pycache__/ |
Upload File : |
o 3�a0 � @ sL d dl mZ d dlmZmZ d dlmZmZ d dlm Z G dd� de �Z dS )� )�apps)�FieldDoesNotExist�PermissionDenied)�Http404�JsonResponse)�BaseListViewc @ sB e Zd ZdZdZdZdd� Zdd� Zdd � Zd d� Z ddd �Z dS )�AutocompleteJsonViewz3Handle AutocompleteWidget's AJAX requests for data.� Nc sd | � |�\| _| _| _� | �|�st�| �� | _| �� }t � fdd�|d D �d|d � � id��S )z� Return a JsonResponse with search results of the form: { results: [{id: "123" text: "foo"}], pagination: {more: true} } c s$ g | ]}t t|� ��t |�d ��qS ))�id�text)�str�getattr)�.0�obj�� to_field_name� �I/usr/lib/python3/dist-packages/django/contrib/admin/views/autocomplete.py� <listcomp> s ��z,AutocompleteJsonView.get.<locals>.<listcomp>�object_list�more�page_obj)�results� pagination)�process_request�term�model_admin�source_field�has_permr �get_querysetr �get_context_datar �has_next)�self�request�args�kwargs�contextr r r �get s ��zAutocompleteJsonView.getc O s | j j| jg|�R i |��S )zUse the ModelAdmin's paginator.)r � get_paginatorr# )r"