diff --git a/boards/admin.py b/boards/admin.py --- a/boards/admin.py +++ b/boards/admin.py @@ -30,7 +30,10 @@ class TagAdmin(admin.ModelAdmin): def thread_count(self, obj: Tag) -> int: return obj.get_thread_count() - list_display = ('name', 'thread_count') + def display_children(self, obj: Tag): + return ', '.join([str(child) for child in obj.get_children().all()]) + + list_display = ('name', 'thread_count', 'display_children') search_fields = ('name',) @@ -46,7 +49,14 @@ class ThreadAdmin(admin.ModelAdmin): def ip(self, obj: Thread): return obj.get_opening_post().poster_ip - list_display = ('id', 'title', 'reply_count', 'archived', 'ip') + def display_tags(self, obj: Thread): + return ', '.join([str(tag) for tag in obj.get_tags().all()]) + + def op(self, obj: Thread): + return obj.get_opening_post_id() + + list_display = ('id', 'op', 'title', 'reply_count', 'archived', 'ip', + 'display_tags') list_filter = ('bump_time', 'archived', 'bumpable') search_fields = ('id', 'title') filter_horizontal = ('tags',)