Re: [Zope] sequence-item and ""
Jonothan Farr wrote: > There's a much cooler and more elegant solution in the pipe for 2.2. > > http://www.zope.org/Members/4am/DTMLWiki/NamedDTMLInLoop I don't think this landed for 2.2... Chris ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] sequence-item and ""
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 <[EMAIL PROTECTED]> To: Diego Rodrigo Neufert <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> 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: > > > > > > > > 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 is our best option. > > rob > > > > > Can anyone help me? > > > > - > > Diego Rodrigo Neufert > > -webmaster > > --- > > (Magic Web Design) > > (email) ([EMAIL PROTECTED]) > > (curitiba) (pr) > > > > ___ > > Zope maillist - [EMAIL PROTECTED] > > 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 - [EMAIL PROTECTED] > 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 - [EMAIL PROTECTED] 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 )
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: > > > > 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 is our best option. rob > > Can anyone help me? > > - > Diego Rodrigo Neufert > -webmaster > --- > (Magic Web Design) > (email) ([EMAIL PROTECTED]) > (curitiba) (pr) > > ___ > Zope maillist - [EMAIL PROTECTED] > 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 - [EMAIL PROTECTED] 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 )
Re: [Zope] sequence-item and ""
"Christopher J. Kucera" wrote: > Try: > > or If you don't want the object to be called ebfore being displayed... cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] sequence-item and ""
Diego Rodrigo Neufert wrote: > > Why I cant use dtml-var "sequence-item">?? Because anything inside quotes is evaluated as a Python expression. It's trying to subtract 'item' from 'sequence.' Try: -CJ ___ Zope maillist - [EMAIL PROTECTED] 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] sequence-item and ""
Hi ppl... Why I cant use dtml-var "sequence-item">?? 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: Now everything is ok... but I dont want to do this, I want to access the *&@%$#@& sequence-item in "". Can anyone help me? - Diego Rodrigo Neufert -webmaster --- (Magic Web Design) (email) ([EMAIL PROTECTED]) (curitiba) (pr) ___ Zope maillist - [EMAIL PROTECTED] 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 )