[Zope] Making a Folderish ZClass 'callable'

Stephen Pitts smpitts@midsouth.rr.com
Mon, 17 Jan 2000 21:36:13 -0600


In various DTML Documents of my site, I have a table that contains links 
relevant to the content of that page. A method called "linklist" is
acquired, and code like this is used to generate a table of links:
<dtml-with Folder_Containing_Links>
	<dtml-var linklist>
</dtml-with>

I'm contemplating replacing the above with a more elegant solution:
create a ZClass called LinkContainer that derives from Folder that 
holds the Links and make the linklist DTML method the index_html method
of that folder. Then, ideally, I could get a list of links like so:
<dtml-var LinkContainer_Containing_Links>

Unfortunately, the above returns something akin to:
<LinkContainer instance at 86b61a0>
and I have to resort to 
<dtml-var LinkContainer_Containing_Links><dtml-with index_html></dtml-var>

I think I could fix this if I could adjust the __call__ method of the
ZClass, but, alas, I can't create a method that begins with an
underscore. If I had implemented LinkContainer in Python, I could have,
though. Is there any way I can make a __call__ method (or equivilent)
in a ZClass?
-- 
Stephen Pitts
smpitts@midsouth.rr.com
webmaster - http://www.mschess.org