title: How can I modify a widget's attributes in a ModelForm's __init__() method?
body: <p>I want to programatically modify the widget attributes of a field in a Django ModelForm's <strong>init</strong>() method.  Thus far, I've tried the following</p>
  
  <pre><code>def __init__(self, *args, **kwargs):
      super(MyForm, self).__init__(*args, **kwargs)
      self.fields['my_checkbox'].widget_attrs(forms.CheckboxInput(attrs={'onclick':'return false;'}))
  </code></pre>
  
  <p>Unfortunately, this does not work. Any thoughts?</p>