def rec_getattr(obj, attr, default=None):
    try:
        return reduce(getattr, attr.split('.'), obj)
    except AttributeError:
        return default
Recursive getattr.
dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/tools.py/rec_getattr