comments.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:MxOnline 作者: myTeemo 项目源码 文件源码
def _bulk_flag(self, queryset, action, done_message):
        """
        Flag, approve, or remove some comments from an admin action. Actually
        calls the `action` argument to perform the heavy lifting.
        """
        n_comments = 0
        for comment in queryset:
            action(self.request, comment)
            n_comments += 1

        msg = ungettext('1 comment was successfully %(action)s.',
                        '%(count)s comments were successfully %(action)s.',
                        n_comments)
        self.message_user(msg % {'count': n_comments, 'action': done_message(n_comments)}, 'success')

# Only register the default admin if the model is the built-in comment model
# (this won't be true if there's a custom comment app).
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号