'Return single relationship of type *reltype* from the collection.
Raises |KeyError| if no matching relationship is found. Raises
|ValueError| if more than one matching relationship is found.'

def _get_rel_of_type(self, reltype):

    matching = [rel for rel in self.values() if (rel.reltype == reltype)]
    if (len(matching) == 0):
        tmpl = u"no    relationship    of    type    '%s'    in    collection"
        raise KeyError((tmpl % reltype))
    if (len(matching) > 1):
        tmpl = u"multiple    relationships    of    type    '%s'    in    collection"
        raise ValueError((tmpl % reltype))
    return matching[0]
