diff options
author | Weitian LI <liweitianux@gmail.com> | 2014-04-25 23:02:13 +0800 |
---|---|---|
committer | Weitian LI <liweitianux@gmail.com> | 2014-04-25 23:02:13 +0800 |
commit | 53fab66f5b584d071b05f81da34ec136331ad143 (patch) | |
tree | b8c00e38352f10ca8f8e881d0b0ded899c390fa6 | |
parent | c0a125cf62c09336cbb73ab7385bd9dd93ba4cd4 (diff) | |
download | django-skaschool-53fab66f5b584d071b05f81da34ec136331ad143.tar.bz2 |
* deleted 'Notice.publisher' field
* added 'blank=True' to 'NoticeAttachment.description' field
* fixed attachment issue with 'list_notice.html' template
-rw-r--r-- | notice/models.py | 3 | ||||
-rw-r--r-- | notice/templates/notice/list_notice.html | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/notice/models.py b/notice/models.py index 5fafeb5..02780ec 100644 --- a/notice/models.py +++ b/notice/models.py @@ -14,7 +14,6 @@ class Notice(models.Model): title = models.CharField(_("Title"), max_length=100) pubtime = models.DateTimeField(_("Publish time"), auto_now_add=True) category = models.ForeignKey('NoticeCategory', verbose_name=_("Category")) - publisher = models.ForeignKey(User, verbose_name=_("Publisher")) is_important = models.BooleanField(_("Is important"), default=False) contents = models.TextField(_("Contents")) # NoticeAttachment to deal with attachments @@ -50,7 +49,7 @@ class NoticeCategory(models.Model): class NoticeAttachment(models.Model): title = models.CharField(_("Title"), max_length=100) - description = models.TextField(_("Description")) + description = models.TextField(_("Description"), blank=True) attachment = models.FileField(upload_to='notice/attachments', verbose_name=_("Attachment")) content_type = models.ForeignKey(ContentType) diff --git a/notice/templates/notice/list_notice.html b/notice/templates/notice/list_notice.html index 2a2703b..14355f0 100644 --- a/notice/templates/notice/list_notice.html +++ b/notice/templates/notice/list_notice.html @@ -26,7 +26,7 @@ <div class="notice-content"> {{ notice.contents }} </div> - {% if notice.attachments %} + {% if notice.attachments.all %} <div class="notice-attachment"> <ul class="list-unstyled"> {% for attachment in notice.attachments.all %} |