def showCountryData(request): #countryName = request.POST['country'] countryNames = request.POST.get('countries') countryNames = json.loads(countryNames) #countryNames = ['India','China','United States','Canada','Russia','Malaysia','Singapore','Jordan','Australia','New Zealand'] context = {'cp': qpgt.getCountryPopulationNew(countryNames)} return HttpResponse(json.dumps(context))
def showContinentData(request): continentNames = request.POST.get('continents') #continentNames = ['Asia','Africa'] continentNames = json.loads(continentNames) # reverts the stringification of json print(continentNames) context = { 'cp' : qpgt.getContinentPopulationsNew(continentNames) #'cp':continentName } return HttpResponse(json.dumps(context))
def showChoroplethData(request): #year = request.POST.get('year') context = {'choroplethData': qpgt.getChoroplethData()} return HttpResponse(json.dumps(context))
def showWorldData(request): context = {'wp': qpgt.getWorldPopulationNew()} return HttpResponse(json.dumps(context))
def showCountryData(request): countryName = request.POST['country'] context = {'cp': qpgt.getCountryPopulationNew(countryName)} return HttpResponse(json.dumps(context))
def showContinentData(request): continentName = request.POST.get('continents') context = {'cp': qpgt.getContinentPopulationsNew(continentName)} return HttpResponse(json.dumps(context))