[Grok-dev] Re: catalog indexes in Grok

Philipp von Weitershausen philipp at weitershausen.de
Tue Apr 17 18:31:48 EDT 2007


Martijn Faassen wrote:
> I've been doing some work on the faassen-index branch to make it easier 
> to declare catalog indexes in Grok. I'd like to ask people to play with 
> this branch for a bit and give me some feedback.

Way cool! I'll play with this branch soonish :).

> The grok.application directive is compulsory. You *have* to point it to 
> an application, or to an interface implemented by an application. I 
> don't know how to make up a sensible default for this yet. Installing 
> the indexes automatically in all Grok-based applications seems 
> excessive, so that one is out. Ideas?

No ideas for the moment. It seems sensible to require a statement that 
links the indexes to the application, though we should remember to 
carefully explain the reason behind that in the tutorial (because the 
catalog needs to be created at that place).

By the way, wouldn't a standard grok.Site also be acceptable? Perhaps it 
should be grok.site() and accept any site?

> Another directive you may choose to use is grok.name. This sets the name 
> for the catalog. If you don't use it, an unnamed catalog is used.
> 
> You can use grok.context and point to a class instead of to an 
> interface. This works, but currently means indexes are created that 
> index *everything* (like in Zope 2). Indexing not restricted to that 
> class. This is because zope.app.catalog.attribute, to my knowledge, 
> currently doesn't have that facility.

It shouldn't be too hard to customize that particular part of their 
behaviour.


-- 
http://worldcookery.com -- Professional Zope documentation and training


More information about the Grok-dev mailing list