                  # Otherwise assume the kwargs uniquely identify the model
                  instance = model.objects.get(**kwargs)
  
              for (key, val) in self.CONTENT.items():
                  setattr(instance, key, val)
          except model.DoesNotExist:
              instance = model(**self.CONTENT)
              instance.save()
  
          instance.save()
 
</s> remove                 instance = model.objects.get(**kwargs)
 </s> add                 self.model_instance = model.objects.get(**kwargs) </s> remove             instance = model(**self.CONTENT)
            instance.save()
 </s> add             self.model_instance = model(**self.CONTENT)
            self.model_instance.save() </s> remove                 instance = model.objects.get(pk=args[-1], **kwargs)
 </s> add                 self.model_instance = model.objects.get(pk=args[-1], **kwargs) </s> remove                 instance = model.objects.get(**filtered_keywords)
 </s> add                 self.model_instance = model.objects.get(**filtered_keywords) </s> remove         instance.save()
        return instance
 </s> add         self.model_instance.save()
        return self.model_instance
                setattr(self.model_instance, key, val)
                  # Otherwise assume the kwargs uniquely identify the model
                  instance = model.objects.get(**kwargs)
  
              for (key, val) in self.CONTENT.items():
                setattr(self.model_instance, key, val)
          except model.DoesNotExist:
              instance = model(**self.CONTENT)
              instance.save()
  
          instance.save()
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