def delete_horse(id): """ Removes a horse from the barn :param id: Identifier of the horse :type id: str :rtype: None """ for s in Data.get_horse_schedules(id): Data.delete(s) for a in Data.get_horse_people(id): Data.delete(a) Data.delete(Horse(id=id))
def get_horse_people(id, type=None): """ Retrieves a list of all people associated with the horse :param id: Identifier of the horse :type id: str :param type: restricts the list to specific types of people :type type: str :rtype: List[Association] """ horse = Data.get('horse', id) if horse is None: return 'Horse Not Found', 404 else: return Data.get_horse_people(id, type)