[Zope-dev] possible bug in dtml-in

Jim Sanford jsanford@atinucleus.com
Thu, 22 Jun 2000 12:37:57 -0500


Shouldn't that be "sequence-end" instead of "sequence-last"?

----- Original Message ----- 
From: Federico Di Gregorio <fog@mixadlive.com>
To: Zope Dev <zope-dev@zope.org>
Sent: Thursday, June 22, 2000 12:16 PM
Subject: [Zope-dev] possible bug in dtml-in


hi *,

an external method returns a list of tuples like this one:

[(elt1, elt2), (elt3, elt4), ...]

and i want to print something after the last one so i do:

<dtml-in "build_list(args...)">
          ...do some work here...
          <dtml-if sequence-last>
            should be executed only after last iteration
          </dtml-if>
        </dtml-in>

that always worked (when getting stuff out of a DB, for example) but
with a list built as above, if there is *more* than 1 element i get...

  File /usr/lib/zope/lib/python/DocumentTemplate/DT_Util.py, line 276, in render
  File /usr/lib/zope/lib/python/OFS/DTMLMethod.py, line 146, in __call__
    (Object: lettera_ricevuta)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__
    (Object: lettera_ricevuta)
  File /usr/lib/zope/lib/python/OFS/DTMLMethod.py, line 146, in __call__
    (Object: genera_ricevuta_mail)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__
    (Object: genera_ricevuta_mail)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_In.py, line 691, in renderwob
    (Object: elenco.keys())
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_Let.py, line 145, in render
    (Object: key=sequence-item)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_In.py, line 691, in renderwob
    (Object: elenco[key][1])
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_Let.py, line 145, in render
    (Object: row=sequence-item)
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_InSV.py, line 392, in __getitem__
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_InSV.py, line 194, in last
  File /usr/lib/zope/lib/python/DocumentTemplate/DT_InSV.py, line 182, in value
TypeError: getattr, argument 2: expected string, int found

any idea?
federico

-- 
Federico Di Gregorio
MIXAD LIVE System Programmer                           fog@mixadlive.com
Debian GNU/Linux Developer & Italian Press Contact        fog@debian.org
  Those who do not study Lisp are doomed to reimplement it. Poorly.
                                      -- from Karl M. Hegbloom .signature

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )