[Zope-dev] automatically doing a Catalog search as part of ob ject traversal...
Anthony Baxter
Anthony Baxter <anthony@interlink.com.au>
Wed, 01 Dec 1999 00:11:24 +1100
>>> Toby Dickenson wrote
> > Say I have a catalog HelpCatalog, with a bunch of documents that have
> > unique IDs. I want to be able to do something like
> > HelpCatalog/by-id/SomeUniqueID
> > and have it return the document SomeUniqueID.
>
> I looked at doing something like this just after the release of 2.0, but ran
> across a problem. Catalog.getobject calls HTTPRequest.resolve_url, which
> starts its resolving process from REQUEST.PARENTS[0].
> I could get around this problem by storing the ids, and performing the
> search on demand. This worked for me since I wanted the searched-for
> objects to be parameters to the request. I will not quite work for you since
> you want the request to be handled by the searched-for object.
I'm getting there - I've now got a dtml-tree populated from a Catalog
(I'm using a PythonMethod in there, which is cheating, I guess :)
> > Do Catalogs support any sort of Direct Traversal like this?
> > Or am I going
> > to have to do it myself with a mixin class?
>
> oh yes.
That's 'oh yes, I'm going to have to do it with a mixin'?
Hm, wonder what happens when I traverse across a pythonmethod...
Anthony