tomchristie/django-rest-framework — pull request #263 by tomchristie (2012-09-15 19:25:37+00:00)
Title: Content negotiation logic out of response and into View

Tests not yet all passing, but basically looking good.

Logic is cleaner. In particular because conneg happens in the view, we don't need to awkwardly deal with the NotAcceptable exception having to be dealt with at the time of rendering the response.
Easier to override conneg behavior for users.
Easier to override exception behaviour. All exceptions dealt with in single place now.
Easy to use different code paths for different formats (eg serialize differently for different media types.) Eg if self.renderer.format == 'json' ... inside APIView