title: Django Update and CreateView using the same Crispy Form, Add view Error
body: <p>I'm using the same crispy form for add and edit and have added a variable to so I can change the submit button text from add to edit and vice versa.</p>
  
  <p>However the add view is coming up with the below error:</p>
  
  <pre><code>Traceback: (removed the in built references) 
  
  ...
  
  File "/itapp/itapp/sites/views.py" in dispatch
    954.         return super(AddSubnet, self).dispatch(*args, **kwargs)
  
  ...
  
  File "/itapp/itapp/sites/views.py" in get_context_data
    969.         context = super().get_context_data(**kwargs)
  
  File "/usr/local/lib/python3.6/site-packages/django/views/generic/edit.py" in get_context_data
    93.             kwargs['form'] = self.get_form()
  
  File "/usr/local/lib/python3.6/site-packages/django/views/generic/edit.py" in get_form
    45.         return form_class(**self.get_form_kwargs())
  
  Exception Type: TypeError at /sites/site/add_subnet/7
  Exception Value: 'SubnetForm' object is not callable
  </code></pre>
  
  <p>im not sure as to why as the code for the form looks good to my unskilled eyes at least anyway</p>
  
  <p>forms.py:</p>
  
  <pre><code>class SubnetForm(forms.ModelForm):
      class Meta:
          model = SiteSubnets
          fields = ['subnet', 'subnet_type', 'circuit', 'device_data', 'vlan_id', 'peer_desc']
  
      def __init__(self, *args, **kwargs):
          site_id = kwargs.pop('site_id', None)
          self.is_add = kwargs.pop("is_add", False)
          super(SubnetForm, self).__init__(*args, **kwargs)
          self.fields['circuit'].queryset = Circuits.objects.filter(site_data=site_id)
          self.helper = FormHelper(self)
          self.helper.form_id = 'subnet_form'
          self.helper.form_method = 'POST'
          self.helper.add_input(Submit('submit', 'Add Subnet' if self.is_add else 'Edit Subnet', css_class='btn-primary'))
          self.helper.layout = Layout(
              Div(    
                  Div(
                      Field('subnet', placeholder='Subnet'),
                      Div('subnet_type', title="Subnet Type"),
                      css_class='col-lg-3'
                  ),
                  Div(
                      Div('circuit', title='Circuit'),
                      Div('device_data', title="Device Data"),
                      css_class='col-lg-3'
                  ),
                  Div(
                      Field('vlan_id', placeholder='VLAN ID'),
                      Field('peer_desc', placeholder="Peer Description"),
                      css_class='col-lg-3'
                  ),
              css_class='row'
              )
          )
  </code></pre>
  
  <p>Views:</p>
  
  <pre><code>class AddSubnet(CreateView):
      form_class = SubnetForm(is_add=True)
      template_name = "sites/subnet_form.html"
  
      @method_decorator(user_passes_test(lambda u: u.has_perm('config.add_subnet')))
      def dispatch(self, *args, **kwargs):
          self.site_id = self.kwargs['site_id']
          self.site = get_object_or_404(SiteData, pk=self.site_id) 
          return super(AddSubnet, self).dispatch(*args, **kwargs)
  
      def get_success_url(self, **kwargs):         
              return reverse_lazy("sites:site_detail_subnets", args=(self.site_id,))
  
      def form_valid(self, form):
          form.instance.site_data = self.site
          return super(AddSubnet, self).form_valid(form)
  
      def get_form_kwargs(self, *args, **kwargs):
          kwargs = super().get_form_kwargs()
          kwargs['site_id'] = self.site_id
          return kwargs
  
      def get_context_data(self, **kwargs):
          context = super().get_context_data(**kwargs)
          context['SiteID']=self.site_id
          context['SiteName']=self.site.location
          context['FormType']='Add'
          context['active_subnets']='class="active"'
  
          return context
  
  class EditSubnet(UpdateView):
      model = SiteSubnets
      form_class = SubnetForm
      template_name = "sites/subnet_form.html"
  
      @method_decorator(user_passes_test(lambda u: u.has_perm('config.edit_subnet')))
      def dispatch(self, *args, **kwargs):
          self.site_id = self.kwargs['site_id']
          self.site = get_object_or_404(SiteData, pk=self.site_id) 
          return super(EditSubnet, self).dispatch(*args, **kwargs)
  
      def get_success_url(self, **kwargs):         
              return reverse_lazy("sites:site_detail_subnets", args=(self.site_id,))
  
      def form_valid(self, form):
          form.instance.site_data = self.object.site_data
          return super(EditSubnet, self).form_valid(form)
  
      def get_form_kwargs(self, *args, **kwargs):
          kwargs = super().get_form_kwargs()
          return kwargs
  
      def get_context_data(self, **kwargs):
          context = super().get_context_data(**kwargs)
          context['SiteID']=self.site_id
          context['SiteName']=self.site.location
          context['FormType']='Edit'
          context['active_subnets']='class="active"'
  
          return context
  </code></pre>