[Zope] Python Script: excape problem /kv

Kai Vermehr k at eboy.com
Thu Nov 6 07:11:00 EST 2003


I'm working through an example in the Zope Book and I want to display a 
random image inside the folder 'images'. But instead of a picture I get 
the source with all the tags escaped.

I have this Python script named 'randomImage':
------------------------------------
import random
return random.choice(context.objectValues('Image'))
------------------------------------


I have this body in a ZPT named 'use_randomImage':
------------------------------------
   <body>
     <span tal:replace="here/images/randomImage">image</span>
   </body>
------------------------------------

And I get this generated source w escaped tags (body) when I call the 
ZPT:
------------------------------------
   <body>
     &lt;img 
src=&quot;http://www.mycomputer.local/images/deck_mika.gif&quot; 
alt=&quot;deck_mika.gif&quot; title=&quot;deck_mika.gif&quot; 
height=&quot;142&quot; width=&quot;35&quot; border=&quot;0&quot; /&gt;
   </body>
------------------------------------


of course I want the image instead of escaped html ...
any ideas what I'm doing wrong?

thanks! 'K:?

--
Kai Vermehr | eBoy
http://www.eboy.com




More information about the Zope mailing list