def put(self, todo_id): item = get_item(todo_id) if not item: abort_if_todo_doesnt_exist(todo_id) args = parser.parse_args() status = args.get('status') if status and update_status(todo_id, status): item = get_item(todo_id) return item return { 'Fail': 'No status Parse. Please, use one of {}'.format(STATUS_LIST) }
def delete(self, todo_id): item = get_item(todo_id) if not item: abort_if_todo_doesnt_exist(todo_id) delete_item(todo_id) return get_all_items()
def get(self, todo_id): item = get_item(todo_id) if not item: abort_if_todo_doesnt_exist(todo_id) return item