Admin tweaks to make it easier to look at document comments.
- Legacy-Id: 3637
This commit is contained in:
parent
9a6d05bbbc
commit
fcf9bfb169
|
@ -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):
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
Loading…
Reference in a new issue