[ZPT] Re: Syntax troubles

Tim Moore tmoore@tembel.org
03 May 2001 15:05:13 +0000


The problem there is that the string module isn't imported by default
in a ZPT python expression (as it is in DTML) so it doesn't know where
to find the "string" part of that "string.split..." expression.

If you're using version 1.2, then I think this should work:

<tr tal:define="doc_src doc/document_src; apa python:modules['string'].split(doc_src, '@')">

The error message is a little confusing, but I believe that's a Python
internal thing, and not something generated by Zope or ZPT.

"Peter Bengtsson" <mail@peterbe.com> writes:

> <tr tal:define="doc_src doc/document_src; apa python:string.split(doc_src,
> '@')">
> 
> Error Type: TALESError
> Error Value: exceptions.NameError on string in ""
> 
> Maybe that I'm "stupid" but the error message isn't very descriptive.
> 
> Peter

-- 
Tim Moore