Add search fields to survey admin

This commit is contained in:
Ramon Wenger 2022-05-19 11:18:38 +02:00
parent 83da3dbfcd
commit 3278774876
1 changed files with 2 additions and 0 deletions

View File

@ -38,6 +38,8 @@ class JSONAdmin(admin.ModelAdmin):
@admin.register(Survey)
class SurveyAdmin(JSONAdmin):
list_display = ('title', 'link',)
list_filter = ('module',)
search_fields = ('title', 'data')
def link(self, obj):
return format_html('<a href="/survey/{id}" target="_blank">Link</a>', id=to_global_id('SurveyNode', obj.pk))