Hi, I've just started playing with ZCatalog in Zope 2.6.1 and have followed the tutorial in the online 2.6 edition of The Book successfully to the point of creating a keyword index that returns the correct number of data_record_id_s for my query keywords for various indexes on File objects I'm storing data in as Properties. I've also read a couple of online ZCatalog tutorials, most of which were based on DTML and earlier versions. It looks like ZCatalog will work fine for my small data requirements but I need to register in the catalog my (data) File objects when I create them and when their Properties are changed. I understand I can use ZClasses to create data objects that are CatalogAware and that Products can also be created with that attribute and then I could create my data objects from those. I'll look into those ideas (and suggested Products like Abracadabra, Archetypes and mxm Easy Product) but for now I'd settle for a way to invoke a ZCatalog Find/ReIndex programmatically via python in my user add and update programs. That way I could at least finish my prototyping without getting into the things mentioned above. Unfortunately I haven't found an example of how to do what I'd like. Can someone please provide one? Thanks, Tom P. Allred, MCSE, RHCE, CCNA Allred Data Consulting, Inc. 888-381-0611 www.AllredData.com Tom@AllredData.com
Tom P. Allred wrote:
and when their Properties are changed. I understand I can use ZClasses to create data objects that are CatalogAware and that Products can also be created with that attribute and then I could create my data objects from those.
Well, how are you File objects created and edited currently? ZClasses are the work of the devil (sorry Jim ;-) and Products are a bit heavyweight unless you really need them...
Archetypes and mxm Easy Product) but for now I'd settle for a way to invoke a ZCatalog Find/ReIndex programmatically via python in my user add and update programs.
They're python scripts right? Can you mail them to the list (if they're not too long...) Basically, you'll be looking to add: context.YourZCatalog.catalog_object(object) ...in the right place. Make sure you un-index them when they get deleted and/or moved. And they get indexed when they get pasted... cheers, Chris
participants (2)
-
Chris Withers -
Tom P. Allred