Commit a9e1db84 authored by Jim Fulton's avatar Jim Fulton

Added some machinery to make it possible to call methods

(especially external methods) on instances that are not acquiring.
parent 05aa372b
......@@ -254,7 +254,7 @@ class W(Globals.Persistent):
m=self.__dict__[methodattr]
if hasattr(m,'__of__'):
r=Helper()
r._ugh=self, m
r._ugh=self, m, parent
return r
return m
......@@ -262,10 +262,24 @@ PermissionMapper=W
class Helper(ExtensionClass.Base):
def __of__(self, parent):
w, m = self._ugh
w, m, p = self._ugh
return m.__of__(
Acquisition.ImplicitAcquisitionWrapper(
w, parent))
def __getattr__(self, name):
w, m, parent = self._ugh
self=m.__of__(
Acquisition.ImplicitAcquisitionWrapper(
w, parent))
return getattr(self, name)
def __call__(self, *args, **kw):
w, m, parent = self._ugh
self=m.__of__(
Acquisition.ImplicitAcquisitionWrapper(
w, parent))
return apply(self, args, kw)
class PermissionMapperManager(Acquisition.Implicit):
def __init__(self, wrapper): self._wrapper___=wrapper
......
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