Commits

Jens Diemer committed a6c8ec7

[PATCH] see subscribers usernames in TopicAdmin

  • Participants
  • Parent commits 255f5da

Comments (0)

Files changed (1)

djangobb_forum/admin.py

 from django.contrib import admin
 from django.contrib.auth import admin as auth_admin
 from django.contrib.auth.models import User
+from django.utils.translation import ugettext_lazy as _
 
 from djangobb_forum.models import Category, Forum, Topic, Post, Profile, Reputation, \
     Report, Ban, Attachment
     raw_id_fields = ['moderators', 'last_post']
 
 class TopicAdmin(admin.ModelAdmin):
-    list_display = ['name', 'forum', 'created', 'head', 'post_count']
+    def subscribers2(self, obj):
+        return ", ".join([user.username for user in obj.subscribers.all()])
+    subscribers2.short_description = _("subscribers")
+
+    list_display = ['name', 'forum', 'created', 'head', 'post_count', 'subscribers2']
     search_fields = ['name']
     raw_id_fields = ['user', 'subscribers', 'last_post']