def get_columns_for_field(field):
    if (not field or
        not hasattr(field, 'property') or
        not hasattr(field.property, 'columns') or
        not field.property.columns):
            raise Exception('Invalid field %s: does not contains any columns.' % field)

    return field.property.columns
dataset/ETHPy150Open flask-admin/flask-admin/flask_admin/contrib/sqla/tools.py/get_columns_for_field/original