title: Formset Creating New Entries Instead of Updating
body: <p>I have the following code in a view:</p>
  
  <pre><code>def controller_details(request, object_id):
      controller = Controller.objects.get(pk=object_id)
      controllerURI = controller.protocol + '://' + controller.server + '/' + controller.name
  
      FilterFormSet = inlineformset_factory(Controller, Filter, extra=2)
  
      if request.method == 'POST':
          formset  = FilterFormSet(request.POST, request.FILES, instance=controller)
          if formset.is_valid():
              formset.save()
          else:
              HttpResponseRedirect('controller-details')
      else:
          formset = FilterFormSet(instance=controller)
  
      return render_to_response('controller_details.html', {'formset':formset, 'controllerURI':controllerURI}, context_instance=RequestContext(request))
  </code></pre>
  
  <p>In my model a single Controller is made up of multiple Filters (one to many) and each Filter can have another Filter as a target for its output (one to many on self). When I try to update the target for a particular Filter, instead of updating the target value I get an entire new entry. Here is what part of the model looks like:</p>
  
  <pre><code>class Filter(Component):
  controller  = models.ForeignKey(Controller)
  targetURI   = models.ForeignKey('self', verbose_name='Target URI', null=True, blank=True)
  filterType  = models.CharField('Type', max_length=64, choices=FILTER_TYPES,)
  firstFilter = models.BooleanField('First Filter')
  </code></pre>
  
  <p>Thanks in advance.</p>