'Returns a bundle of data built by the related resource, usually via
``hydrate`` with the data provided.
Accepts either a URI, a data dictionary (or dictionary-like structure)
or an object with a ``pk``.'

def build_related_resource(self, value, request=None, related_obj=None, related_name=None):

    fk_resource = self.to_class()
    kwargs = {u'request': request, u'related_obj': related_obj, u'related_name': related_name}
    if isinstance(value, Bundle):
        return value
    elif isinstance(value, six.string_types):
        return self.resource_from_uri(fk_resource, value, **kwargs)
    elif isinstance(value, dict):
        return self.resource_from_data(fk_resource, value, **kwargs)
    elif hasattr(value, u'pk'):
        return self.resource_from_pk(fk_resource, value, **kwargs)
    else:
        raise ApiFieldError((u"The    '%s'    field    was    given    data    that    was    not    a    URI,    not    a    dictionary-alike    and    does    not    have    a    'pk'    attribute:    %s." % (self.instance_name, value)))
