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). --Brian Brinegar ECN Web Technician CEE Undergraduate Programmer MSEE 104 A 494-3106 http://www.geeksoft.net/
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
Dieter Maurer wrote:
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)
Perhaps that could go in the collector? cheers, Chris
Chris Withers writes:
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)
Perhaps that could go in the collector? I am not sure:
The catalog is quite flexible. It allows the caller of "catalog_object" to specify the uid under which the object should be cataloged. Only, if the uid is not provided (probably the normal use), it is computed from "getPhysicalPath". Of course, if it has been provided, the code above will break. Thus, "isObjectCataloged" is less general than "catalog_object". On the other hand, "getObject" will break too, when non-standard "uid"s are used. Thus, maybe, the "uid" feature should be scrapped. Dieter
participants (3)
-
brian.r.brinegar.1 -
Chris Withers -
Dieter Maurer