[Zope] dtml-in mapping, and sessions

peter sabaini sabaini@inode.at
Mon, 08 Jul 2002 18:04:58 +0200


everything inside an expr="" (and "" is a shorthand for expr="") is a 
pythonic expression, and sequence-item is not a valid variable name in 
python. see chapter 8, "DTML Namespace Utility Functions" of the zope book

Alejandro Fernandez wrote:
> Hi,
> 
> I'm trying to output reports based on the result of a database query
> contained in a session variable.
> 
> It goes 
> 
> <dtml-in loopname mapping>
> <dtml-var this><dtml-var that><dtml-var the_other><br>
> <dtml-if "sequence-item > size">
> If at the end of the current sequence size, summarise all further results:
> 
> <dtml-let other-this="other-this + 1" 
>           other-that="other-that + 1"
>           other-theother="other-the_other +1"
> 
>   <dtml-if sequence-end>
>      <dtml-var other-this>
>      <dtml-var other-that>
>      <dtml-var other-theother>
>   </dtml-if>
> </dtml-if>
> </dtml-let>
> <dtml-in>
> 
> The problem is that the variable is a session variable: this is I
> think why anything like "<dtml-var sequence-step-size>" gives a key
> error. Is there a way to de-map things when working with the sequence?
> 
> Thanks,
> 
> Ale
> 
> 
>