[Zope-dev] feedback wanted on ZCatalog changes...

Anthony Baxter anthony@interlink.com.au
Wed, 29 Dec 1999 19:05:21 +1100


At <URL:http://www.zope.org/Members/anthony/patches/index_html>
I've placed a number of changes/patches for ZCatalog. As well
as a couple of bug fixes (which are in the collector) there's a
new feature - I've added a new management tab 'Query'. from the above
page:

A new management tab 'Query', which allows you to query the contents of
the ZCatalog. When building complex applications with ZCatalog (see my
'dtml-tree from zcatalog' howto), you end up writing a lot of tiny DTML
methods just to dump out the results of a particular query. This makes
it a lot easier. Note that this is pretty shiny and new, and I'd really
like some feedback on this.

There's two search methods - one takes an index and a search term, and
will return matching objects (and optionally display all metadata in a
table), while the other will take an index and do a uniqueValuesFor()
on it to return a list of index values.  Clicking on a result in this
form will return matching objects for that value (as in the first method)

Note that this will only work for indexes of type FieldIndex and
KeyWordIndex. To detect TextIndexes, I had to check for the presence of
a method called 'positions' in the index, since that's only present in
TextIndex. There appears to be no way to find out the type of an index
apart from diving into Python and examining it's __class__. Should this
be fixed? 

Anyway, if people could have a look at this, and let me know their thoughts,
it would be appreciated...

Anthony