At 10:18 PM 12/23/01 -0800, Michael Olivier wrote: >I'm using ZPublisher + PCGI w/o the full Zope environment. Is it possible >to have an object that defines a __bobo_traverse__ method and also has an >index_html method? In the example below, I would want it to traverse if >the URL path had more elements on it, and otherwise to call >index_html(). Unless I comment out the __bobo_traverse__, the index_html >method doesn't work. I also tried returning None in traversal if key was >None, but that didn't work either. (I am running 2.0.1, so maybe I'm >hitting a bug that's since been fixed.) > >class MsgDirList: > """message directory list""" > > def __init__(self): > pass > > def __bobo_traverse__(self, REQUEST, key): > # traverse if there is more in the URL path...
Try putting this in right here: if key=='index_html': return self.index_html > return CitiesMsgs(key) index_html is *added* onto the URL for traversal, so your __bobo_traverse__ should get asked for it. Note that you return self.index_html *without* calling it, as ZPublisher will do that for you. _______________________________________________ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )