mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-26 00:43:46 +00:00
Price is a decimal field
This commit is contained in:
parent
d44db64da1
commit
ba6cc23fed
2 changed files with 26 additions and 2 deletions
20
printer/migrations/0006_auto_20180908_1258.py
Normal file
20
printer/migrations/0006_auto_20180908_1258.py
Normal 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'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -77,7 +77,11 @@ class JobWithOptions(RevMixin, models.Model):
|
||||||
endtime = models.DateTimeField(null=True)
|
endtime = models.DateTimeField(null=True)
|
||||||
status = models.CharField(max_length=255, choices=STATUS_AVAILABLE)
|
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)
|
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)
|
pages = models.IntegerField(default=0)
|
||||||
FORMAT_AVAILABLE = (
|
FORMAT_AVAILABLE = (
|
||||||
('A4', 'A4'),
|
('A4', 'A4'),
|
||||||
|
@ -118,4 +122,4 @@ class JobWithOptions(RevMixin, models.Model):
|
||||||
|
|
||||||
|
|
||||||
def _update_price(self):
|
def _update_price(self):
|
||||||
self.price = 0
|
self.price = 0.0
|
||||||
|
|
Loading…
Reference in a new issue