          if method:
              form = getattr(self, '%s_form' % method.lower(), form)
              form = getattr(self.view, '%s_form' % method.lower(), form)
  
          if not form:
              return None
  
          if data is not None or files is not None:
              return form(data, files)
 
</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()
 </s> remove             # Instantiate the ModelForm as appropriate
            if data and isinstance(data, models.Model):
                # Bound to an existing model instance
                return OnTheFlyModelForm(instance=content)
            elif data is not None:
                return OnTheFlyModelForm(data, files)
            return OnTheFlyModelForm()
 </s> add             form = OnTheFlyModelForm </s> remove         form = super(ModelResource, self).get_bound_form(data, files, method=method)
        
        # Use an explict Form if it exists
        if form:
            return form

        elif self.model:
 </s> add         if not form and self.model: </s> remove         Given some content return a Django form bound to that content.
        If form validation is turned off (:attr:`form` class attribute is :const:`None`) then returns :const:`None`.
 </s> add         Returns the form class used to validate this resource.
        return form
  

    def get_bound_form(self, data=None, files=None, method=None):
        """
        Given some content return a Django form bound to that content.
        If form validation is turned off (:attr:`form` class attribute is :const:`None`) then returns :const:`None`.
        """
        form = self.get_form_class(method)

          if method:
              form = getattr(self, '%s_form' % method.lower(), form)
              form = getattr(self.view, '%s_form' % method.lower(), form)
  
        return form
  

    def get_bound_form(self, data=None, files=None, method=None):
        """
        Given some content return a Django form bound to that content.
        If form validation is turned off (:attr:`form` class attribute is :const:`None`) then returns :const:`None`.
        """
        form = self.get_form_class(method)

          if not form:
              return None
  
          if data is not None or files is not None:
              return form(data, files)
keep keep keep add 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/resources.py