def getOneCorpInfo(request): corp_id = request.GET['corp_id'] spotInfo = raw_sql.getOneSpotInfo(corp_id) for i in spotInfo: i['last_time'] = str(i['last_time']) obj = {'corp_info':spotInfo,'spot_info': raw_sql.getCorpSpotInfo(corp_id)} results = json.dumps(obj,ensure_ascii=False,separators=(',',':')) return HttpResponse(results)
def getOneSpotInfo(request): spot_id = request.GET['spot_id'] obj = raw_sql.getOneSpotInfo(spot_id) obj[0]['last_time'] = str(obj[0]['last_time']) results = json.dumps(obj[0],ensure_ascii=False,separators=(',',':')) return HttpResponse(results)