Browse Source

Rename basket Line properties for clarity

Previous names were ambiguous as to whether discounts were being
included or excluded.
master
David Winterbottom 12 years ago
parent
commit
4c8cdce9a0
3 changed files with 18 additions and 8 deletions
  1. 12
    2
      docs/source/releases/v0.6.rst
  2. 4
    4
      oscar/apps/basket/abstract_models.py
  3. 2
    2
      oscar/apps/order/utils.py

+ 12
- 2
docs/source/releases/v0.6.rst View File

@@ -238,7 +238,6 @@ Several classes and functions have had signature changes:
238 238
   ``AnonymousUserProductReviewForm``, have been replaced by a new
239 239
   :class:`oscar.apps.catalogue.reviews.forms.ProductReviewForm``.
240 240
 
241
-
242 241
 Loading shipping methods
243 242
 ~~~~~~~~~~~~~~~~~~~~~~~~
244 243
 
@@ -270,7 +269,18 @@ Beware of shipping methods that are configured via constructor arguments, like
270 269
 :class:`~oscar.apps.shipping.methods.FixedPrice`.  Shipping methods will be
271 270
 reworked for Oscar 0.7.
272 271
 
273
-Address Model changes
272
+Basket model changes
273
+~~~~~~~~~~~~~~~~~~~~~
274
+
275
+Several properties of the basket ``Line`` model have been renamed:
276
+
277
+* ``Line.line_price_excl_tax_and_discounts`` has been renamed to 
278
+  ``Line.line_price_exlc_tax_incl_discounts``.
279
+
280
+* ``Line.line_price_incl_tax_and_discounts`` has been renamed to 
281
+  ``Line.line_price_inlc_tax_incl_discounts``.
282
+
283
+Address model changes
274 284
 ~~~~~~~~~~~~~~~~~~~~~
275 285
 
276 286
 * The ``UserAddress.salutation`` and ``UserAddress.name`` methods are now

+ 4
- 4
oscar/apps/basket/abstract_models.py View File

@@ -364,7 +364,7 @@ class AbstractBasket(models.Model):
364 364
         """
365 365
         Return total line price excluding tax
366 366
         """
367
-        return self._get_total('line_price_excl_tax_and_discounts')
367
+        return self._get_total('line_price_excl_tax_incl_discounts')
368 368
 
369 369
     @property
370 370
     def total_tax(self):
@@ -376,7 +376,7 @@ class AbstractBasket(models.Model):
376 376
         """
377 377
         Return total price inclusive of tax and discounts
378 378
         """
379
-        return self._get_total('line_price_incl_tax_and_discounts')
379
+        return self._get_total('line_price_incl_tax_incl_discounts')
380 380
 
381 381
     @property
382 382
     def total_incl_tax_excl_discounts(self):
@@ -749,7 +749,7 @@ class AbstractLine(models.Model):
749 749
         return self.quantity * self.unit_price_excl_tax
750 750
 
751 751
     @property
752
-    def line_price_excl_tax_and_discounts(self):
752
+    def line_price_excl_tax_incl_discounts(self):
753 753
         if self._discount_excl_tax:
754 754
             return self.line_price_excl_tax - self._discount_excl_tax
755 755
         if self._discount_incl_tax:
@@ -761,7 +761,7 @@ class AbstractLine(models.Model):
761 761
         return self.line_price_excl_tax
762 762
 
763 763
     @property
764
-    def line_price_incl_tax_and_discounts(self):
764
+    def line_price_incl_tax_incl_discounts(self):
765 765
         # We use whichever discount value is set.  If the discount value was
766 766
         # calculated against the tax-exclusive prices, then the line price
767 767
         # including tax

+ 2
- 2
oscar/apps/order/utils.py View File

@@ -150,8 +150,8 @@ class OrderCreator(object):
150 150
             'upc': product.upc,
151 151
             'quantity': basket_line.quantity,
152 152
             # Price details
153
-            'line_price_excl_tax': basket_line.line_price_excl_tax_and_discounts,
154
-            'line_price_incl_tax': basket_line.line_price_incl_tax_and_discounts,
153
+            'line_price_excl_tax': basket_line.line_price_excl_tax_incl_discounts,
154
+            'line_price_incl_tax': basket_line.line_price_incl_tax_incl_discounts,
155 155
             'line_price_before_discounts_excl_tax': basket_line.line_price_excl_tax,
156 156
             'line_price_before_discounts_incl_tax': basket_line.line_price_incl_tax,
157 157
             # Reporting details

Loading…
Cancel
Save