seb writes:
If you do:
dtml-in "objectValues('Foo Thing')"
dtml-let thing=sequence-item
dtml-var "thing.id()"
/dtml-let
/dtml-in
"sequence-item" is not a string.
However, dtml-let ... xxx=name ...
calls "name" (if callable) like any name argument to a
"dtml"
If you do:
dtml-in "objectValues('Foo Thing')"
dtml-let thing=sequence-item
dtml-var "thing.id()"
/dtml-let
/dtml-in
You get TypeError: it claims thing is a string, so you can't perform any
kind of function call against it.
Some id attributes of Zope objects are methods, some are
seb wrote:
If you do:
dtml-in "objectValues('Foo Thing')"
dtml-let thing=sequence-item
dtml-var "thing.id()"
/dtml-let
/dtml-in
You get TypeError: it claims thing is a string, so you can't perform any
kind of function call against it.
Welcome to
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]
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:
dtml-let si=sequence-item
dtml-var "si"
/dtml-let
Now
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:
dtml-var "_['sequence-item']"
-CJ
___
Zope maillist
"Christopher J. Kucera" wrote:
Try:
dtml-var "_['sequence-item']"
or
dtml-var "_getitem('sequence-item',0)"
If you don't want the object to be called ebfore being displayed...
cheers,
Chris
___
Zope maillist - [EMAIL PROTECTED]
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
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 "&quo
Hello again
I´m still testing the usability and reliability of Zope. To accomplish this
goal I am developing a very very simple shopping cart. But I got troubled by
something aparently simple. This is the code:
dtml-in "SESSION['cartItems']"
dtml-in
Hello again
I´m still testing the usability and reliability of Zope. To accomplish this
goal I am developing a very very simple shopping cart. But I got troubled by
something aparently simple. This is the code:
dtml-in "SESSION['cartItems']"
dtml-in
Fabio Akita schrieb:
[ sequence-item in a python expression ]
Error Type: NameError
Error Value: sequence
Anyone knows what is going on? I think this must be a simple thing.
Everything in quotes is taken as a python expression, therefore Zope
wants to evaluate "sequence - item"; this
12 matches
Mail list logo