コード例 #1
0
ファイル: views.py プロジェクト: Test-Jim/HRM_system
def index(request):
    """
    首页
    :param request:
    :return:
    """
    project_length = ProjectInfo.objects.count()
    module_length = ModuleInfo.objects.count()
    test_length = TestCaseInfo.objects.filter(type__exact=1).count()
    suite_length = TestSuite.objects.count()
    total = get_total_values()

    init_filter_session(request)
    user_list = UserInfo.objects.values_list('username').distinct()
    dictUserCase = get_casesNum_by_user(user_list)

    manage_info = {
        'project_length': project_length,
        'module_length': module_length,
        'test_length': test_length,
        'suite_length': suite_length,
        'account': request.session["now_account"],
        'total': total,
        'dictUserCase': dictUserCase
    }

    return render_to_response('index.html', manage_info)
コード例 #2
0
def index(request):
    """
    首页
    :param request:
    :return:
    """
    if request.session.get('login_status'):
        project_length = ProjectInfo.objects.count()
        module_length = ModuleInfo.objects.count()
        test_length = TestCaseInfo.objects.filter(type__exact=1).count()
        suite_length = TestSuite.objects.count()

        total = get_total_values()
        manage_info = {
            'project_length': project_length,
            'module_length': module_length,
            'test_length': test_length,
            'suite_length': suite_length,
            'account': request.session["now_account"],
            'total': total
        }

        init_filter_session(request)
        return render_to_response('index.html', manage_info)
    else:
        return HttpResponseRedirect("/api/login/")
コード例 #3
0
ファイル: views.py プロジェクト: win-123/Autotest
def index(request):
    """
    首页展示
    :param request:
    :return:
    """
    project_length = ProjectInfo.objects.count()  # 项目数量
    module_length = ModuleInfo.objects.count()  # 模块数量
    test_length = TestCaseInfo.objects.filter(type__exact=1).count()  # 测试用例数
    suite_length = TestSuite.objects.count()  # 用例集合数

    total = get_total_values()
    manage_info = {
        'project_length': project_length,
        'module_length': module_length,
        'test_length': test_length,
        'suite_length': suite_length,
        'account': request.session["now_account"],
        'total': total
    }

    init_filter_session(request)
    return render_to_response('index.html', manage_info)