tomchristie/django-rest-framework — pull request #1324 by simonluijk (2014-01-02 10:43:38+00:00)
Title: Add hook for response data in Create and Update mixins

Warning: This is to start a discussion and has not been tested.

Our use case for this is to remove a field from the output. The previous solutions also remove the field from the Browsable API after a PUT request!, where not consistent across POST and PUT requests, or increased boiler plate. But this could also be used to return a simple status message rather than an object or a more complex object.

Maybe the object should also be passed to the hooks? It might also be better to have one hook (Where to implement?) self.request.method could be used to distinguish between POST/PUT. The hooks could return the response instead, giving control over the status code and headers too.