You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from dal import autocomplete
from django_admin_listfilter_dropdown.filters import RelatedDropdownFilter
class ProductFilter(RelatedDropdownFilter):
def field_choices(self, field, request, model_admin):
# Aqui não retorna nada, pois usamos o autocomplete no widget
return []
def widget(self, field, request):
return autocomplete.ModelSelect2(
url='product-autocomplete',
attrs={
'data-placeholder': 'Search for a product...',
'data-minimum-input-length': 1, # Ativa a pesquisa após um caractere
}
)
Can someone help me?
The text was updated successfully, but these errors were encountered:
Hi,
I tried a lot here and chatgpt build a filter in
list_filter
that is a product selector.In the admin form it works without problems:
But in
list_filter
it show nothing:My code:
Can someone help me?
The text was updated successfully, but these errors were encountered: