def _get_detail_value(var, attr):
    value = getattr(var, attr)
    # Rename common Django class names
    kls = getattr(getattr(value, '__class__', ''), '__name__', '')
    if kls in ('ManyRelatedManager', 'RelatedManager', 'EmptyManager'):
        return kls
    if callable(value):
        return 'routine'
    return value
Given a variable and one of its attributes that are available inside of
dataset/ETHPy150Open calebsmith/django-template-debug/template_debug/utils.py/_get_detail_value