          # TODO: update on the url of a non-existing resource url doesn't work correctly at the moment - will end up with a new url 
          try:
              if args:
                  # If we have any none kwargs then assume the last represents the primrary key
                  instance = model.objects.get(pk=args[-1], **kwargs)
              else:
                  # Otherwise assume the kwargs uniquely identify the model
                  instance = model.objects.get(**kwargs)
  
              for (key, val) in self.CONTENT.items():
 
</s> remove                 instance = model.objects.get(**kwargs)
 </s> add                 self.model_instance = model.objects.get(**kwargs) </s> remove                 instance = model.objects.get(pk=args[-1], **kwargs)
 </s> add                 self.model_instance = model.objects.get(pk=args[-1], **kwargs) </s> remove                 setattr(instance, key, val)
 </s> add                 setattr(self.model_instance, key, val) </s> remove                 instance = model.objects.get(**filtered_keywords)
 </s> add                 self.model_instance = model.objects.get(**filtered_keywords) </s> remove         return None
    
 </s> add         if not form:
            return None

        # Instantiate the ModelForm as appropriate
        if data is not None or files is not None:
            if issubclass(form, forms.ModelForm) and hasattr(self.view, 'model_instance'):
                # Bound to an existing model instance
                return form(data, files, instance=self.view.model_instance)
            else:
                return form(data, files)

        return form()

                self.model_instance = model.objects.get(pk=args[-1], **kwargs)
          # TODO: update on the url of a non-existing resource url doesn't work correctly at the moment - will end up with a new url 
          try:
              if args:
                  # If we have any none kwargs then assume the last represents the primrary key
                self.model_instance = model.objects.get(pk=args[-1], **kwargs)
              else:
                  # Otherwise assume the kwargs uniquely identify the model
                  instance = model.objects.get(**kwargs)
  
              for (key, val) in self.CONTENT.items():
keep keep keep keep replace keep keep keep keep keep
 FIX: ModelViews can have Resources whose models have unique fields.

ReadModelMixin and UpdateModelMixin store model instance as a property. This allows ModelResource to bind the ModelForm using the model instance making the form validate the input data against the model instance and not a brand new instance. When the latter happened and the model used unique fields, the form validation failed whenever a PUT was maintaining the previuos value of the unique field. 
djangorestframework/mixins.py