Beispiel #1
0
def pet(person_id, pet_id):
    """
    Get an existing pet from an existing owner.
    """
    try:
        result = Pet.get_or_none(Pet.owner == person_id, Pet.id == pet_id)
        if result is None:
            raise NotFoundException('Person and/or pet not found')

        response = generate_response(model_to_dict(result), 200)
    except Exception as e:
        app.logger.error(e)
        response = generate_error_response(e)

    return response