8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-25 16:33:47 +00:00

Price is a decimal field

This commit is contained in:
Maxime Bombar 2018-09-08 12:59:45 +02:00 committed by root
parent d44db64da1
commit ba6cc23fed
2 changed files with 26 additions and 2 deletions

View file

@ -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'),
),
]

View file

@ -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