Browse Source

Converted weight to float field for shipping method

master
David Winterbottom 14 years ago
parent
commit
df8ea016ce
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      oscar/apps/shipping/models.py

+ 2
- 3
oscar/apps/shipping/models.py View File

@@ -70,8 +70,7 @@ class WeightBand(models.Model):
70 70
     Represents a weight band which are used by the WeightBasedShipping method.
71 71
     """
72 72
     method_code = models.CharField(max_length=64, db_index=True)
73
-    upper_limit = models.DecimalField(decimal_places=2, max_digits=12,
74
-                                      help_text=_("""Enter upper limit of this weight band in Kg"""))
73
+    upper_limit = models.FloatField(help_text=_("""Enter upper limit of this weight band in Kg"""))
75 74
     charge = models.DecimalField(decimal_places=2, max_digits=12)
76 75
     
77 76
     @property
@@ -98,7 +97,7 @@ class WeightBand(models.Model):
98 97
         Return the weight band for a given weight
99 98
         """
100 99
         bands = WeightBand.objects.filter(method_code=method_code, 
101
-                upper_limit__gte=D(weight)).order_by('upper_limit')
100
+                upper_limit__gte=weight).order_by('upper_limit')
102 101
         if not bands.count():
103 102
             # No band for this weight
104 103
             return None

Loading…
Cancel
Save