From 9a4e3be3f042e39a72e5d8f2f791d437d74051a5 Mon Sep 17 00:00:00 2001 From: Weitian LI Date: Wed, 23 Apr 2014 23:51:12 +0800 Subject: * update display attachments in list_notice template * removed 'get_attachment_list' method from Notice model --- notice/models.py | 5 ----- notice/templates/notice/list_notice.html | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'notice') diff --git a/notice/models.py b/notice/models.py index f5201d5..5fafeb5 100644 --- a/notice/models.py +++ b/notice/models.py @@ -32,11 +32,6 @@ class Notice(models.Model): # used in 'list_notice.html' template return self.pubtime.strftime('%Y-%m-%d') - def get_attachment_list(self): - # used in 'list_notice.html' template, - # because 'GenericRelatedObjectManager' is not iterable - return list(self.attachments.all()) - class NoticeCategory(models.Model): """ diff --git a/notice/templates/notice/list_notice.html b/notice/templates/notice/list_notice.html index 77d194c..2a2703b 100644 --- a/notice/templates/notice/list_notice.html +++ b/notice/templates/notice/list_notice.html @@ -29,7 +29,7 @@ {% if notice.attachments %}