Skip to content

Commit

Permalink
Merge pull request #2 from liangliangyy/dev
Browse files Browse the repository at this point in the history
修改后台评论界面
  • Loading branch information
liangliangyy committed Mar 24, 2017
2 parents 387f1b6 + 28fa800 commit ff02be9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion comments/admin.py
Expand Up @@ -3,4 +3,12 @@
# Register your models here.
from .models import Comment

admin.site.register(Comment)

class CommentAdmin(admin.ModelAdmin):
list_display = ('id', 'body', 'author', 'article', 'last_mod_time')
list_display_links = ('id', 'body')
list_filter = ('author', 'article',)
exclude = ('created_time', 'last_mod_time')


admin.site.register(Comment, CommentAdmin)
3 changes: 3 additions & 0 deletions comments/models.py
Expand Up @@ -30,6 +30,9 @@ def send_comment_email(self, msg):
except:
pass

def __str__(self):
return self.body

def save(self, *args, **kwargs):
super().save(*args, **kwargs)
subject = '感谢您发表的评论'
Expand Down

0 comments on commit ff02be9

Please sign in to comment.