[Zope] another "issue.1999.01"-Problem

Tom Schwaller Tom.Schwaller@linux-magazin.de
Sat, 11 Sep 1999 17:43:28 +0200


well, here another problem I'm fighting with:

<dtml-with "_.getattr(_.getattr(issue, '1998'), '01')"> or
<dtml-with issue><dtml-with 1998><dtml-with 01>

works perfect, but now I want to get the string Wo="issue.1998.01" 
from an input-field and go to the corresponding subfolder (always
begining from the top)

<dtml-in "_.string.split(Wo, '/')">
<dtml-if sequence-start>
<dtml-call "REQUEST.set('Wo', _.getattr(PARENTS[-1], sequence-item))">
<dtml-else>
<dtml-call "REQUEST.set('Wo', _.getattr(Wo, sequence-item))">
</dtml-if>
</dtml-in>

gives 

 File
/home/src/Python/Zope-2.0.0-src/lib/python/DocumentTemplate/DT_Util.py,
line 321, in eval
    (Object: REQUEST.set('Wo', _.getattr(PARENTS[-1], sequence-item)))
  File <string>, line 0, in ?
NameError: (see above)

Wo="News" as input for

<dtml-call "REQUEST.set('Wo', _.getattr(PARENTS[-1], Wo))">

works as expected. Is sequence-item not a string in the above example?

-- 

Tom