tomchristie/django-rest-framework — pull request #1620 by thierryba (2014-06-05 14:05:33+00:00)
Title: Fixed the update of a 1-to-1 field while deserializing an object

There is currently an exception thrown when trying to deserialize a one-to-one field (through the related_name) on an already saved object.
The problem is the that code does get_component(object, field). But if that field was previously null, it raises an exception.
The Unit Test added in that commit exhibits the issue.

I'm not 100% satisfied with the patch since it catches any exception. But the problem is that this code is in BaseSerializer where we know nothing about self.opts.model.DoesNotExist, which is the actual exception thrown.

Comments are very welcome.