示例#1
0
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))
示例#2
0
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))
示例#3
0
def showChoroplethData(request):
    #year = request.POST.get('year')
    context = {'choroplethData': qpgt.getChoroplethData()}
    return HttpResponse(json.dumps(context))
示例#4
0
def showWorldData(request):
    context = {'wp': qpgt.getWorldPopulationNew()}
    return HttpResponse(json.dumps(context))
示例#5
0
def showCountryData(request):
    countryName = request.POST['country']
    context = {'cp': qpgt.getCountryPopulationNew(countryName)}
    return HttpResponse(json.dumps(context))
示例#6
0
def showContinentData(request):
    continentName = request.POST.get('continents')
    context = {'cp': qpgt.getContinentPopulationsNew(continentName)}
    return HttpResponse(json.dumps(context))