tomchristie/django-rest-framework — pull request #1426 by xordoquy (2014-02-18 10:33:04+00:00)
Title: Split allow_add_remove into add / update / remove "permissions"

This PR allows nested to have a finer management on nested strategies.

The initial need was to create or update several objects within the same transaction and/or provide a convenient API.

The example might not be the best possible but this would give the general idea. If you need in your project to update an object and create a log entry at the same time. Let's say you have constraints on both your log entry and object that could lead to a general rollback.
Using a strict REST API you'll update the object, then create the log and if the logs addition fails, you'll need to rollback the object which means you have queried it first and resend the old values.

This isn't very efficient as it could be done within a single transaction using a nested log.
However, with the current behavior, either you'll need to provide the full logs or have the older entries removed.

By using an addition only mode, this PR gives an elegant solution to the above use case.
The developer can grant any combination of add / update / delete rights on the nested serializers.