def set_cart_location(): # Appease the preflight if(request.method == "OPTIONS"): return # Grab the cart from the db cart = Cart.cart_by_area(request.json["area"]) # Create the json object from the cart. cart.update_location(request.json["location"]["lat"], request.json["location"]["lon"]) # Assume a successful update. return
def remove_cart(): # Appease the preflight if(request.method == "OPTIONS"): return # Grab the cart from the db cart = Cart.cart_by_area(request.json["area"]) # Delete the thing! cart.key.delete() # Assume a successful update. return
def get_cart_location(): # Appease the preflight if(request.method == "OPTIONS"): return # Grab the cart fomr the db cart = Cart.cart_by_area(request.json["area"]) # Create the json object from the cart. location_json = json.dumps(cart.to_dict()) # Return the mofo return location_json