update from Atlas

This commit is contained in:
Luciano Ramalho
2014-12-30 15:53:07 -02:00
parent 691113636f
commit 174e952b2c
14 changed files with 426 additions and 10 deletions

View File

@@ -67,8 +67,9 @@ class Order: # the Context
fmt = '<Order total: {:.2f} due: {:.2f}>'
return fmt.format(self.total(), self.due())
# <2>
def fidelity_promo(order): # <2>
def fidelity_promo(order): # <3>
"""5% discount for customers with 1000 or more fidelity points"""
return order.total() * .05 if order.customer.fidelity >= 1000 else 0