tomchristie/django-rest-framework — pull request #219 by scfarley (2012-06-27 01:11:41+00:00)
Title: Pass request to related serializers

Related serializers may need access to the request to properly serialize
a child resource. For example, reverse() in djangorestframework.reverse
uses request if available to return an absolute URL. While the parent
resource has access to the request to generate the absolute URL, the
child resource does not.

A colleague discovered that child resources of a resource were not generating an absolute URL. It was due to not having the request to pass to DRF's reverse() which calls request.build_absolute_uri() if request is present.

This patch fixes the issue by passing the request to related serializers since they are separate objects that do not inherit the request.

This replaces pull request #218.