[ZPT] Re: TALES namespace names cannot contain '-'

Evan Simpson evan at 4-am.com
Fri Sep 2 07:19:48 EDT 2005


Steve Alexander wrote:
>>  python:x and path('%s/%s' (base, x))
> 
> I don't understand this example.
> 
> I see that there's meant to be a '%' operator in there.

Yes, sorry.

> But, I don't understand what "use of the name of a namespace as a
> function in a Python expression" means, and I see only the function
> 'path' above.

In Zope 2's ZPT, each namespace ('python', 'path', 'exists', etc) is
also available as a function taking a string.  Thus the TALES
expressions "exists:x/y" and "python:exists('x/y')" are equivalent,
although the latter is less efficient.

This isn't fundamental or anything, I just thought I'd point it out.

Cheers,

Evan @ 4-am


More information about the ZPT mailing list