models.py 文件源码

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

项目:securethenews 作者: freedomofpress 项目源码 文件源码
def preview(self):
        """Returns the first sentence of the post, with HTML tags
        stripped, for use as a preview blurb."""
        body_text = striptags(' '.join([
            child.value.source for child in self.body
            if child.block_type == 'rich_text'
        ]))
        sentences = body_text.split('.')
        return '.'.join(sentences[:1]) + '.'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号