diff --git a/product/ERP5Type/ObjectMessage.py b/product/ERP5Type/ObjectMessage.py index 34a01e80af5a9c336a6c61ff8d10d9e9d7e2fb2c..fc5ed1219441d3d388a0652e5766be5f6d2d2552 100644 --- a/product/ERP5Type/ObjectMessage.py +++ b/product/ERP5Type/ObjectMessage.py @@ -76,16 +76,23 @@ class ObjectMessage: raise AttributeError, name def getObject(self): - """ - Get the Object. - """ - from Globals import get_request - request = get_request()['PARENTS'] - if request is not None: - for item in request: - if item.meta_type == 'ERP5 Site': - return item.restrictedTraverse(self.object_relative_url) + """ + Get the Object. + """ + from Globals import get_request + request = get_request()['PARENTS'] + if request is not None: + for item in request: + if item.meta_type == 'ERP5 Site': + return item.restrictedTraverse(self.object_relative_url) + + return None - return None + def __repr__(self): + repr_str = '<%s object at 0x%x\n ' % (self.__class__.__name__, id(self)) + repr_str += ' \n'.join([' %r: %r' % (k, v) \ + for k, v in self.__dict__.items()]) + repr_str += '>' + return repr_str allow_class(ObjectMessage)