@csrf_exempt
def get_query_links(request):
    if (request.method == 'POST'):
        name = request.POST.get('user_name', None)
        locations = jsonpickle.decode(request.POST.get('locations_list', None))
        print(locations)
        user = get_user(name)
        results = []
        for loc in locations:
            results.append(user.get_region(loc['region']).get_place_by_name(loc['place']).get_query_string())
        print(results)
        return JsonResponse(results, safe=False)
    else:
        empty = {}
        return JsonResponse(empty)
@csrf_exempt
def get_query_links(request):
    if (request.method == 'POST'):
        name = request.POST.get('user_name', None)
        locations = jsonpickle.decode(request.POST.get('locations_list', None))
        print(locations)
        user = get_user(name)
        results = []
        for loc in locations:
            results.append(user.get_region(loc['region']).get_place_by_name(loc['place']).get_query_string())
        print(results)
        return JsonResponse(results, safe=False)
    else:
        empty = {}
        return JsonResponse(empty)