mirror of
https://github.com/django/django.git
synced 2025-10-28 08:06:09 +00:00
Fixed #16117 -- Added decorators for admin action and display functions.
Refs #25134, #32099.
This commit is contained in:
@@ -19,6 +19,7 @@ class EventAdmin(admin.ModelAdmin):
|
||||
date_hierarchy = 'date'
|
||||
list_display = ['event_date_func']
|
||||
|
||||
@admin.display
|
||||
def event_date_func(self, event):
|
||||
return event.date
|
||||
|
||||
@@ -171,6 +172,6 @@ class EmptyValueChildAdmin(admin.ModelAdmin):
|
||||
empty_value_display = '-empty-'
|
||||
list_display = ('name', 'age_display', 'age')
|
||||
|
||||
@admin.display(empty_value='†')
|
||||
def age_display(self, obj):
|
||||
return obj.age
|
||||
age_display.empty_value_display = '†'
|
||||
|
||||
Reference in New Issue
Block a user