[Zope-dev] [IDEA] ZopeRoot and SiteRoot

Casey Duncan c.duncan@nlada.org
Mon, 17 Dec 2001 10:16:09 -0500


This qualifies as: Yet another idea that I'm not sure deserves a fishbowl 
proposal yet, or is big enough to even need one.

In making some recent changes to the Application.py module in Zope which 
houses the class for the Zope Root Folder, it occurred to me that I could 
solve an issue that has bugged me for a while:

You have to use the silly REQUEST.PARENTS[-1] to get the darn Root Folder 
inside Zope.

Now unless something has been done about this that I'm not aware of, this is 
still true. Assuming that here is my idea: Add a method to the Root Folder, 
ZopeRoot, which returns the Root Folder. This would work:

def ZopeRoot(self):
    """Return Thyself"""
    return self

This would go along with ZopeTime and always be available in the general 
namespace for folks to use.

Another idea also struck me. That SiteRoot should also be a callable object 
(if it exists) returning the Root folder of the sub-site. Now this may 
already be the case, but if not I thought it might be worthwhile.

Thoughts?

/---------------------------------------------------\
  Casey Duncan, Sr. Web Developer
  National Legal Aid and Defender Association
  c.duncan@nlada.org
\---------------------------------------------------/