@register.filter
def choice_id(choice):
    try:
        resp = choice[0]
    except IndexError:
        resp = ''
        pass
    return resp
Returns Choice type field's choice id for form rendering
dataset/ETHPy150Open adlibre/Adlibre-DMS/adlibre_dms/apps/mdtui/templatetags/index_keys.py/choice_id