[Zope] Re: First python script in zope - import problem (permissions)

Dan Shafer dan@gui.com
Fri, 21 Dec 2001 22:39:56 -0800


Joshua Lanza wrote:

>I have created a new script object called get_timestamp. I put the
>following code in there:
>
>import time
>return int(time.time())
>
>When I try to test it, I get user and password prompt and Unauthorized.
>Something else I need to do?=20

I don't think you can do time-based stuff in a Python script in Zope. 
On p. 153 of the Zope Book, it outlines the fairly tight restrictions 
on what you can import into Python from inside Zope and the time 
stuff is not listed.

You _can_ do this with an External Method, assuming you have proper 
access rights to the outside-Zope portion of your server.

-- 
Dan Shafer, Author-Consultant
http://www.danshafer.com
http://www.shafermedia.com