예제 #1
0
def get_del(request):
    order = Orders.objects.filter(is_status=0)
    # 获取关键字类型
    keyword_name = request.GET.get('keyword_name', '')
    # 获取关键字
    keyword = request.GET.get('keyword', '')
    # 关键词选择
    if keyword_name == 'username':
        if keyword:
            order = order.filter(user_id__nickname__contains=keyword)
    elif keyword_name == 'realname':
        if keyword:
            order = order.filter(real_name__contains=keyword)
    else:
        if keyword:
            order = order.filter(phone__contains=keyword)
    orders = order
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, order)
    context = {
        'order': pages['data'],
        'orders': orders,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword_name': keyword_name,
        'keyword': keyword
    }
    return render(request, 'order/order-del.html', context=context)
예제 #2
0
파일: views.py 프로젝트: showzvan/mysite
def get_del_major(request):
    major = Majors.objects.filter(is_status=0)
    # 获取关键字类型
    keyword_name = request.GET.get('keyword_name', '')
    # 获取关键字
    keyword = request.GET.get('keyword', '')

    # 关键词选择
    if keyword_name == 'major':
        if keyword:
            major = major.filter(major_name__contains=keyword)
    elif keyword_name == 'school':
        if keyword:
            major = major.filter(school__name__contains=keyword)
    majors = major
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, major)
    context = {
        'major': pages['data'],
        'majors': majors,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword_name': keyword_name,
        'keyword': keyword
    }
    return render(request, 'major/major-del.html', context=context)
예제 #3
0
파일: views.py 프로젝트: showzvan/mysite
def indexList(request):
    users = Users.objects.filter(is_status=1)
    # 获取时间类型
    time_type = request.GET.get('time_type', '')
    # 获取开始时间
    start_time = request.GET.get('start_time', '')
    # 获取结束时间
    end_time = request.GET.get('end_time', '')
    # 获取关键字类型
    keyword_name = request.GET.get('keyword_name', '')
    # 获取关键字
    keyword = request.GET.get('keyword', '')
    # 如果选择的是注册时间
    if time_type == 'reg-time':
        if start_time:
            if end_time:
                users = users.filter(reg_time__range=(start_time, end_time))
            else:
                users = users.filter(reg_time__gte=start_time)
        elif end_time:
            if not start_time:
                users = users.filter(reg_time__lte=end_time)
    # 如果选择的是登录时间
    if time_type == 'login-time':
        if start_time:
            if end_time:
                users = users.filter(last_time__range=(start_time, end_time))
            else:
                users = users.filter(last_time__gte=start_time)
        elif end_time:
            if not start_time:
                users = users.filter(last_time__lte=end_time)
    # 关键词选择
    if keyword_name == 'username':
        if keyword:
            users = users.filter(nickname__contains=keyword)
    elif keyword_name == 'userphone':
        if keyword:
            users = users.filter(phone__contains=keyword)
    else:
        if keyword:
            users = users.filter(email__contains=keyword)

    user = users
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, users)
    context = {
        'users': pages['data'],
        'user': user,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword': keyword,
        'start_time': start_time,
        'end_time': end_time,
        'time_type': time_type,
        'keyword_name': keyword_name
    }
    return render(request, 'user/users-list.html', context=context)
예제 #4
0
파일: views.py 프로젝트: showzvan/education
def get_del(request):
    order = Orders.objects.filter(is_status=0)
    orders = order
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, order)
    context = {
        'order': pages['data'],
        'orders': orders,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
    }
    return render(request, 'order/order-del.html', context=context)
