From abcdfcf48c2f8c790d32e96cfc26ee4cfb3b1c3a Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sat, 16 Jan 2016 18:23:57 +0100 Subject: [PATCH] Add missing model. --- accountant/api/views/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/accountant/api/views/models.py b/accountant/api/views/models.py index ad6f8d1..81f3946 100644 --- a/accountant/api/views/models.py +++ b/accountant/api/views/models.py @@ -14,6 +14,8 @@ You should have received a copy of the GNU Affero General Public License along with Accountant. If not, see . """ +from copy import deepcopy + from flask.ext.restful import fields # Account model. @@ -54,7 +56,7 @@ ohlc_model = { } # Operation with sold model. -operation_with_sold_model = { +operation_model = { 'id': fields.Integer(default=None), 'operation_date': fields.DateTime(dt_format='iso8601'), 'label': fields.String, @@ -63,11 +65,13 @@ operation_with_sold_model = { 'category': fields.String, 'account_id': fields.Integer, 'scheduled_operation_id': fields.Integer(default=None), - 'sold': fields.Float, 'confirmed': fields.Boolean, 'canceled': fields.Boolean, } +operation_with_sold_model = deepcopy(operation_model) +operation_with_sold_model['sold'] = fields.Float + # Scheduled operation model. scheduled_operation_model = { 'id': fields.Integer,