Commit 7e1dc330 authored by Romain Courteaud's avatar Romain Courteaud

Wrap divergent object in the object message (in order to make them more listbox friendly).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11356 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 47e93076
...@@ -46,13 +46,14 @@ class ObjectMessage: ...@@ -46,13 +46,14 @@ class ObjectMessage:
Return the message translated Return the message translated
""" """
from Products.ERP5Type.Message import Message from Products.ERP5Type.Message import Message
return Message(domain='erp5_ui', message=self.message, mapping=self.mapping) return Message(domain='erp5_ui', message=self.message,
mapping=self.mapping)
getMessage = getTranslatedMessage getMessage = getTranslatedMessage
def edit(self, **kw): def edit(self, **kw):
""" """
set all parameters Set all parameters
""" """
self.__dict__.update(kw) self.__dict__.update(kw)
...@@ -62,6 +63,19 @@ class ObjectMessage: ...@@ -62,6 +63,19 @@ class ObjectMessage:
""" """
return getattr(self, value, None) return getattr(self, value, None)
def __getattr__(self, name):
"""
Wrap the message with the object
"""
if name.startswith('__') :
raise AttributeError, name
else:
obj = self.getObject()
if obj is not None:
return getattr(obj, name)
else:
raise AttributeError, name
def getObject(self): def getObject(self):
""" """
Get the Object Get the Object
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment