Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 def get(self, cart_id):
     slowdown(.5)
     return deal_serv.compute(cart_id)
Exemplo n.º 3
0
 def get(self, cart_id):
   slowdown(.5)
   return deal_serv.compute(cart_id)
Exemplo n.º 4
0
 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