def getattr_deep(obj, attrs):
    """
    Like getattr(), but checks in children objects
    Example:
        X = object()
        X.Y = childobject()
        X.Y.variable = 5

        getattr(X, 'Y.variable') -> AttributeError
        getattr_deep(X, 'Y.variable') -> 5

    :param obj: object
    :param attrs: attribute (string)
    :return: attribute
    """
    for attr in attrs.split("."):
        obj = getattr(obj, attr)
    return obj