tomchristie/django-rest-framework — pull request #218 by scfarley (2012-06-26 21:59:29+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.