toastdriven/django-tastypie — pull request #923 by chander (2013-04-29 21:48:13+00:00)
Title: Update to Allow CleanedDataFormValidation to work with forms/models that have related fields.

...ationships to work when using CleanedDataFormValidation with django ORM models that have Related fields

Formerly, when an insert or update operation occurs on a model that uses a FK relationship field in the form, TastyPie would pass into the form validation the URI that was provided in bundle.data. Unfortunately, Django really wants a PK reference (the output of model_to_dict, in this case) and would fail in such cases. This fix detects those related fields in the target model (bundle.obj) and leaves the references to the related table intact, but still applies bundle values for all other fields (some of which might not be in the model, but might be required for the form.)