[Zope-dev] 'transparent' proxying to a method not in your namespace?

sean.upton@uniontrib.com sean.upton@uniontrib.com
Wed, 08 Aug 2001 09:22:51 -0700


Problem: I have a custom folder type, and I want to hijack unsuccessful
method lookups in its namespace and have them transparently proxy to code in
another folder...

I have a Python product class that uses Folder as it's base; it's cluttered
with code objects, and I don't want to have to use Transparent Folders,
which seem to break one thing or another.  I'm also looking for (perhaps)
something as an application-specific alternative/addition to acquisition as
a namespace traversal mechanism.

I had this idea of storing my various methods in a 'ProjectCode' folder in
the Zope root, and having my 'Folder' evaluate its own namespace looking for
a method; if it doesn't exist, before the Zope looks in the acquisition
parent(s), the 'Folder' looks in the namespace for the 'ProjectCode' (or
some other folder name) folder in the root to find the method, and run it
within the 'Folder' namespace.

I'm sort of ignorant as to where to start looking if I wanted to do this,
but I'm willing to investigate and figure out how to code it if it's
something that can be done within my product code or in a hotfix, and
doesn't require a patch the size of Texas...

Thoughts?

Sean

=========================
Sean Upton
Senior Programmer/Analyst
SignOnSanDiego.com
The San Diego Union-Tribune
619.718.5241
sean.upton@uniontrib.com
=========================