From 8670f40aa705f793aeed3d7bc554a386772fdc29 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Fri, 14 Sep 2012 13:37:23 +0200
Subject: [PATCH] define __getitem__ instead of _getOb in class tool so that it
 works on Zope-2.12.23 too.

---
 product/ERP5Type/Tool/ClassTool.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/product/ERP5Type/Tool/ClassTool.py b/product/ERP5Type/Tool/ClassTool.py
index ff0cc668e4..4fc93ff0ae 100644
--- a/product/ERP5Type/Tool/ClassTool.py
+++ b/product/ERP5Type/Tool/ClassTool.py
@@ -224,7 +224,7 @@ if allowClassTool():
         self.__importer(class_id)
         self.portal_types.resetDynamicDocumentsOnceAtTransactionBoundary()
       
-    def _getOb(self, key, default=_MARKER ):
+    def __getitem__(self, key, default=_MARKER ):
       if key in self.objectIds():
         return FileProxy(self, key).__of__(self)
       # maybe the file has just been uploaded, and is still in the temporary
@@ -240,7 +240,7 @@ if allowClassTool():
       # be read yet, because the transaction is not commited.
       self._v_created = {name: True}
       self.write(name, body, create=True)
-      return self._getOb(name)
+      return self.__getitem__(name)
 
     def _verifyObjectPaste(self, ob, validate_src=True):
       # we only allow FileProxy (this is used in PUT)
@@ -262,12 +262,12 @@ if allowClassTool():
       security = ClassSecurityInfo()
     
       # we set _folder_handler to OFS_HANDLER to have default behaviour of
-      # using objectIds and _getOb
+      # using objectIds and __getitem__
       _folder_handler = OFS_HANDLER
       def objectIds(self, spec=None):
         return ('PropertySheet', 'Document', 'Constraint', 'Extensions', 'tests')
 
-      def _getOb(self, key, default=_MARKER):
+      def __getitem__(self, key, default=_MARKER):
         from Products.ERP5Type.Utils import importLocalPropertySheet
         from Products.ERP5Type.Utils import importLocalDocument
         from Products.ERP5Type.Utils import importLocalConstraint
-- 
2.30.9