Browse files

display thread subject in message admin

  • Loading branch information...
1 parent fbbca27 commit 143edeb30aeaaff1bbe44b26bd4fa4139609d56a @hannesstruss hannesstruss committed Aug 23, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 threaded_messages/admin.py
View
4 threaded_messages/admin.py
@@ -14,6 +14,10 @@ class MessageAdmin(admin.ModelAdmin):
search_fields = ('body', 'sender__first_name',
'sender__last_name', 'sender__username')
raw_id_fields = ('sender',)
+ readonly_fields = ('subject',)
+
+ def subject(self, msg):
+ return msg.thread.all()[0].subject
admin.site.register(Message, MessageAdmin)

0 comments on commit 143edeb

Please sign in to comment.