[Zope] ZPT / TALES question

Paul Winkler pw_lists@slinkp.com
Fri, 20 Dec 2002 11:33:39 -0800


On Fri, Dec 20, 2002 at 12:09:42PM -0600, AJ Coon wrote:
> TALES uses the 'options' variable to store the dictionary of key/value 
> pairs passed into a ZPTemplate when it gets parsed.  My question is: 
> What 'is' options?  Obviously, it is some sort of dictionary, but what 
> does it inherit from, etc.?
(snip) 
> <input type="hidden" name="copy" value="" tal:attributes="value 
> options/copy">
> 
> I had passed a variable named 'copy' into the options dictionary with my 
> own value
(snip)

It might well be a standard dictionary.  Dictionaries in python
have a copy() method which returns a copy of the dictionary.
The TALES path expression calls the method, so you get the
method's return value rather than the method itself.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's THE SPICE!
(courtesy of isometric.spaceninja.com)