The problem is that the Catalog cannot be found through acquisition. I can't figure out why. I can perfectly use the Catalog from DTMLs in the Product but there is no way Catalog can be found from within Python, ie "self.Catalog" does not work. Printing the 'self' reveals that it is an instance of the caller Python class. What can be done to make 'self' acquire from parents? Regards, Ioannis douwe@oberon.nl έγραψε: Hi, I'm affraid that I missed the start of this thread, as I only recently joined. For me: for catitem in self.Catalog.searchResults(meta_type='ContactItem', Login=username): obj=self.Catalog.getobject(catitem.data_record_id_) Seems to work just fine. self finds the catalogue by acquisition and from there it is just like python in a zope script. Douwe -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Ioannis Koukos Sent: Friday, June 14, 2002 11:37 AM To: zope@zope.org Subject: Re: [Zope] Search ZCatalog from Python code My ZCatalog ("Catalog") is placed on the root folder. So, there is the need to move back to retrieve and use it. Chris' snippet for the container object obviously doesn't work. Any help / suggestion? Thanks Chris McDonough <chrism@zope.com> wrote Inside a class of a Zope Product: container = "self.aq_inner.aq_parent" context = self Ioannis Koukos wrote:
I've been trying to find documentation on how to search the ZCatalog from within a Zope product but there is a lack of documentation on that. Can this be done? If this is the case, how can external python products 'see' the context and container objects?
--------------------------------- Do You Yahoo!? Αποκτήστε την δωρεάν σας@yahoo.gr διεύθυνση στο Yahoo! Mail.