[Zope3-Users] Anyone had any success with ZCatalog in Zope 3?
Dominik Huber
dominik.huber at perse.ch
Mon Nov 21 09:17:26 EST 2005
Johan Carlsson wrote:
> ....
>
>
> Right after that I do this:
>
>
> catalog = Catalog()
> for index_name, index_attribute, idx_if, attr_call, index_type
> in indexes:
> idx = index_type(index_attribute, idx_if, attr_call)
> catalog[index_name] = idx
> tools['catalog'] = catalog
> catalog_reg = UtilityRegistration('catalog', ICatalog, catalog)
> rm.addRegistration(catalog_reg)
> catalog_reg.status = ActiveStatus
change the order and it will work:
catalog = Catalog()
tools['catalog'] = catalog
catalog_reg = UtilityRegistration('catalog', ICatalog, catalog)
rm.addRegistration(catalog_reg)
catalog_reg.status = ActiveStatus
# add the indexes after the catalog is set to the tools
for index_name, index_attribute, idx_if, attr_call, index_type
in indexes:
idx = index_type(index_attribute, idx_if, attr_call)
catalog[index_name] = idx
regards,
Dominik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dominik.huber.vcf
Type: text/x-vcard
Size: 154 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20051121/f953afc6/dominik.huber.vcf
More information about the Zope3-users
mailing list