- More DTML woes - problems with expressions
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
On Sat, 19 Dec 1998 skip@calendar.com wrote:
I also tried:
<!--#in entries--> <!--#var sequence-item--> <!--#/in entries-->
(MusicEntry objects have an html method...)
How about... <!--#in entries--> <!--#var html--> <!--#/in entries--> --- John Eikenberry [jae@taos.kavi.com - http://taos.kavi.com/~jae/] ______________________________________________________________ "A society that will trade a little liberty for a little order will deserve neither and lose both." --B. Franklin
John> How about... John> <!--#in entries--> John> <!--#var html--> John> <!--#/in entries--> Thanks. That did the trick. (I still don't understand why the sequence-item scheme didn't work. It worked in older versions of DTML. A backwards incompatibility I guess...) Skip Montanaro | Mojam: "Uniting the World of Music" http://www.mojam.com/ skip@calendar.com | Musi-Cal: http://concerts.calendar.com/ 518-372-5583
participants (2)
-
John Eikenberry -
skip@calendar.com