@register.filter(name="getattr")
def get_attr(obj, val):
    try:
        return getattr(obj, val)
    except AttributeError:
        try:
            return obj[val]
        except (__HOLE__, TypeError):
            return None
dataset/ETHPy150Open mgaitan/waliki/waliki/templatetags/waliki_tags.py/get_attr