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,