[Zope] Traversal Product Dev Question

Max M maxm at mxm.dk
Wed Mar 24 01:53:31 EST 2004


Chris Bruce wrote:

> Traversal Question...
> 
> I have a url:
> 
> /consultants/directory/chris
> 
> 'directory' is currently a folderish zclass
> 
> chris is the key to a record in a database
> 
> I would like 'directory' to be "smart" enough to take chris and look it up
> in the database and return index_html with the request filled out with table
> fields.  Is this possible?  I am trying to AVOID adding any other URL
> elements and changing 'directory' to anything other than folderish.  I know
> that 'directory' may need to be changed to a python product.  Is there some
> method that gets called while trying to resolve a url parameter?  I remember
> something about a method to override like 'has_attr" or something.

Make a python product where you have a __getitem__ method. It will be 
called with the rest of the url.

directory[chris]

-- 

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science



More information about the Zope mailing list