def post(self, cart_id): cart = self.ensure_cart_exists(cart_id) if not cart.has_key('products'): cart['products'] = [] prod_id = request.json product = prod_repo.get(prod_id) cart['products'].append(product) cart_repo.save(cart) slowdown(0.5) return cart_id
def get(self, cart_id): slowdown(.5) return deal_serv.compute(cart_id)
def get(self, cart_id): cart = self.ensure_cart_exists(cart_id) slowdown(0.5) if 'aggregated' in request.args.keys(): return self.aggregate(cart) return cart