toastdriven/django-tastypie — pull request #615 by buzzeante (2012-08-13 15:48:23+00:00)
Title: Avoiding PUT/POST to rebound data

`full_dehydrate` assumes `bundle.data` to be empty so it just populates elements from `bundle.obj`. This works fine with GET. However, when POST or PUT request are done the same bundle goes through all the flow. As a result, data that came from the request and is not part of the resource is rebounded in the response.

The fix avoids this problem by reseting `bundle.data` to an empty dictionary before starting the dehydration process.

When using Tastypie with BackboneJS, this data rebounded tampers models causing side effects very hard to detect.

Cheers,
Javi