Exemple #1
0
def depart_list(request):
    page = request.GET.get('page')  # 获取访问的分页页码
    count = models.Department.objects.all().count()  # 获取总条数
    pager = Pagination(page, count, request.path_info)

    all_depart = models.Department.objects.all()[pager.start:pager.end]  # 切片页面
    return render(request, 'depart_list.html',
                  {'all_depart': all_depart, 'page_html': pager.page_html})
Exemple #2
0
def user_list(request):
    page = request.GET.get('page', 1)
    total_count = models.UserInfo.objects.all().count()
    pager = Pagination(page, total_count, '/crm/user/list/')
    user_queryset = models.UserInfo.objects.all()[pager.start:pager.end]

    # user_queryset = models.UserInfo.objects.all()
    return render(request, 'user_list.html', {
        'user_queryset': user_queryset,
        'pager': pager
    })
Exemple #3
0
def depart_list(request):
    page = request.GET.get('page', 1)
    total_count = models.Department.objects.all().count()

    pager = Pagination(page, total_count, '/crm/depart/list/')
    depart_queryset = models.Department.objects.all()[pager.start:pager.end]
    # depart_queryset = models.Department.objects.all()
    return render(request, 'depart_list.html', {
        'depart_queryset': depart_queryset,
        'pager': pager
    })
Exemple #4
0
def depart_list(request):
    """

    :param request:
    :return:
    """
    # 要查看的页码
    page = request.GET.get('page', 1)

    # 数据库中数据总条数

    total_count = models.Department.objects.all().count()

    #
    pager = Pagination(page, total_count, '/crm/depart/list/')

    depart_queryset = models.Department.objects.all()[pager.start:pager.end]
    return render(request, 'depart_list.html', {"depart_queryset": depart_queryset, 'pager': pager})
Exemple #5
0
def user_list(request):
    """

    :param request:
    :return:
    """
    # 要查看的页码
    page = request.GET.get('page', 1)

    # 数据库中数据总条数

    total_count = models.UserInfo.objects.all().count()

    #
    pager = Pagination(page, total_count, '/crm/user/list/')
    user_queryset = models.UserInfo.objects.all()[pager.start:pager.end]
    return render(request, 'user_list.html', {
        "user_queryset": user_queryset,
        'pager': pager
    })
Exemple #6
0
Fichier : bj.py Projet : cnmhl/crm
def bj_list(request):
    """

    :param request:
    :return:
    """
    # 要查看的页码
    page = request.GET.get('page', 1)

    # 数据库中数据总条数

    total_count = models.ClassList.objects.all().count()

    #
    pager = Pagination(page, total_count, '/crm/bj/list/')
    bj_queryset = models.ClassList.objects.all()[pager.start:pager.end]
    return render(request, 'bj_list.html', {
        "bj_queryset": bj_queryset,
        'pager': pager
    })