Commit e3c10954 authored by Kevin Deldycke's avatar Kevin Deldycke

Verify that getDataModel is callable


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@503 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 03008bae
...@@ -45,9 +45,10 @@ class PatchedCPSDocument(CPSDocument): ...@@ -45,9 +45,10 @@ class PatchedCPSDocument(CPSDocument):
type_info = self.getTypeInfo() type_info = self.getTypeInfo()
field_list = [] field_list = []
if type_info is not None: if type_info is not None:
data_model = type_info.getDataModel(self) if hasattr(type_info,'getDataModel'):
if data_model is not None: data_model = type_info.getDataModel(self)
field_list = data_model._fields.items() if data_model is not None:
field_list = data_model._fields.items()
field_list.sort() field_list.sort()
for (prop_id,field) in field_list: for (prop_id,field) in field_list:
#for field in schema.objectValues(): #for field in schema.objectValues():
......
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