title: Set attribute of all fields in Django ModelForm in init method
body: <p>I have a Django ModelForm where I set certain form attributes in the form <code>__init__()</code> method.</p>
  
  <pre><code>class MyForm(forms.ModelForm):
  
      class Meta:
          model = MyModel
          exclude = ['datecreated', 'datemodified']
  
      def __init__(self, *args, **kwargs):
          super(MyForm, self).__init__(*args, **kwargs)
          self.fields['field1'].widget.attrs['class'] = 'class1'
          self.fields['field2'].widget.attrs['class'] = 'class1'
          self.fields['field3'].widget.attrs['class'] = 'class1'
          # override Google Chrome field error issues making form unfocusable
          self.fields['field1'].required = False
          self.fields['field2'].required = False
          self.fields['field3'].required = False
  </code></pre>
  
  <p>Is there away to set attributes of <strong>all fields included in the form</strong> without writing self.fields for each one individually?</p>