Parcourir la source

Fix prices type to float

(was integer, which is wrong)
Jocelyn Delande il y a 9 ans
Parent
commit
a101d3621f
2 fichiers modifiés avec 27 ajouts et 2 suppressions
  1. 24 0
      costs/migrations/0003_auto_20151128_1044.py
  2. 3 2
      costs/models.py

+ 24 - 0
costs/migrations/0003_auto_20151128_1044.py

@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('costs', '0002_auto_20151128_1015'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='cost',
+            name='price',
+            field=models.FloatField(help_text='Coût mensuel'),
+        ),
+        migrations.AlterField(
+            model_name='good',
+            name='price',
+            field=models.FloatField(),
+        ),
+    ]

+ 3 - 2
costs/models.py

@@ -20,7 +20,8 @@ class AbstractItem(models.Model):
 class Cost(AbstractItem):
     """ A monthtly cost we have to pay
     """
-    price = models.PositiveIntegerField(help_text="Coût mensuel")
+    price = models.FloatField(help_text="Coût mensuel")
+
 
     class Meta:
         verbose_name = 'Coût'
@@ -36,7 +37,7 @@ class Cost(AbstractItem):
 class Good(AbstractItem):
     """ A good, which replacement is provisioned
     """
-    price = models.PositiveIntegerField()
+    price = models.FloatField()
     provisioning_duration = models.DurationField(
         choices=settings.PROVISIONING_DURATIONS)