[Grok-dev] Re: catalog indexes in Grok

Martijn Faassen faassen at startifact.com
Tue Apr 17 18:52:42 EDT 2007

Philipp von Weitershausen wrote:
> 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 :).

Heh. I hadn't read this post and I said practically the same in my reply 
to your egg work a few minutes ago. :)

>> 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?

Yeah, that's been playing in the back of my mind. I think you're right, 
and I'll adjust the branch to require site, not application.

>> 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.

Can you give me some clues as to what you have in mind? These are base 
classes, and I'd rather not create new indexes just for Grok. Or do you 
mean we should adjust zope.app.catalog.attribute directly and add a new 
feature to it? Or perhaps you have some clever idea in mind, which is 
what I'm hoping for.



More information about the Grok-dev mailing list