[Zope] ZCatalog and Meta Types

tom smith tom@othermedia.com
Thu, 7 Nov 2002 14:37:31 +0000


Hello
I have a catalog full of catalogue aware objects (about 2,000). When I 
search for items of the meta_type "Commentoid" I seem to to get ALL the 
objects, hence my if filter below. Am I doing something wrong in my 
script or is my catalog wrong?

Thanks

######################

request = context.REQUEST
cat = context.catalog

size= int(size)
objs = [ ]
for item in cat.searchResults(meta_type='Commentoid'):
     rid = item.data_record_id_
     path = cat.getpath(rid)
     obj =  cat.getobject(rid, REQUEST=request)
     if obj.meta_type == 'Commentoid':
         objs.append(obj)
     if len(objs) == size:
         return objs

return objs




--
tom smith
http://www.othermedia.com/blog/
0207 089 5959
3rd Floor, The Pavilion, Newham's Row, London SE1 3UZ