def index(request):
    types = GoodsType.objects.all()
    goods_result = []
    for type in types:
        goods = type.goods_set.order_by('goods_pro_date')[0:4]
        if (len(goods) >= 4):
            goods_result.append({type: goods})
    return render(request, 'buyer/index.html', locals())
def index(request):
    types = GoodsType.objects.all()
    goods_result = []
    for type in types:
        goods = type.goods_set.order_by('goods_pro_date')[0:4]
        if (len(goods) >= 4):
            goods_result.append({type: goods})
    return render(request, 'buyer/index.html', locals())