[Zope] zcatalog documentation

Richard Jennings rjennings at stradefi.com
Tue Dec 9 01:26:32 EST 2003


On Monday 08 December 2003 14:10, you wrote:
> --On Montag, 8. Dezember 2003 14:06 Uhr +0100 Richard Jennings
>
> <rjennings at stradefi.com> wrote:
> > Hi there,
> >
> > can someone point me to a reference for writing queries for zcatalog in
> > python. I have not been able to find anything that doesn't assume I'm
> > using ZMI or DTML.
>
> Look into the Zope Book 2.6 edition.
>
> -aj

Thanks - I've studied it without much success.  I have attached the method of a class
I am trying to use.  It queries (I think) the catalog 'users' and uo = ro[0] returns
a mybrains instance.  When I add the .getObject() I get the error listed below.
Worse, I can't clear the error without deleting the directory in which the object
resides.  I am using zope 2.6.1 with python 2.1.3

    def _userFullNameGet(self):
        ro = self.ssDirectory.users({'e_pnum': 'S.141.int'})
        uo = ro[0].getObject()
        return

Error Type: SystemError
Error Value: Failed to import class mybrains from module Products.ZCatalog.Catalog

What am I doing wrong that can be this disturbing to zope?
Can you help me, please?
-------------------------------

I have now discovered that the problem seems to occur when the search fails and I get
back an empty brain. (yeh, - probably mine!)  Trapping out IndexError solves the problem.
I am back on the rails.

Thanks for your response




More information about the Zope mailing list