views.py 文件源码

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

项目:Kiwi 作者: kiwitcms 项目源码 文件源码
def attachment(request, case_id, template_name='case/attachment.html'):
    """Manage test case attachments"""
    SUB_MODULE_NAME = 'cases'

    file_size_limit = settings.MAX_UPLOAD_SIZE
    limit_readable = int(file_size_limit) / 2 ** 20  # Mb

    tc = get_object_or_404(TestCase, case_id=case_id)
    tp = plan_from_request_or_none(request)

    context_data = {
        'module': request.GET.get('from_plan') and 'testplans' or MODULE_NAME,
        'sub_module': SUB_MODULE_NAME,
        'testplan': tp,
        'testcase': tc,
        'limit': file_size_limit,
        'limit_readable': str(limit_readable) + "Mb",
    }
    return render(request, template_name, context_data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号