def _remoteRemove(self, obj=None): """clear the remote side of this relationship""" if self.obj: if obj != None and obj != self.obj: raise ObjectNotFound( "object %s was not found on %s it has object %s" % (obj.getPrimaryId(), self.getPrimaryId(), self.obj.getPrimaryId())) remoteRel = getattr(aq_base(self.obj), self.remoteName()) try: remoteRel._remove(self.__primary_parent__) except ObjectNotFound: message = log_tb(sys.exc_info()) log.error('Remote remove failed. Run "zenchkrels -r -x1". ' + message)
def _remoteRemove(self, obj=None): """remove an object from the far side of this relationship if no object is passed in remove all objects""" if obj: if obj not in self._objects: raise ObjectNotFound("object %s not found on relation %s" % ( obj.getPrimaryId(), self.getPrimaryId())) objs = [obj] else: objs = self.objectValuesAll() remoteName = self.remoteName() for obj in objs: rel = getattr(obj, remoteName) try: rel._remove(self.__primary_parent__) except ObjectNotFound: message = log_tb(sys.exc_info()) log.error('Remote remove failed. Run "zenchkrels -r -x1". ' + message)