Example #1
0
def html_report(request,pi):
	# if request.method == "GET":
	# 	pfi = request.GET['property_id']
	# 	address = request.GET['address']
	context=RequestContext(request)
	pfi=pi
	para={}
	para["address"] = pfiToAddress(pfi)

	flood_wse=getWse(pfi)
	if flood_wse:
		para['floor_level']=flood_wse[0].floor_1
		para['wse_list']=[[10,flood_wse[0].wse10],[20,flood_wse[0].wse20],[50,flood_wse[0].wse50],[100,flood_wse[0].wse100]]
	else:
		para["floor_level"] = 0
		para["wse_list"] = []
	
	historicEvents=getHistory(pfi)
	if historicEvents:
		para["history_list"]=[event.start_date for event in historicEvents]
	else:
		para["history_list"] = []

	depth_list = getDepth(pfi)
	if depth_list:
		para["depth_list"]=depth_list
	else:
		para["depth_list"] = []

	return render_to_response('floodextent/report.html',para,context)
Example #2
0
def history_retrive(request):
	historicEvents=[]
	results=[]
	if request.method == "GET":
		pfi=request.GET['property_id']
		print "pfi: "+pfi
		if pfi:
			historicEvents=getHistory(pfi)
			print historicEvents
	for event in historicEvents:
		results.append({"start_date":event.start_date})
	return JsonResponse(results,safe=False)