Permalink
Browse files

add items summary method

  • Loading branch information...
1 parent 01c9870 commit f9590517b155adbe0cba4fdfedb4ff07919a1980 @dfalk dfalk committed Jan 29, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 cart/cart.py
View
@@ -74,6 +74,12 @@ def count(self):
for item in self.cart.item_set.all():
result += 1 * item.quantity
return result
+
+ def summary(self):
+ result = 0
+ for item in self.cart.item_set.all():
+ result += item.total_price
+ return result
def clear(self):
for item in self.cart.item_set.all():

0 comments on commit f959051

Please sign in to comment.