[Zope] Reindex_object problem
Chris Muldrow
muldrow@mac.com
Fri, 30 Mar 2001 10:55:47 -0500
I'm having trouble getting reindex_object to work inside an external method.
I suspect my syntax is flawed. What I'm doing is instantiating a
Catalog-aware ZClass and then attaching properties to it. I know I need to
reindex after I've added properties, but it doesn't like it in the external
method. (I have been able to reindex with a separate piece of DTML, but
that's not ideal!) Thanks in advance--Chris
def addFLSNews(newdir, newid, data, credate, workDir):
""" """
# Get the actual destination object, using the this()
# method, to be sure we get it in the right context..
data=processXMLEntities(data)
storyText=getBody(data)
# Create the new instance
newob=newdir.Control_Panel.Products.FLSNewsStory.FLSNewsStory(storyText)
newob._setId(newid)
newdir._setObject(newid, newob)
newob.title=getTitle(data)
varPics=getPics(workDir, data, credate, newid, newdir)
varStoryName=getStoryName(data)
varByfunc=getByfunc(data)
varUser=getUser(data)
varAuthor=getAuthor(data)
varPicID=getPicID(data)
varCategory=getCategory(data)
varLocality=getLocality(data)
varBasket=getBasket(data)
varNwords=getNwords(data)
varEditionInfo=getEditionInfo(data)
varSummary=getSummary(data)
newob.propertysheets.FLSNewsProperties.manage_changeProperties({'PhotosList'
:varPics})
newob.propertysheets.FLSNewsProperties.manage_changeProperties({'User':varUs
er})
newob.propertysheets.FLSNewsProperties.manage_changeProperties({'Byline':var
Author})
newob.propertysheets.FLSNewsProperties.manage_changeProperties({'StoryName':
varStoryName})
newob.propertysheets.FLSNewsProperties.manage_changeProperties({'Byfunc':var
Byfunc})
newob.propertysheets.FLSNewsProperties.manage_changeProperties({'PicID':varP
icID})
newob.propertysheets.FLSNewsProperties.manage_changeProperties({'Category':v
arCategory})
newob.propertysheets.FLSNewsProperties.manage_changeProperties({'Locality':v
arLocality})
newob.propertysheets.FLSNewsProperties.manage_changeProperties({'Nwords':var
Nwords})
newob.propertysheets.FLSNewsProperties.manage_changeProperties({'EditionInfo
':varEditionInfo})
newob.propertysheets.FLSNewsProperties.manage_changeProperties({'Summary':va
rSummary})
newob.propertysheets.FLSNewsProperties.manage_changeProperties({'CreateDate'
:credate})
newob.propertysheets.FLSNewsProperties.manage_changeProperties({'Basket':var
Basket})
newob.reindex_object
-- Chris Muldrow, muldrow@mac.com