I would like to know why the following happens, and what I can do to fix it: I have a ZCatalog instance in my root folder called Catalog. I have some CatalogAware ZClasses that get added to it automatically. The problem is, when I query Catalog for results, it only shows the elements that were present the last time I clicked the "Update" button in ZCatalog. The new elements are present in the catalog, but they don't show up in the query until I manually update the catalog. Here's the query code: <dtml-in "Catalog(meta_type='Track', track_hasfile='on', track_active='')"> <li> <a href="<dtml-var "Catalog.getpath(data_record_id_)">/approve"> <dtml-var "Catalog.getpath(data_record_id_)"></a> </dtml-in> Any help appreciated. Please CC me if you answer. -- Helge Tesdal tesdal@stud.ntnu.no
on Wednesday, March 22, 2000 Helge Tesdal wrote : HT> I have a ZCatalog instance in my root folder called Catalog. I have some HT> CatalogAware ZClasses that get added to it automatically. HT> The problem is, when I query Catalog for results, it only shows the HT> elements that were present the last time I clicked the "Update" button in HT> ZCatalog. The new elements are present in the catalog, but they don't show HT> up in the query until I manually update the catalog. HT> Here's the query code: [snip] HT> -- HT> Helge Tesdal HT> tesdal@stud.ntnu.no the problem is not in your query-code, i guess .. IIRC, the catalog-aware zclasses are indexed automagically when created, but not properties you set after creation. So when you search for track_hasfile='on' , Zcatalog doesn't have that property indexed: You'll have to add : <dtml-call reindex_object> in your Zclass Constructor method ( if you change properties there) like this : <dtml-with "Zclass_name.createInObjectManager(REQUEST['id'], REQUEST)"> <dtml-call "propertysheets.Propertyshhet_name.manage_editProperties(REQUEST)"> <dtml-call reindex_object> </dtml-with> - Another possibility could be that you haven't added track_hasfile to your indexes in Zcatalog. If it is just a on/off-flag (which it looks like from here) , add it as a field-index.. For better information, check out the excellent Zcatalog / catalogAware HowTos on zope.org.. -- Geir Bækholt Hansen web-developer/designer geirh@funcom.com http://www.funcom.com
participants (2)
-
Geir B Hansen -
Helge Tesdal