1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #26001 -- Fixed non-string field exact lookups in ModelAdmin.search_fields.

This commit is contained in:
0saurabh0
2024-11-01 08:26:10 +01:00
committed by Sarah Boyce
parent cd4497254e
commit f223729f8f
3 changed files with 48 additions and 3 deletions

View File

@@ -48,6 +48,7 @@ class ChildAdmin(admin.ModelAdmin):
list_display = ["name", "parent"]
list_per_page = 10
list_filter = ["parent", "age"]
search_fields = ["age__exact", "name__exact"]
def get_queryset(self, request):
return super().get_queryset(request).select_related("parent")