forms.py 文件源码

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

项目:harnas 作者: harnasproject 项目源码 文件源码
def clean(self):
        solution = self.cleaned_data['solution']
        max_solution_size = self.cleaned_data['task'].max_solution_size
        if solution._size > max_solution_size:
            error_message = 'You cannot upload files larger than %(max_size)s.'
            max_size = filesizeformat(max_solution_size)
            raise forms.ValidationError(_(error_message),
                                        params={'max_size': max_size},
                                        code='too_large_solution')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号