Zope provides a number of object types that are used as
methods. These methods are called in many different contexts
(from python code, from DTML, from the Web and other network
protocols).
The MethodObjectInterface is an attempt to identify a
set of common behaviors and capabilities that method-like
objects in Zope should support.
In particular, we have added a "Bindings" tab
to the PythonMethodx product. It lets you choose names for
five conceivable bindings:
Context, which changes according to the URL.
Containment, which is fixed.
Method's self, referring to the method object itself.
The current namespace.
URL path elements from direct traversal of the method.
All but the fourth work well. The first three simply refer to
self.aq_parent, self.aq_inner.aq_parent, and self, in that
order. The last is gathered by the publishing traversal hook.
The namespace is much harder to get, and requires the NamespaceObjectInterface.
|