[Zope] dtml-let and quoting(?) or forcing to string

Mayers, Philip J p.mayers@ic.ac.uk
Mon, 21 Aug 2000 15:05:42 +0100


All,

I've just setup a test Zope installation. So far, very impressive.

I'm using a Postgresql database containing a network hierarchy (basically, a
table with a "network" column, and a "parentnet" column). I'm trying to
display this with a tree view, using the following DTML:

<dtml-let network="0/0">
<dtml-tree id=network branches_expr="network_children(parentnet=network)">
 <b><dtml-var network></b> <dtml-var descr>
</dtml-tree>
</dtml-let>

Where the network "0/0" is the pseudo-parent of every other network. The
problem is, python (or DTML, I don't know) interprets this as a divide by
zero, and it fails. The other alternative "0.0.0.0/0" also fails:

Expression (Python) Syntax error: 
invalid syntax

, for tag <dtml-let network="0.0.0.0/0">, on line 15 of test_html

(I'm doing all this through the web management interface). I'm not familiar
with Python (yet - the book is on it's way) but in the command-line
interpreter, this works fine:

>>> "0.0.0.0/0"
'0.0.0.0/0'
>>> "0/0"
'0/0'
>>>

I need to cast the value to dtml-let to a string. How? I know how to do this
in Perl/C/Java/Pascal, but it's not obvious to me why this isn't working.

Yours, dumbly....

Regards,
Phil

+----------------------------------+
| Phil Mayers, Network Support     |
| Centre for Computing Services    |
| Imperial College                 |
+----------------------------------+