Commit a374c6e6 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Revert "define __getitem__ instead of _getOb in class tool so that it works on...

Revert "define __getitem__ instead of _getOb in class tool so that it works on Zope-2.12.23 too." that broke some tests.

This reverts commit 8670f40a.
parent 475818f8
...@@ -224,7 +224,7 @@ if allowClassTool(): ...@@ -224,7 +224,7 @@ if allowClassTool():
self.__importer(class_id) self.__importer(class_id)
self.portal_types.resetDynamicDocumentsOnceAtTransactionBoundary() self.portal_types.resetDynamicDocumentsOnceAtTransactionBoundary()
def __getitem__(self, key, default=_MARKER ): def _getOb(self, key, default=_MARKER ):
if key in self.objectIds(): if key in self.objectIds():
return FileProxy(self, key).__of__(self) return FileProxy(self, key).__of__(self)
# maybe the file has just been uploaded, and is still in the temporary # maybe the file has just been uploaded, and is still in the temporary
...@@ -240,7 +240,7 @@ if allowClassTool(): ...@@ -240,7 +240,7 @@ if allowClassTool():
# be read yet, because the transaction is not commited. # be read yet, because the transaction is not commited.
self._v_created = {name: True} self._v_created = {name: True}
self.write(name, body, create=True) self.write(name, body, create=True)
return self.__getitem__(name) return self._getOb(name)
def _verifyObjectPaste(self, ob, validate_src=True): def _verifyObjectPaste(self, ob, validate_src=True):
# we only allow FileProxy (this is used in PUT) # we only allow FileProxy (this is used in PUT)
...@@ -262,12 +262,12 @@ if allowClassTool(): ...@@ -262,12 +262,12 @@ if allowClassTool():
security = ClassSecurityInfo() security = ClassSecurityInfo()
# we set _folder_handler to OFS_HANDLER to have default behaviour of # we set _folder_handler to OFS_HANDLER to have default behaviour of
# using objectIds and __getitem__ # using objectIds and _getOb
_folder_handler = OFS_HANDLER _folder_handler = OFS_HANDLER
def objectIds(self, spec=None): def objectIds(self, spec=None):
return ('PropertySheet', 'Document', 'Constraint', 'Extensions', 'tests') return ('PropertySheet', 'Document', 'Constraint', 'Extensions', 'tests')
def __getitem__(self, key, default=_MARKER): def _getOb(self, key, default=_MARKER):
from Products.ERP5Type.Utils import importLocalPropertySheet from Products.ERP5Type.Utils import importLocalPropertySheet
from Products.ERP5Type.Utils import importLocalDocument from Products.ERP5Type.Utils import importLocalDocument
from Products.ERP5Type.Utils import importLocalConstraint from Products.ERP5Type.Utils import importLocalConstraint
......
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