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
The selected filter does not filter the model in the admin panel
I migrated DAL==3.5.1 for django 4 (replace ugettext to gettext)
I did this because the dropdown with the autocomplete did not work and there was ----
Now I select an entry from the dropdown, but the model in the admin panel is not filtered - what could be the matter?
class OfferFilter(AutocompleteFilter):
title = _('Оффер')
field_name = 'name'
autocomplete_url = 'admin:offer-search-select'
def get_queryset_for_field(self, model, name):
return Offer.objects.all()
def queryset(self, request, queryset):
if self.value() and self.value().isdigit():
return queryset.filter(id=int(self.value()))
return queryset
The selected filter does not filter the model in the admin panel
I migrated DAL==3.5.1 for django 4 (replace ugettext to gettext)
I did this because the dropdown with the autocomplete did not work and there was ----
Now I select an entry from the dropdown, but the model in the admin panel is not filtered - what could be the matter?
Please help me.
I am migrating a very large project from django version 1.9 to >4
I want to cry
The text was updated successfully, but these errors were encountered: