Exemplo n.º 1
0
def sf_show(request):
    if request.method == "GET":
        p_furnitures = get_furnitures(request, category=3)
        # print(type(p_furnitures.object_list))
        return render(request, 'furniture/sf_show.html',
                      {"list": p_furnitures})

    elif request.method == "POST":
        return ajax_post(request)
Exemplo n.º 2
0
def wf_show(request):
    if request.method == "GET":
        # 该页的家具
        p_furnitures = get_furnitures(request, category=0)
        # print(type(p_furnitures.object_list))
        return render(request, 'furniture/wf_show.html',
                      {"list": p_furnitures})

    # 给ajax技术提供的请求接口
    elif request.method == "POST":
        return ajax_post(request)
Exemplo n.º 3
0
def furniture_show(request, tag_id):
    if request.method == "GET":
        # 家具商品的展示
        tag_id = int(tag_id)
        furnitures = get_furnitures(request, category=tag_id - 1)
        try:
            typeof = TypeInfo.objects.all()
            type = TypeInfo.objects.get(pk=tag_id)
            fname = type.fstyle
            id = type.id
        except Exception as e:
            logging.getLogger().error(e)
        return render(request, 'furniture/furnitures_show.html', {
            "list": furnitures,
            "name": fname,
            "typeof": typeof,
            "tag_id": id
        })

    elif request.method == "POST":
        return ajax_post(request)