Example #1
0
 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
Example #2
0
 def get(cls, child_id):
     child = ChildModel.find_by_id(child_id)
     if not child:
         return {'message': 'Child not found.'}, 404
     return child.json()