def resource_from_uri(self, fk_resource, uri, request=None, related_obj=None, related_name=None):
        """
        Given a URI is provided, the related resource is attempted to be
        loaded based on the identifiers in the URI.
        """
        err_msg = "Could not find the provided %s object via resource URI '%s'." % (fk_resource._meta.resource_name, uri,)

        if not uri:
            raise ApiFieldError(err_msg)

        try:
            obj = fk_resource.get_via_uri(uri, request=request)
            bundle = fk_resource.build_bundle(
                obj=obj,
                request=request,
                via_uri=True
            )
            return fk_resource.full_dehydrate(bundle)
        except __HOLE__:
            raise ApiFieldError(err_msg)
dataset/ETHPy150Open django-tastypie/django-tastypie/tastypie/fields.py/RelatedField.resource_from_uri