Exemplo n.º 1
0
def fillConsumingPlaces(response):
    places = []
    for i in response["results"]:
        place = Place()
        ID = i["place_id"]
        place = getDetailsForID(ID, place)
        place.reward = ""
        pointsToSpend = random.randint(0, 100)
        place.offerPoints = str(pointsToSpend)
        place.offerText = "Get our special offer for " + place.offerPoints + " points"
        place.placeType = "consuming"
        places.append(place)
    return places
Exemplo n.º 2
0
def fetchDetailsFromPlaces(response):
    places = []
    for i in response["results"]:
        place = Place()
        place.name = i["name"]
        place.lat = str(i["geometry"]["location"]["lat"])
        place.lng = str(i["geometry"]["location"]["lng"])
        place.reward = ""
        pointsToSpend = random.randint(0, 100)
        place.offerPoints = str(pointsToSpend)
        place.offerText = "Get our special offer for " + place.offerPoints + " points"
        places.append(place)
    return places