Пример #1
0
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
Пример #2
0
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
Пример #3
0
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