forms.py 文件源码

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

项目:ISS 作者: RyanJenkins 项目源码 文件源码
def save(self, editor=None):
        post = self.cleaned_data['post']
        post.content = self.cleaned_data['content']

        edit_time = timezone.now() - post.created
        if edit_time.total_seconds() > utils.get_config('ninja_edit_grace_time'):
            editor_name = editor.username if editor else 'unknown'
            post.content += '\n\n[i]Post last edited by %s at %s[/i]' % (
                    editor_name, timezone.now().isoformat())

        post.save()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号