[Zope3-Users] Problem with SetIndex (from zc.catalog)
Thierry FLORAC
tflorac at ulthar.net
Mon Mar 20 18:51:56 EST 2006
On Mon, 2006-03-20 at 17:37 -0500, Gary Poster wrote:
> On Mar 20, 2006, at 5:14 PM, Thierry FLORAC wrote:
> > But I'm just trying to use a "simple" (not subclassed) SetIndex, and
> > then to access my catalog "Advanced" management page...!
> > I don't build any specific template for this.
> >
> > Should I build any specific SetIndex subclass ? Or define a specific
> > template ??
>
> Thierry, try adding the following to zc.catalog's configure.zcml
> (this is for all four of the zope.app.catalog-aware indexes).
>
> <content class=".catalogindex.ValueIndex">
> <require
> permission="zope.ManageServices"
> interface="zope.app.catalog.interfaces.IAttributeIndex
> zope.index.interfaces.IStatistics
> "
> set_schema="zope.app.catalog.interfaces.IAttributeIndex"
> />
> </content>
>
> <content class=".catalogindex.SetIndex">
> <require
> permission="zope.ManageServices"
> interface="zope.app.catalog.interfaces.IAttributeIndex
> zope.index.interfaces.IStatistics
> "
> set_schema="zope.app.catalog.interfaces.IAttributeIndex"
> />
> </content>
>
> <content class=".catalogindex.DateTimeValueIndex">
> <require
> permission="zope.ManageServices"
> interface="zope.app.catalog.interfaces.IAttributeIndex
> zope.index.interfaces.IStatistics
> "
> set_schema="zope.app.catalog.interfaces.IAttributeIndex"
> />
> </content>
>
> <content class=".catalogindex.DateTimeSetIndex">
> <require
> permission="zope.ManageServices"
> interface="zope.app.catalog.interfaces.IAttributeIndex
> zope.index.interfaces.IStatistics
> "
> set_schema="zope.app.catalog.interfaces.IAttributeIndex"
> />
> </content>
>
>
> Then give it a try. (This only works if you are using the indexes I
> listed, but you probably get the idea.) If this helps, we should
> check it in.
Modification is OK (at first, see below) for the first indexes, but an
error is raised while starting Zope for the DateTime indexes, because
"class" attribute points to a method name :
zope.configuration.config.ConfigurationExecutionError:
exceptions.TypeError: type_ must be a type, class or module, not
a <function DateTimeValueIndex at 0xb672510c> in:
File
"/usr/local/zope/3.2/var/lib/python/zc/catalog/configure.zcml",
line 58.3-66.3
<content class=".catalogindex.DateTimeValueIndex">
<require
permission="zope.ManageServices"
interface="zope.app.catalog.interfaces.IAttributeIndex
zope.index.interfaces.IStatistics
"
set_schema="zope.app.catalog.interfaces.IAttributeIndex"
/>
</content>
After removing this modification for the two last indexes, I can access
catalog's "advanced" management screen without error, but information is
not really fine : on a SetIndex for example, "Document Count" and "Word
Count" columns are displayed as "<security proxied BTrees.Length.Length
instance at 0xb4dc052c>" instead of their numeric values...
Thierry
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the Zope3-users
mailing list