mirror of
https://github.com/django/django.git
synced 2025-10-25 06:36:07 +00:00
Fixed #24474 -- Allowed configuring the admin's empty change list value.
This commit is contained in:
committed by
Tim Graham
parent
40f0a84cb1
commit
0207bdd2d4
@@ -130,3 +130,12 @@ class DynamicSearchFieldsChildAdmin(admin.ModelAdmin):
|
||||
search_fields = super(DynamicSearchFieldsChildAdmin, self).get_search_fields(request)
|
||||
search_fields += ('age',)
|
||||
return search_fields
|
||||
|
||||
|
||||
class EmptyValueChildAdmin(admin.ModelAdmin):
|
||||
empty_value_display = '-empty-'
|
||||
list_display = ('name', 'age_display', 'age')
|
||||
|
||||
def age_display(self, obj):
|
||||
return obj.age
|
||||
age_display.empty_value_display = '†'
|
||||
|
||||
Reference in New Issue
Block a user