code: def links(self):
          
          link_dict = {'self': self.resource_uri()}
          for relationship in inspect(  # pylint: disable=maybe-no-member
                  self.__class__).relationships:
              if 'collection' not in relationship.key:
                  instance = getattr(self, relationship.key)
                  if instance:
                      link_dict[str(relationship.key)] = instance.resource_uri()
          return link_dict
docs: Return a dictionary of links to related resources that should be
          included in the *Link* header of an HTTP response.
  
          :rtype: dict