Beispiel #1
0
def setItemGrade(request):
    d = request.REQUEST
    data = json.loads(d['data'])

    result = Anlysis.judgeItem(data)

    #for comm in result["bad"]:
    #print comm;

    item = Item(itemId=data["id"], grade=result["grade"], rid=0)
    if (data["quick"]):
        item["hasComment"] = False
        item["goodComment"] = []
        item["badComment"] = []
    else:
        item["hasComment"] = True
        item["goodComment"] = result["good"]
        item["badComment"] = result["bad"]
    item.save()
    return HttpResponse(
        json.dumps({
            "status": "success",
            "grade": item.grade,
            "goodComment": item.goodComment,
            "badComment": item.badComment
        }))
Beispiel #2
0
def setShopGrade(request):
    d = request.REQUEST
    data = json.loads(d['data'])
    print data
    result = Anlysis.judgeShop(data)

    shop = Shop(shopId=data["id"], grade=result["grade"], rid=result["rid"])
    # print shop["shopId"]
    shop.save()
    return HttpResponse(json.dumps({"status": "success", "grade": shop.grade}))
Beispiel #3
0
def setShopGrade(request):
	d = request.REQUEST
	data = json.loads(d['data'])
	print data
	result = Anlysis.judgeShop(data)
	

	
	shop = Shop(shopId = data["id"], grade = result["grade"], rid = result["rid"])
	# print shop["shopId"]
	shop.save()
	return HttpResponse(json.dumps({"status": "success", "grade": shop.grade}))
Beispiel #4
0
def setItemGrade(request):
	d = request.REQUEST
	data = json.loads(d['data'])
	
	result = Anlysis.judgeItem(data)
	
	#for comm in result["bad"]:
		#print comm;
	
	item = Item(itemId = data["id"], grade = result["grade"], rid = 0)
	if (data["quick"]):
		item["hasComment"] = False
		item["goodComment"] = []
		item["badComment"] = []
	else:
		item["hasComment"] = True
		item["goodComment"] = result["good"]
		item["badComment"] = result["bad"]
	item.save()
	return HttpResponse(json.dumps({"status": "success", "grade": item.grade, "goodComment": item.goodComment, "badComment": item.badComment}))