[Zope] sequence-item and ""

Jonothan Farr jfarr@real.com
Tue, 18 Jul 2000 16:44:36 -0700


I've patched this for 2.1.6. Now you can use sequence_item in addition to
sequence-item.

http://www.zope.org/Members/jfarr/Patches/dtml-in-sv

There's a much cooler and more elegant solution in the pipe for 2.2.

http://www.zope.org/Members/4am/DTMLWiki/NamedDTMLInLoop

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998

----- Original Message -----
From: Rob Miller <rob-at-kalistra-dot-com@kalistra.com>
To: Diego Rodrigo Neufert <diego@magicwebdesign.com.br>
Cc: <zope@zope.org>
Sent: Tuesday, July 18, 2000 1:30 PM
Subject: Re: [Zope] sequence-item and ""


>
> Diego Rodrigo Neufert writes:
>
> > Hi ppl...
> >
> > Why I cant use dtml-var "sequence-item">??
>
> Because, as I understand it, anything within "" gets treated as Python code
> by the DTML interpreter.  Thus "sequence-item" is parsed as an expression:
> sequence _minus_ item.  A dash is not a valid variable name character in
> Python, but it is in DTML; this is unfortunate.
>
> >
> > Every time I try to access sequence-item under "" in a dtml-call dtml-var or
> > anything else I got this error:
> >
> > Error Type: NameError
> > Error Value: sequence
> >
> > Well, I found a solution:
> > <dtml-let si=sequence-item>
> > <dtml-var "si">
> > </dtml-let>
> > Now everything is ok... but I dont want to do this, I want to access the
> > *&@%$#@& sequence-item in "".
>
> I've searched through the list archives and come to the conclusion that
> your solution above is the cleanest way to handle this, for now.  There are
> other ways, but they involve ugly-looking permutations of the "_" namespace
> variable, and they approach the splendor of Perl in their readability.  The
> "right" solution, IMHO, would be to rename the "sequence-..." variables to
> a different set of names that doesn't cause the Python interpreter to
> choke.  I seem to recall someone saying that this (or something similar)
> was being worked on, but, alas, for now <dtml-let> is our best option.
>
> rob
>
> >
> > Can anyone help me?
> >
> > -----------------------------
> > Diego Rodrigo Neufert
> > -webmaster
> > ---------------------------
> > (Magic Web Design)
> > (email) (diego@magicwebdesign.com.br)
> > (curitiba) (pr)
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> >
>
>
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>