Re: [Zope] zcatalog documentation
On Monday 08 December 2003 14:10, you wrote:
--On Montag, 8. Dezember 2003 14:06 Uhr +0100 Richard Jennings
<rjennings@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?
Richard Jennings wrote at 2003-12-8 21:34 +0100:
... 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
Remember! Whenever you report an error, include the traceback (together with the information your provided above!). Apparently, you have been able to catalog a "mybrains" instance. "mybrains" instances cannot be unpickled (deserialized) as the class "mybrains" is locally defined inside a function. Therefore, they must not be made persistent or used as or in attributes of a persistent object. -- Dieter
participants (2)
-
Dieter Maurer -
Richard Jennings