def required_char_field_attrs(self, widget, *args, **kwargs):
 attrs = super(fields.CharField, self).widget_attrs(widget, *args, **kwargs)
 original_attrs = (charfield_widget_attrs(self, widget) or {})
 attrs.update(original_attrs)
 return attrs

def required_char_field_attrs ( self , widget , * args , ** kwargs ) : attrs = super ( fields . CharField , self ) . widget_attrs ( widget , * args , ** kwargs ) original_attrs = ( charfield_widget_attrs ( self , widget ) or { } ) attrs . update ( original_attrs ) return attrs
this function is for use on the charfield class .