[Zope3-Users] Problem with SetIndex (from zc.catalog)
Gary Poster
gary at zope.com
Tue Mar 21 11:25:34 EST 2006
On Mar 20, 2006, at 6:51 PM, Thierry FLORAC wrote:
> 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 ??
[...]
> 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>
Ah yes, my recommendation was made too quickly. The last two should
not have been there. This third stanza would do the trick.
<content class=".catalogindex.NormalizationWrapper">
<require
permission="zope.ManageServices"
interface="zope.app.catalog.interfaces.IAttributeIndex
zope.index.interfaces.IStatistics"
set_schema="zope.app.catalog.interfaces.IAttributeIndex"
/>
</content>
I made this change in svn.
> 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...
Right, then it needed a declaration for
BTrees.Length.Length.__call__. This is in svn now too.
Try getting rid of your changes and getting the new version from
svn. It should do what you want.
Gary
More information about the Zope3-users
mailing list