  
          # 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:
              self.model_instance = self.get_object(*args, **kwargs)
  
              for (key, val) in self.CONTENT.items():
                  setattr(self.model_instance, key, val)
          except model.DoesNotExist:
              self.model_instance = model(**self.get_instance_data(model, self.CONTENT, *args, **kwargs))
 
</s> remove             self.model_instance = self.get_object(*args, **kwargs)
 </s> add             self.model_instance = self.get_instance(**query_kwargs) </s> remove         Returns the dict with the data for model instance creation/update query.
 </s> add         Returns the dict with the data for model instance creation/update. </s> remove             instance = self.get_object(*args, **kwargs)
 </s> add             instance = self.get_instance(**query_kwargs)
            self.model_instance = self.get_instance(*query_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:
            self.model_instance = self.get_instance(*query_kwargs)
  
              for (key, val) in self.CONTENT.items():
                  setattr(self.model_instance, key, val)
          except model.DoesNotExist:
              self.model_instance = model(**self.get_instance_data(model, self.CONTENT, *args, **kwargs))
keep keep keep keep replace keep keep keep keep keep
 Remove use of Q objects. 
djangorestframework/mixins.py