[ZPT] URLs and stuff

Evan Simpson evan@4-am.com
Tue, 1 May 2001 11:35:25 -0500


From: <richard@bizarsoftware.com.au>
> How about just an extension to TALES such that there is another
attribute
> called 'tag' which is local to a given tag and contains a dictionary
of its
> attributes and its content as a string. This may then be passed to a
python
> method which may use the information to do its thing.

This would be useful without even calling a method.  I've thought a
couple times about:

<a href="a/valid/path" tal:attributes="href
string:${request/BASE1}/${tag/href}">

or

<input type="text" name="foo" tal:attributes="value
python:request.get(tag['name'])">

Of course, these two examples lead directly to the observation that the
TALES expressions are generic, and that you would probably want to apply
them to all tags of a given type.  Something like:

<body tal:process="a fixPaths;input setValues">

...could be implemented by adding implicit TAL code to each 'a' and
'input' tag as it is encountered. Then we have to decide how to handle
the interaction of multiple processors with explicit TAL code, as in:

<div tal:process="table tableMagic;table moreTableMagic">
  <table tal:define="foo expr" tal:condition="some/test"> ...

Cheers,

Evan @ digicool