[ZPT] problem with 'object' arguments

Guenther Starnberger gst@sysfrog.org
Sun, 2 Mar 2003 20:33:46 +0100


hello,

i would like to use page templates in a product, but i always get the 
same error when trying to pass an object as argument to a zpt.

for example when i pass a (built-in) dictionary to the page template, i 
can access all the elements without any problem.

but when i pass an instance of the UserDict class (which should behave 
like a normal dictionary) to the pagetemplate i only get an error msg. 
('Undefined: You are not allowed to access muh in this context not 
found in 'options/servicedata/d/muh', at line 17, column 1')

i get the same error when trying to loop over the results of a sql 
method.

i have written a small sample product to demonstrate this problem. it 
is available at http://gst.sysfrog.org/testerr.tar.gz
(the index_html method returns a page template and passes one built-in 
and one UserDict dictionary as argument)

i am using zope version 2.5.1 and python version 2.1.3 (debian woody).

is this a bug in zope or in my product?

tia
/gst

(i'm not subscribed on this list - please cc me in replies, tnx)