[Zope] Xron question--why won't method work

Chris Muldrow muldrow@mac.com
Wed, 21 Feb 2001 18:58:08 -0500


Here's a clarified version of a question i asked earlier that is still
stumping me. Why will this method work as a regular DTML Method but not as a
Xron method: 

<dtml-in expr="objectValues('DTML Document')">
<dtml-let newname="'o13'">
<dtml-let nameadd=id>

<dtml-let newname="nameadd+newname">
<dtml-let newtitle="'Chris'">
<dtml-let story=document_src>

<dtml-let credate="ZopeTime()">
<dtml-with "PARENTS[0]">
<dtml-call expr="addFLSNews(newname, story, credate)">
</dtml-with>
</dtml-let>
</dtml-let>
</dtml-let>
</dtml-let>
</dtml-let>
</dtml-let>
</dtml-in>


And here's the external method that it's calling:

def addFLSNews(self, newid, data, REQUEST=None):
      """ """
      # Get the actual destination object, using the this()
      # method, to be sure we get it in the right context..
      self=self.this()
      
      # Create the new instance
      newob=self.Control_Panel.Products.FLSNewsStory.FLSNewsStory(data)
      newob._setId(newid)
    
      self._setObject(newid, newob)
      
      newob.title=getTitle(data)
      
      varStoryName=getStoryName(data)
      varUser=getUser(data)
      varPicID=getPicID(data)
      varCategory=getCategory(data)
      varLocality=getLocality(data)
      varBasket=getBasket(data)
      varNwords=getNwords(data)
      varEditionInfo=getEditionInfo(data)
      varSummary=getSummary(data)
      
      self._setProperty('User', varUser, type='string')
      self._setProperty('StoryName', varStoryName, type='string')
      self._setProperty('PicID', varPicID, type='string')
      self._setProperty('Category', varCategory, type='string')
      self._setProperty('Locality', varLocality, type='string')
      self._setProperty('Basket', varBasket, type='string')
      self._setProperty('Nwords', varNwords, type='string')
      self._setProperty('EditionInfo', varEditionInfo, type='string')
      self._setProperty('Summary', varSummary, type='string')

It's hitting a problem at the self.setObject line. This method works when I
run it as a regular DTML Document, but it hits an "Attribute Error on
self.setObject when I run it as an Xron. I'm using the trigger tab, but I've
also tried letting it run as scheduled--neither works.