Commit 58d59151 authored by Sebastien Robin's avatar Sebastien Robin

check if the cpsdocument has the attribute .cps_layout


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@477 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 22bd4b7b
......@@ -97,15 +97,18 @@ class PatchedCPSDocument(CPSDocument):
security.declarePrivate('getLayoutAndSchema' )
def getLayoutAndSchema(self):
return (aq_base(self._getOb(".cps_layouts")),aq_base(self._getOb(".cps_schemas")))
if hasattr(self,'.cps_layouts') and hasattr(self,'.cps_schemas'):
return (aq_base(self._getOb(".cps_layouts")),aq_base(self._getOb(".cps_schemas")))
return None
security.declarePrivate('setLayoutAndSchema' )
def setLayoutAndSchema(self, data):
"""
data must be : (layout,schema)
"""
self._setOb(".cps_layouts",data[0])
self._setOb(".cps_schemas",data[1])
if data is not None:
self._setOb(".cps_layouts",data[0])
self._setOb(".cps_schemas",data[1])
security.declarePrivate('_setProperty' )
def _setProperty(self, key, value, type='string'):
......
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