diff --git a/product/ERP5Type/Base.py b/product/ERP5Type/Base.py index 7c13a66b3629ad01fd17ce0909311687e3e09c95..fe0fa40f00f2abe3be2dcfbda09c95ac1de949d4 100644 --- a/product/ERP5Type/Base.py +++ b/product/ERP5Type/Base.py @@ -117,7 +117,6 @@ class WorkflowMethod(Method): (instance,) + args, kw) return res - def _aq_reset(): Base.aq_method_generated = {} Base.aq_portal_type = {} @@ -2338,8 +2337,6 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ): PortalType, and are browsed a second time to be able to group them by property or category. """ - from Products.ERP5Type.Tool.ClassTool import newTempDocumentationHelper - if item_id is None: documented_item = self item_id = documented_item.getTitle() @@ -2597,3 +2594,39 @@ class TempBase(Base): return getattr(self,'title',None) security.declarePublic('setProperty') + +def newTempDocumentationHelper(folder, id, REQUEST=None, **kw): + o = TempDocumentationHelper(id) + o = o.__of__(folder) + if kw is not None: + o._edit(force_update=1, **kw) + return o + +class TempDocumentationHelper(TempBase): + """ + Contains information about a documentable item. + Documentable item can be any python type, instanciated or not. + """ + + meta_type = "ERP5 Documentation Helper" + portal_type = "Documentation Helper" + + property_sheets = ( PropertySheet.Base + , PropertySheet.DublinCore + , PropertySheet.DocumentationHelper + , ) + + def _funcname_cmp_prepare(self, funcname): + for pos in range(len(funcname)): + if funcname[pos] != '_': + break + return '%s%s' % (funcname[pos:], funcname[:pos]) + + def __cmp__(self, documentationhelper): + my_title = self._funcname_cmp_prepare(self.getTitle()) + his_title = self._funcname_cmp_prepare(documentationhelper.getTitle()) + if my_title < his_title: + return -1 + if my_title > his_title: + return 1 + return 0 diff --git a/product/ERP5Type/Tool/ClassTool.py b/product/ERP5Type/Tool/ClassTool.py index f6a24372eb6c16fc37152a11d2fe086e6c0c0ab5..b4438357e6229466afb453a6d2dd81fb36f995f4 100644 --- a/product/ERP5Type/Tool/ClassTool.py +++ b/product/ERP5Type/Tool/ClassTool.py @@ -808,45 +808,6 @@ def initialize( context ): dochelper.setStaticPropertyList(property_list) return dochelper - from Products.ERP5Type.Base import TempBase - from Products.ERP5Type import PropertySheet - - def newTempDocumentationHelper(folder, id, REQUEST=None, **kw): - o = TempDocumentationHelper(id) - o = o.__of__(folder) - if kw is not None: - o._edit(force_update=1, **kw) - return o - - class TempDocumentationHelper(TempBase): - """ - Contains information about a documentable item. - Documentable item can be any python type, instanciated or not. - """ - - meta_type = "ERP5 Documentation Helper" - portal_type = "Documentation Helper" - - property_sheets = ( PropertySheet.Base - , PropertySheet.DublinCore - , PropertySheet.DocumentationHelper - , ) - - def _funcname_cmp_prepare(self, funcname): - for pos in range(len(funcname)): - if funcname[pos] != '_': - break - return '%s%s' % (funcname[pos:], funcname[:pos]) - - def __cmp__(self, documentationhelper): - my_title = self._funcname_cmp_prepare(self.getTitle()) - his_title = self._funcname_cmp_prepare(documentationhelper.getTitle()) - if my_title < his_title: - return -1 - if my_title > his_title: - return 1 - return 0 - else: class ClassTool(BaseTool):