예제 #5
0
파일: views.py 프로젝트: showzvan/mysite
def admin_list(request):
    ad_user = Admins.objects.filter(is_status=1)
    # 获取时间类型
    time_type = request.GET.get('time_type', '')
    # 获取开始时间
    start_time = request.GET.get('start_time', '')
    # 获取结束时间
    end_time = request.GET.get('end_time', '')
    # 获取关键字
    keyword = request.GET.get('keyword', '')
    # 如果选择的是注册时间
    if time_type == 'reg-time':
        if start_time:
            if end_time:
                ad_user = ad_user.filter(reg_time__range=(start_time,
                                                          end_time))
            else:
                ad_user = ad_user.filter(reg_time__gte=start_time)
        elif end_time:
            if not start_time:
                ad_user = ad_user.filter(reg_time__lte=end_time)
    # 如果选择的是登录时间
    if time_type == 'login-time':
        if start_time:
            if end_time:
                ad_user = ad_user.filter(last_time__range=(start_time,
                                                           end_time))
            else:
                ad_user = ad_user.filter(last_time__gte=start_time)
        elif end_time:
            if not start_time:
                ad_user = ad_user.filter(last_time__lte=end_time)
    # 关键词选择
    if keyword:
        ad_user = ad_user.filter(admin_name__contains=keyword)
    ad_users = ad_user

    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, ad_user)
    context = {
        'ad_user': pages['data'],
        'ad_users': ad_users,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword': keyword,
        'start_time': start_time,
        'end_time': end_time,
        'time_type': time_type,
    }
    return render(request, 'user/admin-list.html', context=context)
예제 #6
0
파일: views.py 프로젝트: showzvan/education
def get_del_sch(request):
    school = Schools.objects.filter(is_status=0)
    schools = school
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, school)
    context = {
        'school': pages['data'],
        'schools': schools,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
    }
    return render(request, 'school/school_del.html', context=context)
예제 #7
0
파일: views.py 프로젝트: showzvan/education
def delete_user_list(request):
    users = Users.objects.filter(is_status=0)
    user_p = users
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, users)
    context = {
        'users': pages['data'],
        'user_p': user_p,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
    }
    return render(request, 'user/delete_user_list.html', context=context)
예제 #8
0
파일: views.py 프로젝트: showzvan/education
def delete_admin_list(request):
    ad_user = Admins.objects.filter(is_status=0)
    ad_users = ad_user
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, ad_user)
    context = {
        'ad_user': pages['data'],
        'ad_users': ad_users,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
    }
    return render(request, 'user/delete_admin_list.html', context=context)
예제 #9
0
파일: views.py 프로젝트: showzvan/education
def get_del_major(request):
    major = Majors.objects.filter(is_status=0)
    majors = major
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, major)
    context = {
        'major': pages['data'],
        'majors': majors,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
    }
    return render(request, 'major/major-del.html', context=context)
예제 #10
0
파일: views.py 프로젝트: showzvan/education
def get_cate(request):
    cate = MajorCates.objects.filter(is_status=1)
    cates = cate

    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, cate)
    context = {
        'cate': pages['data'],
        'cates': cates,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
    }
    return render(request, 'major/cate-list.html', context=context)
예제 #11
0
def get_del(request):
    posts = Posts.objects.filter(is_status=0)
    post = posts
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, posts)
    context = {
        'data': pages['data'],
        'posts': post,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range']
    }
    return render(request, 'posts/posts-del.html', context=context)
예제 #12
0
def get_del_regions(request):
    regions = Regions.objects.filter(is_status=0)
    # 获取关键字
    keyword = request.GET.get('keyword', '')

    if keyword:
        regions = regions.filter(cityname__contains=keyword)
    region = regions
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, regions)
    context = {
        'data': pages['data'],
        'regions': region,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword': keyword
    }
    return render(request, 'detail/del_regions.html', context=context)
예제 #13
0
def get_del_files(request):
    file = AQuestions.objects.filter(is_status=0)
    # 获取关键字
    keyword = request.GET.get('keyword', '')

    if keyword:
        file = file.filter(name__contains=keyword)
    files = file
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, file)
    context = {
        'data': pages['data'],
        'file': files,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword':keyword
    }
    return render(request, 'server/del_file-list.html', context=context)
예제 #14
0
def get_del_enclosure(request):
    enclosure = Attachments.objects.filter(is_status=0)
    # 获取关键字
    keyword = request.GET.get('keyword', '')

    if keyword:
        enclosure = enclosure.filter(name__contains=keyword)
    enclosures = enclosure
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, enclosure)
    context = {
        'data': pages['data'],
        'enclosure': enclosures,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword':keyword
    }
    return render(request,'server/del_enclosure.html',context=context)
