def __contains__(self, other): if other is None: return False linkset = IRelationshipLinks(self.this) for link in linkset.getCachedLinksByTarget(other): if (link.rel_type_hash == hash(self.rel_type) and link.my_role_hash == hash(self.my_role) and link.role_hash == hash(self.other_role) and self._filter(link)): return True return False
def __contains__(self, other): if other is None: return False other = removeSecurityProxy(other) linkset = IRelationshipLinks(self.this) filter = self.rel_type.filter for link in linkset.getCachedLinksByTarget(other): if (link.my_role_hash == hash(self.my_role) and link.role_hash == hash(self.other_role) and filter(link)): return True return False