[Zope] Searching for and displaying properties

Sinang, Danny D.Sinang at spi-bpo.com
Sat Jun 24 09:50:15 EDT 2006


Dear All,
 
I managed to add a property to an object by using the manage_addproperty
() method.
 
However, if I don't issue a manage.reindexIndex () for the new property,
it won't come out in the catalog search results.
 
So I issue reindexIndex (), but when I finally try to display the
property, all I get is 'Missing Value'.
 
But if I then issue the command refreshCatalog(clear=1), the property is
now visible. Although refreshCatalog works, it would gobble up the
server's CPU and memory resources everytime its run.
 
My question is, is there another command I can use instead of
refreshCatalog to make the property display ?
 
Below is the code I'm talking about :
 
wf = context.GeneralWorkflow
instance_id = wf.addInstance( process_id=process, customer=jobname,
comments=comment, title=subject, activation=1)
wf.getInstance(instance_id).manage_addProperty('jobname', 'ABC12345',
'string')
wf.Catalog.manage_reindexIndex(ids=['jobname'], REQUEST=None,
RESPONSE=None, URL1=None)
 
jobs = cat.searchResults({'jobname':'ABC12345'})
 
for j in jobs:
    print j.jobname
 
 
 
Regards,
Danny
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20060624/8c7115b2/attachment.htm


More information about the Zope mailing list