예제 #15
0
def get_del_cate(request):
    cate = ServerCategorys.objects.filter(is_status=0)
    # 获取关键字
    keyword = request.GET.get('keyword', '')

    if keyword:
        cate = cate.filter(catename__contains=keyword)
    cates = cate
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, cate)
    context = {
        'data': pages['data'],
        'cate': cates,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword':keyword
    }
    return render(request, 'server/del-cate.html', context=context)
예제 #16
0
def del_ser_list(request):
    server_posts = ServerPosts.objects.filter(is_status=0)
    # 获取关键字
    keyword = request.GET.get('keyword', '')

    if keyword:
        server_posts = server_posts.filter(post_title__contains=keyword)
    server_post = server_posts
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, server_posts)
    context = {
        'data': pages['data'],
        'posts': server_post,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword':keyword
    }
    return render(request, 'server/server_del_posts-list.html', context=context)
예제 #17
0
def get_del_type(request):
    type = SchoolType.objects.filter(is_status=0)
    # 获取关键字
    keyword = request.GET.get('keyword', '')
    # 关键词选择
    if keyword:
        type = type.filter(type_name__contains=keyword)
    types = type
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, type)
    context = {
        'types': pages['data'],
        'type': types,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword':keyword
    }
    return render(request, 'school/del_type.html', context=context)
예제 #18
0
def get_del_feature(request):
    feature = SchoolFeatures.objects.filter(is_status=0)
    # 获取关键字
    keyword = request.GET.get('keyword', '')
    # 关键词选择
    if keyword:
        feature = feature.filter(feature_name__contains=keyword)
    features = feature
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, feature)
    context = {
        'data': pages['data'],
        'feature': features,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword':keyword
    }
    return render(request, 'school/del_feature.html', context=context)
예제 #19
0
def inner_link(request):
    links = Links.objects.filter(is_status=1)
    # 获取关键字
    keyword = request.GET.get('keyword', '')

    if keyword:
        links = links.filter(link_title__contains=keyword)
    link = links
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, links)
    context = {
        'data': pages['data'],
        'links': link,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword': keyword
    }
    return render(request, 'detail/inner_link.html', context=context)
예제 #20
0
def get_posts(request):
    posts = Posts.objects.filter(is_status=1)
    # 获取关键字
    keyword = request.GET.get('keyword', '')

    if keyword:
        posts = posts.filter(post_title__contains=keyword)
    post = posts
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, posts)
    context = {
        'data': pages['data'],
        'posts': post,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword': keyword
    }
    return render(request, 'posts/posts-list.html', context=context)
예제 #21
0
def del_center_list(request):
    center = Centers.objects.filter(is_status=0)
    # 获取关键字
    keyword = request.GET.get('keyword', '')

    if keyword:
        center = center.filter(name__contains=keyword)
    centers = center
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, center)
    context = {
        'data': pages['data'],
        'center': centers,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword':keyword
    }

    return render(request,'server/del_center-list.html',context=context)
예제 #22
0
def get_del_sch(request):
    school = Schools.objects.filter(is_status=0)
    # 获取关键字
    keyword = request.GET.get('keyword', '')

    # 关键词选择
    if keyword:
        school = school.filter(name__contains=keyword)
    schools = school
    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, school)
    context = {
        'school': pages['data'],
        'schools': schools,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword':keyword,
    }
    return render(request, 'school/school_del.html', context=context)
예제 #23
0
파일: views.py 프로젝트: showzvan/mysite
def get_cate(request):
    cate = MajorCates.objects.filter(is_status=1).order_by('id')
    # 获取关键字
    keyword = request.GET.get('keyword', '')

    # 关键词选择
    if keyword:
        cate = cate.filter(catename__contains=keyword)
    cates = cate

    # 从前端获取当前的页码数
    page = request.GET.get('page', 1)
    pages = Page.get_page(request, page, cate)
    context = {
        'cate': pages['data'],
        'cates': cates,
        'paginator': pages['paginator'],
        'currentPage': pages['currentPage'],
        'page_range': pages['page_range'],
        'keyword': keyword
    }
    return render(request, 'major/cate-list.html', context=context)