[Zope] dtml-in mapping, and sessions

Alejandro Fernandez ale@e-group.org
Tue, 9 Jul 2002 10:32:59 +0200


Thanks! 

Zope lets me know when I do this, and I pay by waiting a long time for
things to save and then having to cut and paste things somewhere to figure
out the line number... wish there was a cool editor for dtml that worked
on linux... So anyway, I pay in currency of time whenever I improperly
nest something, and the hard punishment teaches me fast :)

Ale

On Mon, 8 Jul 2002 10:01:04 -0700
"Charlie Reiman" <creiman@kefta.com> wrote:

> For your own sanity, try not to use dtml vars with "-" in them. This
> expression:
> 
> <dtml-let other-this="other-this + 1">
> 
> Will get parsed as
> _['other-this'] = other - this + 1
> 
> since python does not support variable names with a "-"
> 
> Also, dtml-let sets up a nested scope. You are trying to cross your if
> expression with your let expression:
> 
> <dtml-if><dtml-let></dtml-if></dtml-let>
> 
> won't result in a happy compiler. This is like tring to write a math
> expression like
> 
> (5+[4-3)+7]
> 
> If you want to set variable values, look into the SetTag product and
> leave dtml-let and dtml-var alone. They generally don't do what you
> want.
> 
> > -----Original Message-----
> > From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> > Alejandro Fernandez
> > Sent: Monday, July 08, 2002 7:52 AM
> > To: zope@zope.org
> > Subject: [Zope] dtml-in mapping, and sessions
> >
> >
> > 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
> >
> >
> >
> > --
> > Alejandro Fernandez
> > Electronic Group Interactive
> > --+34-65-232-8086--
> >
> >
> > _______________________________________________
> > 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 )
> >


-- 
Alejandro Fernandez
Electronic Group Interactive
--+34-65-232-8086--