[PATCH] see subscribers usernames in TopicAdmin
This commit is contained in:
parent
69463855d1
commit
b9b232784e
1 changed files with 6 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
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
|
||||
|
@ -15,7 +16,11 @@ class ForumAdmin(admin.ModelAdmin):
|
|||
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']
|
||||
|
||||
|
|
Reference in a new issue