title: ModelForm field attrs
body: <p>According to the <a href="https://docs.djangoproject.com/en/1.11/topics/forms/modelforms/" rel="nofollow noreferrer">django docs</a>, a modelform field accepts <code>attrs</code>.  When I attempt to apply <code>attrs</code> I get </p>
  
  <blockquote>
    <p>TypeError: <strong>init</strong>() got an unexpected keyword argument 'attrs'</p>
  </blockquote>
  
  <p>The form I'm attempting to make is pretty simple, I just want to apply style to it.  What am I doing wrong?</p>
  
  <p>forms.py</p>
  
  <pre><code>from django import forms
  
  from .models import ServiceReportModel
  
  
  class ServiceReportCreateForm(forms.ModelForm):
      class Meta:
          model = ServiceReportModel
          fields = [
              'request_number',
              'request_reason',
              'actions_taken',
          ]
  
  
  class ServiceReportUpdateForm(forms.ModelForm):
      class Meta:
          model = ServiceReportModel
          fields = [
              'report_number',
              'request_number',
              'request_reason',
              'actions_taken',
          ]
          widgets = {
              'report_number': forms.CharField(attrs={'class': 'form-control'}),
              'request_number': forms.CharField(attrs={'class': 'form-control'}),
              'request_reason': forms.CharField(attrs={'class': 'form-control'}),
              'actions_taken': forms.Textarea(attrs={'class': 'form-control'}),
          }
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>from django.views.generic.edit import CreateView, UpdateView, DeleteView
  from django.urls import reverse_lazy
  
  from .forms import ServiceReportCreateForm, ServiceReportUpdateForm
  from .models import ServiceReportModel
  
  
  class ReportCreateView(CreateView):
      form_class = ServiceReportCreateForm
      model = ServiceReportModel
  
  
  class ReportCreateView(UpdateView):
      form_class = ServiceReportUpdateForm
      model = ServiceReportModel
  
  
  class ReportDeleteView(DeleteView):
      model = ServiceReportModel
      success_url = reverse_lazy('reports-list')
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>import uuid
  from django.urls import reverse
  from django.db import models
  from django.forms import ModelForm
  from main import models as main_models
  from customers import models as customers_models
  
  
  class ServiceReportModel(models.Model):
      report_number = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
      request_number = models.ForeignKey(ServiceRequestModel,
                                         on_delete=models.PROTECT,
                                         null=True,
                                         related_name='s_report_number'
                                        )
      reported_by = models.ForeignKey(main_models.MyUser, editable=False, related_name='reports')
      reported_date = models.DateTimeField(auto_now_add=True)
      updated_by = models.ForeignKey(main_models.MyUser, editable=True, blank=True, null=True, related_name='+')
      updated_date = models.DateTimeField(auto_now=True)
      request_reason = models.CharField(max_length=255, null=True)
      actions_taken = models.TextField()
  
      def get_absolute_url(self):
          return reverse('service-report', kwargs={'pk': self.pk})
  </code></pre>