[Zope] - More DTML woes - problems with expressions

skip@calendar.com (Skip Montanaro) skip@calendar.com (Skip Montanaro)
Sat, 19 Dec 1998 16:32:50 -0500


In the "old days", I was able to use constructs like:

    <!--#in entries-->
    <!--#var sequence-item fmt=html-->
    <!--#/in entries-->

(this was DTML 1.x).  Now that doesn't work.  I get a traceback:

    Traceback (innermost last):
      blah, blah, blah
      File /usr/local/lib/automatrix/python/DocumentTemplate.py, line 1375, in __getitem__
      File /usr/local/lib/automatrix/python/DocumentTemplate.py, line 1329, in __getitem__
    KeyError: .sequence-item.html

I then tried "_":

    <!--#in entries-->
    <!--#var "_['sequence-item'].html()"-->
    <!--#/in entries-->

That doesn't work either, but fails in an odd way.  The <!--#var ...-->
construct is just inserted into the output stream without expansion.
(Again, this is just Z Publisher + DocumentTemplate, not the full Zope
environment.)

I also tried:

    <!--#in entries-->
    <!--#var sequence-item-->
    <!--#/in entries-->

just to make sure my brain wasn't addled.  I got the output I expected:

    ...
    <musicentry.MusicEntry instance at 826b908>
    <musicentry.MusicEntry instance at 825a4a0>
    <musicentry.MusicEntry instance at 826cde0>
    ...

(MusicEntry objects have an html method...)

Where have I gone wrong (this time)?

Skip Montanaro	   | Mojam: "Uniting the World of Music" http://www.mojam.com/
skip@calendar.com  | Musi-Cal: http://concerts.calendar.com/
518-372-5583