[Zope] ZCatalog searching

Dieter Maurer dieter@handshake.de
Tue, 7 Aug 2001 21:00:22 +0200 (CEST)


brian.r.brinegar.1 writes:
 > I would like to something where I list off objects in a folder and specify
 > which objects are currently cataloged in a specific ZCatalog. Is there a
 > good way to say, "Is this object in the catalog?" something like
 > ZCatalog.isObjectCataloged(object).
There is currently no such method,
but you could easily create one:

    import string

    class ZCatalog:
      ....
      def isObjectCataloged(self,object):
        uid= string.join(object.getPhysicalPath(),'/')
	return self._catalog.uids.has_key(uid)


Dieter