@register.filter
def css_class(field):
 return field.field.widget.__class__.__name__.lower()

@ register . filter def css_class ( field ) : return field . field . widget . __class__ . __name__ . lower ( )
returns widgets class name in lowercase .