def get(self, action): if action == 'remove': try: _id = ObjectId(request.args.get('_id')) except InvalidId: return {'error': 'You must specify an ID'}, 400 result = Model.remove_by_id(_id) return result if action == 'add': # TODO pass
def get(self, action): if action == 'remove': try: _id = ObjectId(request.args.get('_id')) except InvalidId: return {'error': 'You must specify an ID'}, 400 result = Model.remove_by_id(_id) return result if action == 'add': # TODO pass
def delete(id): result = Model.remove_by_id(id) return (dumps(result), 200, {'Content-Type': 'application/json'})
def delete(id): result = Model.remove_by_id(id) return (dumps(result), 200, {'Content-Type': 'application/json'})