[Zope] Help! Why doesn't this work...

David C. Morrill dmorrill@austin.rr.com
Thu, 14 Oct 1999 15:28:59 -0500


> All I want to do is create a list of DTML Documents in a Folder that have
a
> certain property defined.
>
> However, every variant I've tried of the following simple code causes an
> "Infinite recursion in document template" error:
>
> <dtml-in "PARENTS[0].objectValues(['DTML Document'])">
>   <dtml-var "_['sequence-item'].id">
> </dtml-in>
>
> It seems to be caused by the reference to 'sequence-item', but for the
life
> of me I can't figure out why this should cause a problem. Anyone have any
> ideas?

Eureka!!! After wasting nearly a full day on this, I've finally figured it
out. The correct code is:

<dtml-in "PARENTS[0].objectValues(['DTML Document'])">
  <dtml-var "_.getitem('sequence-item').id">
</dtml-in>

Apparently the first method evaluates 'sequence-item', which causes the
recursion since the document containing the code is itself in the sequence.
Ouch!

Dave Morrill