[Zope] Regarding ZODB

amol kumbhar amol.kumbhar39 at gmail.com
Wed Mar 25 00:58:25 EDT 2009


Hi!

I am trying to execute following code

*import ZODB
from Persistence import Persistent

class Employee(Persistent):

    def setName(self, name):
        self.name = name
*
but getting following error

*Error Type: ImportError
Error Value: import of "Persistent" from "Persistence" is unauthorized. You
are not allowed to access 'Persistent' in this context*

this is my full error log


Time 2009/03/24 22:31:33.559 GMT+0530  User Name (User Id) admin
(admin)  Request
URL http://localhost:9673/DeveloperGuide/Simpleinterface  Exception Type
ImportError  Exception Value import of "Persistent" from "Persistence" is
unauthorized. You are not allowed to access 'Persistent' in this context

Traceback (innermost last):

   - Module ZPublisher.Publish, line 119, in publish
   - Module ZPublisher.mapply, line 88, in mapply
   - Module ZPublisher.Publish, line 42, in call_object
   - Module Shared.DC.Scripts.Bindings, line 313, in __call__
   - Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
   - Module Products.PythonScripts.PythonScript, line 327, in _exec
   - Module None, line 2, in Simpleinterface
   *<PythonScript at /DeveloperGuide/Simpleinterface>*
   *Line 2*
   - Module AccessControl.ZopeGuards, line 284, in guarded_import

ImportError: import of "Persistent" from "Persistence" is unauthorized. You
are not allowed to access 'Persistent' in this context

Display traceback as
text<http://localhost:9673/error_log/getLogEntryAsText?id=1237914093.560.351902229926>

  REQUEST form-C''cookiesdtpref_rows'20'dtpref_cols'90%'tree-s
'eJzT0MgpMOQKVneEA1dbda4CI67EkgJjLj0AeGcHew'GLog
'%7Bleft%3A0%2Ctop%3A0%2Cwidth%3A1175%2Cheight%3A630%2CpriorityDefaults%3A%7BLog%3A4%7D%2CdefaultPriority%3A3%2CtrackRPC%3Anull%7D'lazy
itemsSESSION<bound method SessionDataManager.getSessionData of
<SessionDataManager at /session_data_manager>>otherTraversalRequestNameStack
[]AUTHENTICATED_USER<User 'admin'>URL'
http://localhost:9673/DeveloperGuide/Simpleinterface'SERVER_URL'
http://localhost:9673'AUTHENTICATION_PATH''traverse_subpath[]PUBLISHED<PythonScript
at /DeveloperGuide/Simpleinterface>ACTUAL_URL'
http://localhost:9673/DeveloperGuide/Simpleinterface'URL0
http://localhost:9673/DeveloperGuide/SimpleinterfaceURL1
http://localhost:9673/DeveloperGuideURL2http://localhost:9673BASE0
http://localhost:9673BASE1http://localhost:9673BASE2
http://localhost:9673/DeveloperGuideBASE3
http://localhost:9673/DeveloperGuide/SimpleinterfaceenvironHTTP_COOKIE'dtpref_rows="20";
dtpref_cols="90%";
GLog=%7Bleft%3A0%2Ctop%3A0%2Cwidth%3A1175%2Cheight%3A630%2CpriorityDefaults%3A%7BLog%3A4%7D%2CdefaultPriority%3A3%2CtrackRPC%3Anull%7D;
tree-s="eJzT0MgpMOQKVneEA1dbda4CI67EkgJjLj0AeGcHew"'SERVER_SOFTWARE'Zope/(Zope
2.10.5-final, python 2.4.5, linux2) ZServer/1.1'SCRIPT_NAME''REQUEST_METHOD
'GET'PATH_INFO'/DeveloperGuide/Simpleinterface'SERVER_PROTOCOL'HTTP/1.1'
channel.creation_time1237914020CONNECTION_TYPE'keep-alive'
HTTP_ACCEPT_CHARSET'ISO-8859-1,utf-8;q=0.7,*;q=0.7'HTTP_USER_AGENT'Mozilla/5.0
(X11; U; Linux i686; en-US; rv:1.9.0.7) Gecko/2009030422 Ubuntu/8.04 (hardy)
Firefox/3.0.7'HTTP_REFERER'
http://localhost:9673/DeveloperGuide/Simpleinterface/ZPythonScriptHTML_editForm
'SERVER_NAME'0.0.0.0'REMOTE_ADDR'127.0.0.1'PATH_TRANSLATED
'/DeveloperGuide/Simpleinterface'SERVER_PORT'9673'HTTP_HOST'localhost:9673'
HTTP_ACCEPT'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
GATEWAY_INTERFACE'CGI/1.1'HTTP_ACCEPT_LANGUAGE'en-us,en;q=0.5'
HTTP_ACCEPT_ENCODING'gzip,deflate'HTTP_KEEP_ALIVE'300'


I think I have to change permissions, but the question is from WHERE please
help me out..


Thanks,
Amol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20090325/0557fdf4/attachment.html 


More information about the Zope mailing list