Skip to content

Commit 21cd74a

Browse files
committed
Added search field and tweaked the list display for the DocAlias admin.
- Legacy-Id: 18451
1 parent d63e827 commit 21cd74a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

ietf/doc/admin.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ def state(self, instance):
102102
admin.site.register(DocHistory, DocHistoryAdmin)
103103

104104
class DocAliasAdmin(admin.ModelAdmin):
105-
# list_display = ['name', 'document_link']
106-
# search_fields = ['name', 'document__name']
105+
list_display = ['name', 'targets']
106+
search_fields = ['name', 'docs__name']
107107
raw_id_fields = ['docs']
108+
def targets(self, obj):
109+
return ', '.join([o.name for o in obj.docs.all()])
108110
admin.site.register(DocAlias, DocAliasAdmin)
109111

110112
class DocReminderAdmin(admin.ModelAdmin):

0 commit comments

Comments
 (0)