@register.filter
def classes(field):
 return field.widget.attrs.get('class', None)

@ register . filter def classes ( field ) : return field . widget . attrs . get ( 'class' , None )
returns css classes of a field .