From 1202c8180efb7c3682f5c51b9b933037d939e8b4 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Tue, 12 Jan 2016 22:55:26 +0100 Subject: [PATCH] Rename operation_id in id. --- accountant/api/views/scheduled_operations.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/accountant/api/views/scheduled_operations.py b/accountant/api/views/scheduled_operations.py index 6c4cc2a..658477e 100644 --- a/accountant/api/views/scheduled_operations.py +++ b/accountant/api/views/scheduled_operations.py @@ -91,25 +91,25 @@ class ScheduledOperationListResource(Resource): class ScheduledOperationResource(Resource): @marshal_with_field(Object(resource_fields)) - def get(self, scheduled_operation_id): + def get(self, id): """ Get scheduled operation. """ try: return ScheduledOperation.query().filter( - ScheduledOperation.id == scheduled_operation_id + ScheduledOperation.id == id ).one() except NoResultFound: return None, 404 @marshal_with_field(Object(resource_fields)) - def delete(self, scheduled_operation_id): + def delete(self, id): """ Delete a scheduled operation. """ try: scheduled_operation = ScheduledOperation.query().filter( - ScheduledOperation.id == scheduled_operation_id + ScheduledOperation.id == id ).one() except NoResultFound: return None, 404 @@ -132,18 +132,18 @@ class ScheduledOperationResource(Resource): return None, 204 @marshal_with_field(Object(resource_fields)) - def post(self, scheduled_operation_id): + def post(self, id): """ Update a scheduled operation. """ kwargs = parser.parse_args() assert (id not in kwargs or kwargs.id is None - or kwargs.id == scheduled_operation_id) + or kwargs.id == id) try: scheduled_operation = ScheduledOperation.query().filter( - ScheduledOperation.id == scheduled_operation_id + ScheduledOperation.id == id ).one() except NoResultFound: return None, 404 @@ -163,4 +163,4 @@ class ScheduledOperationResource(Resource): api_api.add_resource(ScheduledOperationListResource, "/scheduled_operations") api_api.add_resource(ScheduledOperationResource, - "/scheduled_operations/") + "/scheduled_operations/")