Example #1
0
def idc(request, page):
    all_idc = Idc.objects.all()
    per_item = 5
    page = common.try_int(page, 1)
    count = Idc.objects.all().count()
    pageObj = html_helper_idc.PageInfo(page, count, per_item)
    result = Idc.objects.all()[pageObj.start:pageObj.end]
    page_string = html_helper_idc.Page(page, pageObj.all_page_count)
    ret = {'data': result, 'count': count, 'page': page_string}
    response = render_to_response('idc.html', ret)
    response.set_cookie('page_num', per_item)
    return response
    return render_to_response("idc.html", {'data': all_idc})
Example #2
0
def contain_test(request, page):
    all_contain = ContainsList_Test.objects.all()
    all_contain_of_host = HostList_Test.objects.all()
    per_item = 15
    page = common.try_int(page, 1)
    count = ContainsList_Test.objects.all().count()
    pageObj = html_helper.PageInfo(page, count, per_item)
    result = ContainsList_Test.objects.all()[pageObj.start:pageObj.end]
    page_string = html_helper.Page(page, pageObj.all_page_count)
    ret = {'data': result, 'count': count, 'page': page_string}
    response = render_to_response('contain_test.html', ret)
    response.set_cookie('page_num', per_item)
    return response
    return render_to_response("contain_test.html", {'data': all_contain})