예제 #1
0
파일: order.py 프로젝트: tchaikov/beanfs
 def post(self, order_id):
   order = Order.get_by_id(long(order_id))
   if order is None:
     self.error(404)
     return
   # TODO: `purchaese' should be the received json object
   purchases = order.get_purchases()
   balance = UserBalance()
   for p in purchases:
     balance.pay_for(p.customer, p.item.price)
   self.redirect('/u/mine/profile')
예제 #2
0
파일: user.py 프로젝트: tchaikov/beanfs
 def get_balances(self, user):
   user_balance = UserBalance(user.who)
   balances, total_amount, max_amount = user_balance.get_balances()
   total = Balance(amount=total_amount, name="Total", max_amount=max_amount)
   balances.append(total)
   return balances