Admin tweaks to make it easier to look at document comments.

- Legacy-Id: 3637
This commit is contained in:
Henrik Levkowetz 2011-11-16 09:20:40 +00:00
parent 9a6d05bbbc
commit fcf9bfb169
2 changed files with 4 additions and 1 deletions

View file

@ -32,7 +32,8 @@ admin.site.register(ChairsHistory, ChairsHistoryAdmin)
class DocumentCommentAdmin(admin.ModelAdmin):
ordering=['-date']
list_display=('pk', 'doc_id', 'date', 'time', 'comment_text')
list_display=('doc_name', 'doc_id', 'date', 'time', 'comment_text')
search_fields = ['document__draft__filename', ]
admin.site.register(DocumentComment, DocumentCommentAdmin)
class EmailAddressAdmin(admin.ModelAdmin):

View file

@ -710,6 +710,8 @@ class DocumentComment(models.Model):
return datetime.datetime.combine( self.date, datetime.time( * [int(s) for s in self.time.split(":")] ) )
def doc_id(self):
return self.document_id
def doc_name(self):
return self.document.draft.filename
class Meta:
db_table = 'document_comments'