[Zope] How to use a ZSQLMethod from a Python Script

Igor Leturia IGOR@emun.com
Thu, 2 May 2002 18:39:07 +0200


>Igor Leturia writes:
> >   I want to call a ZSQLMethod from a Python Script. In Zope.org, I
> > couldn't find a specific how-to on the subject, but accidentally I
found
> > some other how-to's in which there are examples that use ZSQLMethods
> > from Python scripts. It seemed very easy, so I tried it that way:
> >=20
> >     res =3D context.mysqlmethod()
> >=20
> >   It gives an error message, 'resource not found'. Both the=20
>script and
> > the sql method are in the same folder. What's going wrong?
> > ....
> > Dieter Maurer writes:
> > >If it does not help, the precise error message (Error=20
>Type, Error Value
> > >and traceback) is necessary to help...
> > >
> >=20
> >   'container' doesn't work either. As for the error type=20
>and value, I
> > don't know, this is the message I get:
> >=20
> >    Site Error
> > An error was encountered while publishing this resource.=20
> > Resource not found
> > Sorry, the requested resource does not exist.
> > Check the URL and try again.
>
>Please run your Zope in debug mode (start it with "-D" option).
>
>   It will give you better error messages and tracebacks.
>

This is the traceback when running in debug mode:
Traceback (innermost last):
  File C:\Intranet\lib\python\ZPublisher\Publish.py, line 223, in
publish_module
  File C:\Intranet\lib\python\ZPublisher\Publish.py, line 187, in
publish
  File C:\Intranet\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
    (Object: Traversable)
  File C:\Intranet\lib\python\ZPublisher\Publish.py, line 173, in
publish
  File C:\Intranet\lib\python\ZPublisher\HTTPResponse.py, line 308, in
setBody
  File C:\Intranet\lib\python\ZPublisher\HTTPResponse.py, line 547, in
notFoundError
NotFound: (see above)