@register.filter
def BOOL(obj):
    try:
        obj = obj.to_json()
    except __HOLE__:
        pass

    return 'true' if obj else 'false'
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/hqwebapp/templatetags/hq_shared_tags.py/BOOL