def delete(cls, child_id): child = ChildModel.find_by_id(child_id) if not child: return {'message': 'Child not found.'}, 404 child.delete_from_db() return {'message': 'Child deleted.'}, 200
def get(cls, child_id): child = ChildModel.find_by_id(child_id) if not child: return {'message': 'Child not found.'}, 404 return child.json()