Commit c116903d authored by Aurel's avatar Aurel

make IndexableObjectWrapper inherit from explicit

redefine getattr to prevent infinite loop (thanks to yo)
wrapObject return object in an acquisition context


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21271 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f2122818
......@@ -81,7 +81,7 @@ except ImportError:
pass
from Persistence import Persistent
from Acquisition import Implicit
from Acquisition import Implicit, Explicit
def getSecurityProduct(acl_users):
"""returns the security used by the user folder passed.
......@@ -93,7 +93,15 @@ def getSecurityProduct(acl_users):
return SECURITY_USING_NUX_USER_GROUPS
class IndexableObjectWrapper(CMFCoreIndexableObjectWrapper):
class IndexableObjectWrapper(CMFCoreIndexableObjectWrapper, Explicit):
def __getattr__(self, name):
vars = self.__vars
if vars.has_key(name):
return vars[name]
ob = aq_inner(self.__ob)
return getattr(ob, name)
def __setattr__(self, name, value):
# We need to update the uid during the cataloging process
......@@ -166,6 +174,7 @@ class IndexableObjectWrapper(CMFCoreIndexableObjectWrapper):
add(prefix + ':' + role)
return list(allowed)
class RelatedBaseCategory(Method):
"""A Dynamic Method to act as a related key.
"""
......@@ -745,8 +754,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
if predicate_property_dict is not None:
vars['predicate_property_dict'] = predicate_property_dict
vars['security_uid'] = security_uid
return w
return w.__of__(object.aq_parent)
security.declarePrivate('reindexObject')
def reindexObject(self, object, idxs=None, sql_catalog_id=None,**kw):
......
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