newbie: call dtml-method with parameter sequence-item
Hi! How does one call, say, a "Z SQL-method" Z(x) with Parameter x from inside a loop in a DTML-document with "sequence-item" as a parameter? Of course you can't <dtml-in "_.range(10)"> <dtml-call "Z(<dtml-var sequence-item>)"> </dtml-in> because you'd have to nest one dtml-tag in another. But what can you do? I guess the trick is simple, but I can't find it... a humble newbie Horst _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Horst Wald writes:
loop in a DTML-document with "sequence-item" as a parameter? Of course you can't <dtml-in "_.range(10)"> <dtml-call "Z(<dtml-var sequence-item>)"> </dtml-in> because you'd have to nest one dtml-tag in another. But what can you do? I guess the trick is simple, but I can't find it... Z SQL Methods accept only a single positional argument (which must be a mapping with "get" method) exclusive or a set of keyword parameters. Your "sequence-item" is probably not a mapping, thus you would need something like:
<dtml-call "Z(xxx=_['sequence-item'])"> Are you sure, you want to discard the return value? If not, you would need "dtml-var" rather than "dtml-call". Personally, I prefer the introduction of a new variable to avoid the "_[...]" syntax: <dtml-let current=sequence-item> <dtml-call "Z(xxx=current)"> </dtml-let> Dieter
participants (2)
-
Dieter Maurer -
Horst Wald