'Instaniates the related resource.'

def get_related_resource(self, related_instance):

    related_class = type(related_instance)
    if (related_class in self._rel_resources):
        return self._rel_resources[related_class]
    related_resource = self.to_class()
    if (related_resource._meta.api_name is None):
        if (self._resource and (self._resource._meta.api_name is not None)):
            related_resource._meta.api_name = self._resource._meta.api_name
    self._rel_resources[related_class] = related_resource
    return related_resource
