(collection, object_type, object_key, alt_key=None)
Gets the specified object from the collection or throws ObjectDoesNotExist.

    The collection should behave like a dict where object_key retrieves
    an object from the collection.
Gets the specified object from the collection or throws ObjectDoesNotExist.
Gets the specified object from the collection or throws ObjectDoesNotExist .
def _get_object(collection, object_type, object_key, alt_key=None):
    """
    Gets the specified object from the collection or throws ObjectDoesNotExist.

    The collection should behave like a dict where object_key retrieves
    an object from the collection.
    """
    try:
        return collection[object_key]
    except KeyError:
        raise ObjectDoesNotExist(object_type=object_type,
                                 key=(alt_key or object_key))
def _get_object ( collection , object_type , object_key , alt_key = None ) : try : return collection [ object_key ] except KeyError : raise ObjectDoesNotExist ( object_type = object_type , key = ( alt_key or object_key ) )