[Zope] expected string or Unicode object, ImplicitAcquirerWrapper found

Dieter Maurer dieter at handshake.de
Tue Mar 23 15:25:16 EST 2004


Marc Lindahl wrote at 2004-3-22 12:57 -0500:
>I have a python script called logoName.py, as follows:
>
>return 'logo.jpg'
>
>then I'm trying to use that in a DTML method.  This works fine:
>
>&dtml-portal_url;/&dtml-logoName;
>
>Whereas this gives me an error:
>
><dtml-var "_[logoName].getURL">
> ...
>       __traceback_info__: logoName
>     * Module <string>, line 2, in f
>     * Module AccessControl.DTML, line 32, in guarded_getitem
>     * Module AccessControl.ZopeGuards, line 90, in guarded_getitem
>
>TypeError: expected string or Unicode object, ImplicitAcquirerWrapper 
>found

"logoName" is an "ImplicitAcquirerWrapper" wrapping your Python Script.
Thus, you should call it to get "logo.jpg".

I expect that you somehow want to get the object with id "logo.jpg".
This would look like:

     "_.getitem(logoName())".

I do not know "getURL".
The name suggests it is a method,
then "_.getitem(logoName()).getURL" would be wrong.
Instead, you would need to use "_.getitem(logoName()).getURL()".
However, I expect, "getURL" is not the correct method...

-- 
Dieter



More information about the Zope mailing list