Hi Tino. Yes, that is correct. This application has variables named like:


Not very clever.

This also fails in a Page Template:

<span tal:define="standards python: request.SESSION">
   <tal:block define="temp python: data.set('AR-DA-08',AR-DA-

you still have to quote if you mean the variable with that
weird name. Otherwise its an expression in python.

_['AR-DA-08'] could work in DTML... but lets better forget
that ;) Where does your variable live? In Request maybe?


With the error:

Compilation failed
TAL.TALDefs.TALError: Python expression error:
invalid token (Python expression "data.set('AR-DA-08',AR-DA-08)", line 1) in expression "python: data.set('AR


Yet this works:

<span tal:define="standards python: request.SESSION">
   <tal:block define="temp python: data.set('AR-DA-07',AR-DA-

So you are saying the interpreter is seeing the '-' as a minus? Why would it work in one case and not the other?

See Andrew's note on ocal numbers.

Could the minus be escaped somehow?

No, but see above.

Could you please escape the horribly code + template
mixing with DTML? ;) See the zope book for python scripts.
(After all in DTML "expressions" its already python code,
so why not write just python code and skip all that
<foo> stuff around it you dont need anyway?

Tino Wildenhain
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to