Commits

twidi committed f885d44

add is_empty to NullCart and OrderCart

Comments (0)

Files changed (1)

satchmo/apps/satchmo_store/shop/models.py

     def save(self):
         pass
 
+    def _is_empty(self):
+        return True
+    is_empty = property(_is_empty)
+
 class OrderCart(NullCart):
     """Allows us to fake a cart if we are reloading an order."""
 
     def __iter__(self):
         return iter(self.cartitem_set.all())
 
+    def _is_empty(self):
+        return len(self) == 0
+    is_empty = property(_is_empty)
+
 class CartManager(models.Manager):
 
     def from_request(self, request, create=False, return_nullcart=True):