Ejemplo n.º 1
0
def testList(request):
    """Handle request for list of tests according `request`.
    
    :Parameters:
        request: django html request (`path` and `REQUEST` will be used)
        .. See: testListAttrs for used attributes
        
    :Return:
        html code (full page) with list of tests matching filtering attributes
    """
    attrs = {}
    for attr in testListAttrs:
        try:
            attrs[attr] = request.REQUEST[attr]
        except KeyError:
            pass

    testList = filterByAttrs(TestRun.objects.all(), attrs)

    try:
        ordering = attrs['orderBy']
    except KeyError:
        ordering = '-startTime'
    testList = testList.order_by(ordering)

    header = generateHeaderForAttrs(attrs)
    (paginationHtml, pageObjects) = generatePagination(request.path, attrs,
                                                       testList,
                                                       DEFAULT_PAGING)
    mainTableHtml = generateTestTable(request.path, pageObjects, attrs)
    releasementsHtml = generateAttrReleasementLinks(request.path, attrs,
                                                    _("Don't filter by "))
    overviewHtml = "total: " + str(testList.count())

    return render_to_response(
        'resultRepository/testrun_list.html', {
            'title': header,
            'header': header,
            'globalMenu': globalMenu,
            'pagination': paginationHtml,
            'attrReleasements': releasementsHtml,
            'overview': overviewHtml,
            'bodyTable': mainTableHtml,
        })
Ejemplo n.º 2
0
def projectList(request):
    if 'page' in request.REQUEST:
        attrs = {'page' : request.REQUEST['page']}
    else:
        attrs = {}
    projects = Project.objects.all()
    total = "total:"+ str(projects.count())
    header = "Projects"
    (paginationHtml, projects) = generatePagination(request.path, attrs, projects, DEFAULT_PAGING)
    mainTableHtml = generateProjectList(projects)
    
    return render_to_response('resultRepository/project_list.html',
                                                {
                                        'title': header,
                                        'header': header,
                                        'globalMenu' : globalMenu,
                                        'pagination': paginationHtml,
                                        'overview' : total,
                                        'bodyTable' : mainTableHtml,
                                                })
Ejemplo n.º 3
0
def batchList(request):
    """Handle request for list of batches according `request`.
    
    :Parameters:
        request: django html request (`path` and `REQUEST` will be used)
        .. See: batchListAttrs for used attributes
        
    :Return:
        html code (full page) with list of batches matching filtering attributes
    """
    attrs = {}
    for attr in batchListAttrs:
        try: 
            attrs[attr] = request.REQUEST[attr]
        except KeyError:
            pass
            
    batchList = filterByAttrs(BatchRun.objects.all(), attrs)
    
    try:
        ordering = attrs['orderBy']
    except KeyError:
        ordering = '-startTime'
    batchList = batchList.order_by(ordering)
    
    header = 'Batch list'
    (paginationHtml,pageObjects) = generatePagination(request.path, attrs, batchList, DEFAULT_PAGING)
    mainTableHtml = generateBatchTable(request.path, pageObjects, attrs)
    releasementsHtml = generateAttrReleasementLinks(request.path, attrs, _("Don't filter by "))
    overviewHtml = "total: " + str(batchList.count())
            
    return render_to_response('resultRepository/testrun_list.html',
                                                {
                                        'title': header,
                                        'header': header,
                                        'globalMenu' : globalMenu,
                                        'pagination' : paginationHtml,
                                        'attrReleasements' : releasementsHtml,
                                        'overview' : overviewHtml,
                                        'bodyTable' : mainTableHtml,
                                                })
Ejemplo n.º 4
0
def projectList(request):
    if 'page' in request.REQUEST:
        attrs = {'page': request.REQUEST['page']}
    else:
        attrs = {}
    projects = Project.objects.all()
    total = "total:" + str(projects.count())
    header = "Projects"
    (paginationHtml, projects) = generatePagination(request.path, attrs,
                                                    projects, DEFAULT_PAGING)
    mainTableHtml = generateProjectList(projects)

    return render_to_response(
        'resultRepository/project_list.html', {
            'title': header,
            'header': header,
            'globalMenu': globalMenu,
            'pagination': paginationHtml,
            'overview': total,
            'bodyTable': mainTableHtml,
        })