tomchristie/django-rest-framework — pull request #1616 by ianfp (2014-06-04 20:58:43+00:00)
Title: issue 1615: delete removed relations before adding

This can prevent duplicate key errors. Fixes issue #1615.