[Zope] Python scripts - DB connection question...

Lee lee.reilly@ntlworld.com
Thu, 05 Jul 2001 00:44:36 +0100


Phil Harris wrote:

> I would have thought that the only change would need to be to change 'self'
> to 'context'.

Thanks Phil, but I've still got some problems. I'm using Zope on the NipLtd
server...

The script appears to be connecting okay (well, it doesn't result in an error),
but when I try and execute the SQL I am asked for my user/auth again, which
isn't recognised and gives the following error:

result=db_conn.query(updatePersonSQL) =>

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Unauthorized

Sorry, a Zope error occurred.

Traceback (innermost last):
  File /usr/local/zope/2.3.2_base/lib/python/ZPublisher/Publish.py, line 223,
in publish_module
  File /usr/local/zope/2.3.2_base/lib/python/ZPublisher/Publish.py, line 187,
in publish
  File /usr/local/zope/2.3.2_base/lib/python/ZPublisher/Publish.py, line 171,
in publish
  File /usr/local/zope/2.3.2_base/lib/python/ZPublisher/mapply.py, line 160, in
mapply
    (Object: processData)
  File /usr/local/zope/2.3.2_base/lib/python/ZPublisher/Publish.py, line 112,
in call_object
    (Object: processData)
  File /usr/local/zope/2.3.2_base/lib/python/Shared/DC/Scripts/Bindings.py,
line 324, in __call__
    (Object: processData)
  File /usr/local/zope/2.3.2_base/lib/python/Shared/DC/Scripts/Bindings.py,
line 354, in _bindAndExec
    (Object: processData)
  File
/usr/local/zope/2.3.2_base/lib/python/Products/PythonScripts/PythonScript.py,
line 336, in _exec
    (Object: processData)
    (Info: ({'script': <PythonScript instance at be96aa8>, 'context': <Folder
instance at b1ddc48>, 'container': <Folder instance at b1ddc48>,
'traverse_subpath': []}, ('1', '3', '2'), {}, None))
  File Script (Python), line 14, in processData
  File /usr/local/zope/2.3.2_base/lib/python/Products/PythonScripts/Guarded.py,
line 273, in __getattr__
  File /usr/local/zope/2.3.2_base/lib/python/Products/PythonScripts/Guarded.py,
line 150, in __careful_getattr__
  File /usr/local/zope/2.3.2_base/lib/python/AccessControl/SecurityManager.py,
line 144, in validate
  File
/usr/local/zope/2.3.2_base/lib/python/AccessControl/ZopeSecurityPolicy.py, line
168, in validate
Unauthorized: query
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

Does anyone have any idea what's wrong?

Cheers,
Lee