Browse Source

Price is a decimal field

fix_refill_balance
Maxime Bombar 7 years ago
parent
commit
4d308010d9
  1. 20
      printer/migrations/0006_auto_20180908_1258.py
  2. 8
      printer/models.py

20
printer/migrations/0006_auto_20180908_1258.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-09-08 10:58
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('printer', '0005_jobwithoptions_filename'),
]
operations = [
migrations.AlterField(
model_name='jobwithoptions',
name='price',
field=models.DecimalField(decimal_places=2, default=0.0, max_digits=5, verbose_name='price'),
),
]

8
printer/models.py

@ -77,7 +77,11 @@ class JobWithOptions(RevMixin, models.Model):
endtime = models.DateTimeField(null=True)
status = models.CharField(max_length=255, choices=STATUS_AVAILABLE)
printAs = models.ForeignKey('users.User', on_delete=models.PROTECT, related_name='print_as_user', blank=True, null=True)
price = models.IntegerField(default=0)
price = models.DecimalField(
max_digits=5,
decimal_places=2,
verbose_name=_("price"),
default=0.0)
pages = models.IntegerField(default=0)
FORMAT_AVAILABLE = (
('A4', 'A4'),
@ -118,4 +122,4 @@ class JobWithOptions(RevMixin, models.Model):
def _update_price(self):
self.price = 0
self.price = 0.0

Loading…
Cancel
Save