[Zope] sequence- variables

Paul Winkler pw_lists@slinkp.com
Tue, 11 Jun 2002 15:45:26 -0400


On Tue, Jun 11, 2002 at 12:16:27PM -0700, D. Rick Anderson wrote:
> How can I use the sequence variables for something other than rendering? 
> I can do a <dtml-var sequence-number> and it will render the current 
> sequence number just fine, but if I do a <dtml-if "sequence-number == 
> numberVariable"> it barfs. It also barfs if I try to assign it to 
> another variable. What am I doing wrong?

You're forgetting that everything in quotes in a dtml-if is implicitly
a python expression, and dashes are illegal in python variable names.
Python interprets that as "sequence MINUS number".

There are a couple of solutions. Read this: 
http://www.zope.org/Documentation/ZopeBook/AdvDTML.stx
... in the section called  DTML Namespace Utility Functions.

-- 

Paul Winkler
home:  http://www.slinkp.com
"Muppet Labs, where the future is made - today!"