def get_water_quality_result(request): location = request.__str__().split("/")[4].split("'")[0] location_name = location.replace("%20", " ") analyzer = WaterQualityAnalyzer(WaterQuality) # location_name = "Greeley Crescent" parameter = analyzer.parameters[location_name] coefficient = analyzer.coefficients[location_name] result = analyzer.get_water_quality_result(parameter, coefficient, location_name) return HttpResponse(json.dumps(result), content_type="application/json")
def get_water_quality_settings(request): analyzer = WaterQualityAnalyzer(WaterQuality) result = analyzer.get_water_quality_settings() return HttpResponse(json.dumps(result), content_type="application/json")