@register.filter
def input_class(field):
    return field.field.widget.__class__.__name__.lower()
Returns widgets class name in lowercase
dataset/ETHPy150Open mishbahr/django-users2/users/templatetags/form_tags.py/input_class