From 278fa7f816af9b3fa0d8515b4953df338803264b Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Mon, 15 Jun 2015 13:05:09 +0200 Subject: [PATCH] Replace Fixed by FLoat in restful marshalling. --- accountant/api/views/accounts.py | 14 +++++++------- accountant/api/views/entries.py | 4 ++-- accountant/api/views/scheduled_operations.py | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/accountant/api/views/accounts.py b/accountant/api/views/accounts.py index 5f30413..376b585 100644 --- a/accountant/api/views/accounts.py +++ b/accountant/api/views/accounts.py @@ -47,13 +47,13 @@ def get_months(account_id): resource_fields = { 'id': fields.Integer(default=None), 'name': fields.String, - 'authorized_overdraft': fields.Fixed(decimals=2), - 'current': fields.Fixed(decimals=2), - 'pointed': fields.Fixed(decimals=2), - 'future': fields.Fixed(decimals=2), - 'expenses': fields.Fixed(decimals=2), - 'revenues': fields.Fixed(decimals=2), - 'balance': fields.Fixed(decimals=2), + 'authorized_overdraft': fields.Float, + 'current': fields.Float, + 'pointed': fields.Float, + 'future': fields.Float, + 'expenses': fields.Float, + 'revenues': fields.Float, + 'balance': fields.Float, } diff --git a/accountant/api/views/entries.py b/accountant/api/views/entries.py index b188e25..1b34f7b 100644 --- a/accountant/api/views/entries.py +++ b/accountant/api/views/entries.py @@ -34,12 +34,12 @@ resource_fields = { 'id': fields.Integer(default=None), 'operation_date': fields.DateTime(dt_format='iso8601'), 'label': fields.String, - 'value': fields.Fixed(decimals=2), + 'value': fields.Float, 'pointed': fields.Boolean, 'category': fields.String, 'account_id': fields.Integer, 'scheduled_operation_id': fields.Integer(default=None), - 'sold': fields.Fixed(decimals=2), + 'sold': fields.Float, 'canceled': fields.Boolean, } diff --git a/accountant/api/views/scheduled_operations.py b/accountant/api/views/scheduled_operations.py index efc0654..a110037 100644 --- a/accountant/api/views/scheduled_operations.py +++ b/accountant/api/views/scheduled_operations.py @@ -59,7 +59,7 @@ resource_fields = { 'day': fields.Integer, 'frequency': fields.Integer, 'label': fields.String, - 'value': fields.Fixed(decimals=2), + 'value': fields.Float, 'category': fields.String, 'account_id': fields.Integer, }