Commit a101afdd authored by Sebastien Robin's avatar Sebastien Robin

correction when no data<model

git-svn-id: 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 31cc59cd
......@@ -91,10 +91,14 @@ class PatchedCPSDocument(CPSDocument):
Generic accessor. Calls the real accessor
data_model = self.getTypeInfo().getDataModel(self)
accessor_name = 'get' + UpperCase(key)
base = aq_base(self)
if data_model.has_key(key):
data_model = None
if hasattr(self,'getTypeInfo'):
type_info = self.getTypeInfo()
if hasattr(type_info,'getDataModel'):
data_model = self.getTypeInfo().getDataModel(self)
if data_model is not None and data_model.has_key(key):
return data_model.get(key)
elif hasattr(base,accessor_name):
method = getattr(base,accessor_name)
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